Question

My app seems to shut down silently about every 3-4 times I start it. No exception, no Force close message, it just opens for a split second and then shuts down. After that I can start it on average 3-4 times again without problems before the same thing happens again, and so on.

I've managed to pinpoint it to one of my tabs (I'm using a FragmentPagerAdapter). If I don't create that tab it never happens. Other than that it's proving impossible to track down, because it doesn't happen at the same place every time. When I look at my LogCat output it happens in slightly different places every time. The debugger LogCat-messages (see below) are also spread out with some of my applications logs in between, but that varies as well.

My app is fairly large, so posting sources here is not possible as I can't pinpoint the problem. I can say that the tab that's causing this is basically a Fragment containing a ListViewFragment that uses a custom SimpleCursorAdapter.

Would really appreciate anything that can point me in the right direction...

I'm getting this on a Nexus One with Android 2.3.6.

03-17 21:18:32.650: I/DEBUG(8687): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-17 21:18:32.650: I/DEBUG(8687): Build fingerprint: 'google/passion_vf/passion:2.3.6/GRK39F/224392.2:user/release-keys'
03-17 21:18:32.650: I/DEBUG(8687): pid: 8909, tid: 8910  >>> com.magnuswikhog.adrlibrary4 <<<
03-17 21:18:32.650: I/DEBUG(8687): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000c
03-17 21:18:32.650: I/DEBUG(8687):  r0 00000000  r1 00000007  r2 421b5d4c  r3 00000014
03-17 21:18:32.650: I/DEBUG(8687):  r4 100ffaf0  r5 00000004  r6 100ffb70  r7 43c9bda0
03-17 21:18:32.650: I/DEBUG(8687):  r8 100ffad0  r9 43c9bd98  10 43c9bd80  fp 800a5368
03-17 21:18:32.650: I/DEBUG(8687):  ip ad33f5d9  sp 100ffac8  lr 80049229  pc ad33f5e4  cpsr 20000030
03-17 21:18:32.650: I/DEBUG(8687):  d0  0072007500630028  d1  002e0072006f0000
03-17 21:18:32.650: I/DEBUG(8687):  d2  0043007400650029  d3  0074006e00750000
03-17 21:18:32.650: I/DEBUG(8687):  d4  00300033002a5c00  d5  0033002c00320030
03-17 21:18:32.650: I/DEBUG(8687):  d6  002c003100300030  d7  0036003000300031
03-17 21:18:32.650: I/DEBUG(8687):  d8  0000000000000000  d9  0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d10 0000000000000000  d11 0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d12 0000000000000000  d13 0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d14 0000000000000000  d15 0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d16 0000000004a50b72  d17 3ff0000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d18 42eccefa43de3400  d19 3fbc71c71c71c71c
03-17 21:18:32.650: I/DEBUG(8687):  d20 4008000000000000  d21 3fd99a27ad32ddf5
03-17 21:18:32.650: I/DEBUG(8687):  d22 3fd24998d6307188  d23 3fcc7288e957b53b
03-17 21:18:32.650: I/DEBUG(8687):  d24 3fc74721cad6b0ed  d25 3fc39a09d078c69f
03-17 21:18:32.650: I/DEBUG(8687):  d26 0000000000000000  d27 0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d28 0000000000000000  d29 0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  d30 0000000000000000  d31 0000000000000000
03-17 21:18:32.650: I/DEBUG(8687):  scr 80000012

03-17 21:18:32.720: I/DEBUG(8687):          #00  pc 0003f5e4  /system/lib/libandroid_runtime.so
03-17 21:18:32.720: I/DEBUG(8687):          #01  pc 00017e34  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #02  pc 0004968c  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #03  pc 0001d034  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #04  pc 000220e4  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #05  pc 00020fdc  /system/lib/libdvm.so

03-17 21:18:32.720: I/DEBUG(8687):          #06  pc 0005fc40  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #07  pc 0005fe54  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #08  pc 00055fec  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #09  pc 00056068  /system/lib/libdvm.so
03-17 21:18:32.720: I/DEBUG(8687):          #10  pc 000561fa  /system/lib/libdvm.so
03-17 21:18:32.730: I/DEBUG(8687):          #11  pc 000540ce  /system/lib/libdvm.so
03-17 21:18:32.730: I/DEBUG(8687):          #12  pc 000118e4  /system/lib/libc.so
03-17 21:18:32.730: I/DEBUG(8687):          #13  pc 000114b0  /system/lib/libc.so
03-17 21:18:32.730: I/DEBUG(8687): code around pc:
03-17 21:18:32.730: I/DEBUG(8687): ad33f5c4 b5104a03 6812447a fd08f7f4 bf00bd10 
03-17 21:18:32.730: I/DEBUG(8687): ad33f5d4 00047e48 b5104a04 6812447a fcfef7f4 
03-17 21:18:32.730: I/DEBUG(8687): ad33f5e4 681868c3 bf00bd10 00047e34 b5104a05 
03-17 21:18:32.730: I/DEBUG(8687): ad33f5f4 6812447a fcf2f7f4 681a68c3 3a01b10a 
03-17 21:18:32.730: I/DEBUG(8687): ad33f604 bd10601a 00047e1c 4614b513 447a4a0e 
03-17 21:18:32.730: I/DEBUG(8687): code around lr:
03-17 21:18:32.730: I/DEBUG(8687): 80049208 21014628 fd78f009 f01368f3 69330f40 
03-17 21:18:32.730: I/DEBUG(8687): 80049218 58e4bf08 58e4d000 21074628 fd6cf009 
03-17 21:18:32.730: I/DEBUG(8687): 80049228 bd704620 6905b570 460c4616 21014628 
03-17 21:18:32.730: I/DEBUG(8687): 80049238 fd62f009 f01368f3 69330f40 5ae4bf08 
03-17 21:18:32.730: I/DEBUG(8687): 80049248 58e4d001 4628b2a4 f0092107 b220fd55 
03-17 21:18:32.730: I/DEBUG(8687): stack:
03-17 21:18:32.730: I/DEBUG(8687):     100ffa88  4068e848  
03-17 21:18:32.730: I/DEBUG(8687):     100ffa8c  4068e848  
03-17 21:18:32.730: I/DEBUG(8687):     100ffa90  4050a018  
03-17 21:18:32.730: I/DEBUG(8687):     100ffa94  00000014  
03-17 21:18:32.730: I/DEBUG(8687):     100ffa98  40009280  
03-17 21:18:32.730: I/DEBUG(8687):     100ffa9c  4068e848  
03-17 21:18:32.730: I/DEBUG(8687):     100ffaa0  00000000  
03-17 21:18:32.730: I/DEBUG(8687):     100ffaa4  0008fcb0  
03-17 21:18:32.730: I/DEBUG(8687):     100ffaa8  421b5d4c  
03-17 21:18:32.730: I/DEBUG(8687):     100ffaac  80049229  /system/lib/libdvm.so
03-17 21:18:32.730: I/DEBUG(8687):     100ffab0  100ffaf0  
03-17 21:18:32.730: I/DEBUG(8687):     100ffab4  00000004  
03-17 21:18:32.730: I/DEBUG(8687):     100ffab8  100ffb70  
03-17 21:18:32.730: I/DEBUG(8687):     100ffabc  ad333feb  /system/lib/libandroid_runtime.so
03-17 21:18:32.730: I/DEBUG(8687):     100ffac0  df002777  
03-17 21:18:32.740: I/DEBUG(8687):     100ffac4  e3a070ad  
03-17 21:18:32.740: I/DEBUG(8687): #00 100ffac8  100ffaf0  
03-17 21:18:32.740: I/DEBUG(8687):     100ffacc  80017e38  /system/lib/libdvm.so
03-17 21:18:32.740: I/DEBUG(8687): #01 100ffad0  0008fcb0  
03-17 21:18:32.740: I/DEBUG(8687):     100ffad4  00000001  
03-17 21:18:32.740: I/DEBUG(8687):     100ffad8  100ffb70  
03-17 21:18:32.740: I/DEBUG(8687):     100ffadc  43c9bd94  
03-17 21:18:32.740: I/DEBUG(8687):     100ffae0  421b5fa4  
03-17 21:18:32.740: I/DEBUG(8687):     100ffae4  0008fcb0  
03-17 21:18:32.740: I/DEBUG(8687):     100ffae8  100ffaf0  
03-17 21:18:32.740: I/DEBUG(8687):     100ffaec  8004968f  /system/lib/libdvm.so
03-17 21:18:32.990: I/DEBUG(8687): debuggerd committing suicide to free the zombie!
03-17 21:18:32.990: I/BootReceiver(101): Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_TOMBSTONE)
03-17 21:18:33.000: E/InputDispatcher(101): channel '407606c0 com.magnuswikhog.adrlibrary4/com.magnuswikhog.adrlibrary4.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
03-17 21:18:33.000: E/InputDispatcher(101): channel '407606c0 com.magnuswikhog.adrlibrary4/com.magnuswikhog.adrlibrary4.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
03-17 21:18:33.000: D/Zygote(67): Process 8909 terminated by signal (11)
03-17 21:18:33.010: I/DEBUG(8930): debuggerd: Dec  9 2011 18:21:46
03-17 21:18:33.070: D/dalvikvm(191): GC_EXPLICIT freed 4K, 48% free 3120K/5959K, external 5052K/5767K, paused 550ms
03-17 21:18:33.070: D/dalvikvm(101): GC_FOR_MALLOC freed 1537K, 48% free 6246K/11911K, external 3513K/3905K, paused 76ms
03-17 21:18:33.070: I/ActivityManager(101): Process com.magnuswikhog.adrlibrary4 (pid 8909) has died.
03-17 21:18:33.070: I/WindowManager(101): WIN DEATH: Window{407606c0 com.magnuswikhog.adrlibrary4/com.magnuswikhog.adrlibrary4.MainActivity paused=false}
03-17 21:18:33.140: W/InputManagerService(101): Client not active, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@40a52960
03-17 21:18:33.270: D/dalvikvm(191): GC_EXPLICIT freed 2K, 48% free 3118K/5959K, external 5052K/5767K, paused 103ms
03-17 21:18:34.700: W/InputConnectionWrapper.ICC(174): Timed out waiting on IInputContextCallback
Était-ce utile?

La solution

I decoded the stack trace using passion-symbols-189904, which is also GRK39F but appears to be from a different device. I'm hoping libandroid_runtime.so is essentially unchanged. The trace is:

Stack Trace:
  RELADDR   FUNCTION                                     FILE:LINE
  0003f5e4  android::getNumRows(_JNIEnv*, _jobject*)+12      /usr/local/google/buildbot/repo_clients/goog/frameworks/base/core/jni/android_database_CursorWindow.cpp:508
  00017e34  dvmPlatformInvoke+116                        /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/arch/arm/CallEABI.S:243
  0004968c  dvmCallJNIMethod_virtualNoRef+52             /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/Jni.c:1790
  0001d034  dalvik_mterp+12                              /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/mterp/out/InterpAsm-armv7-a-neon.S:10017
  000220e4  dvmMterpStd+140                              /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/mterp/Mterp.c:105
  00020fdc  dvmInterpret+272                             /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/interp/Interp.c:1345
  0005fc40  dvmCallMethodV+300                           /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/interp/Stack.c:529
  0005fe54  dvmCallMethod+20                             /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/interp/Stack.c:434
  00055fec  callMethod+88                                /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/alloc/HeapWorker.c:244
  00056068  doHeapWork+52                                /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/alloc/HeapWorker.c:307
  000561fa  heapWorkerThreadStart+310                    /usr/local/google/buildbot/repo_clients/goog/dalvik/vm/alloc/HeapWorker.c:437

Assuming the symbols match, it's calling a CursorWindow function from a finalizer. You can't see the managed stack trace, so it's hard to say which finalizer. Looking at line 508 here, I'd guess "window" is NULL.

The fact that it's happening in a finalizer probably explains why it happens in slightly different places each time -- the timing is tied to garbage collection.

I would guess that there's something with a Cursor that you could be closing explicitly but aren't, so the finalizer is doing (and fumbling) the work.

Autres conseils

Are you using any custom fonts in the particular tab? I faced the exact same issue few years back and it narrowed down to a custom font that I had declared.

https://groups.google.com/forum/m/#!topic/android-developers/lNxOU-BMkJ0

http://dixonof.wordpress.com/2009/09/01/android-debuggerd-zombie/

Hope this helps!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top