first off I'm using a Nexus 7 (the 2013 one with the 1080p screen) running android 4.4(kitkat) and using eclipse with the adb pluggin for windows(64bit I think). My apps minSdkVersion is set to 11 and only operates in the landscape orientation.
The problem is I keep getting a OOM error after leaving my app run for a while. My dalvik heap remains constant at around 25~MB but using Debug.getNativeHeapAllocatedSize() and Debug.getNativeHeapSize() it says my native heap size is constantly increasing until the app crashes from a OOM error.
I'm using hardware acceleration by declaring android:hardwareAccelerated="true" in my manifest and using setLayerType( View.LAYER_TYPE_HARDWARE , null ) in my SurfaceView constructor to set it to be hardware accelerated.
(Using setLayerType( View.LAYER_TYPE_HARDWARE , null ) was my problem, I removed it and the memory leak stopped).
Weird thing is once I press the home button then go back to my app the native heap resets back to its initial value.
My proof the dalvik heap is remaining constant and the native heap is growing is from these messages in LogCat:
debug.native heap : allocated 191.45MB of 191.73MB (0.28MB free)
debug.VM heap memory: allocated 23.00MB VM Heap Size: 31.00MB MaxHeapSize: 192.00MB
: availMemory 634.95MB , lowMemory? false , threshold 96.00MB
: canvas.isHardwareAccelerated() = true
: GC_FOR_ALLOC freed 4566K, 30% free 22608K/32236K, paused 32ms, total 32ms
: debug. =================================
: debug.native heap : allocated 197.01MB of 197.27MB (0.26MB free)
: debug.VM heap memory: allocated 22.00MB VM Heap Size: 31.00MB MaxHeapSize: 192.00MB
: availMemory 629.38MB , lowMemory? false , threshold 96.00MB
Then once the native heap is full i get the error:
01-03 17:18:23.424: A/libc(15604): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 15604 (ebe.kingscastle)
01-03 17:18:23.524: I/DEBUG(176): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-03 17:18:23.524: I/DEBUG(176): Build fingerprint: 'google/razor/flo:4.4.2/KOT49H/937116:user/release-keys'
01-03 17:18:23.524: I/DEBUG(176): Revision: '0'
01-03 17:18:23.524: I/DEBUG(176): pid: 15604, tid: 15604, name: ebe.kingscastle >>> com.kaebe.kingscastle <<<
01-03 17:18:23.524: I/DEBUG(176): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
01-03 17:18:23.614: I/DEBUG(176): r0 00000000 r1 00020004 r2 00000000 r3 795402d8
01-03 17:18:23.614: I/DEBUG(176): r4 795402d8 r5 000000a0 r6 bef63450 r7 75aac91c
01-03 17:18:23.614: I/DEBUG(176): r8 791e0378 r9 00000000 sl 00000001 fp 76b8ef38
01-03 17:18:23.614: I/DEBUG(176): ip 00000001 sp bef63378 lr 400e7e6b pc 4015ab6a cpsr 60010030
01-03 17:18:23.614: I/DEBUG(176): d0 44ece00043de0000 d1 00000000441b8000
01-03 17:18:23.614: I/DEBUG(176): d2 43de000000000000 d3 44bda00043ce0000
01-03 17:18:23.614: I/DEBUG(176): d4 44bda00044b9a000 d5 43ac800043ce0000
01-03 17:18:23.614: I/DEBUG(176): d6 43ce000043cc8000 d7 44b9a00044bda000
01-03 17:18:23.614: I/DEBUG(176): d8 0000078000000450 d9 41600000440a0000
01-03 17:18:23.614: I/DEBUG(176): d10 0000000042080000 d11 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d12 0000000000000000 d13 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d14 0000000000000000 d15 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d16 0000000000000000 d17 3ff0000000000000
01-03 17:18:23.614: I/DEBUG(176): d18 0000000000000000 d19 3ff0000000000000
01-03 17:18:23.614: I/DEBUG(176): d20 0000000000000000 d21 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d22 0000000000000000 d23 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d24 0000000000000000 d25 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d26 3ff0000000000000 d27 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d28 3ff0000000000000 d29 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): d30 0000000000000000 d31 0000000000000000
01-03 17:18:23.614: I/DEBUG(176): scr 20000012
01-03 17:18:23.624: I/DEBUG(176): backtrace:
01-03 17:18:23.624: I/DEBUG(176): #00 pc 0000bb6a /system/lib/libutils.so (android::LinearAllocator::newPage(unsigned int)+27)
01-03 17:18:23.624: I/DEBUG(176): #01 pc 0000bba3 /system/lib/libutils.so (android::LinearAllocator::ensureNext(unsigned int)+52)
01-03 17:18:23.624: I/DEBUG(176): #02 pc 0000bbe7 /system/lib/libutils.so (android::LinearAllocator::alloc(unsigned int)+40)
01-03 17:18:23.624: I/DEBUG(176): #03 pc 00013e95 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #04 pc 00014621 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #05 pc 00012ccd /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #06 pc 000136a3 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #07 pc 00013719 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #08 pc 0001a179 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #09 pc 00022717 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #10 pc 0002275f /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #11 pc 000231fd /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): #12 pc 00065cf3 /system/lib/libandroid_runtime.so
01-03 17:18:23.624: I/DEBUG(176): #13 pc 0001dbcc /system/lib/libdvm.so (dvmPlatformInvoke+112)
01-03 17:18:23.624: I/DEBUG(176): #14 pc 0004e123 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
01-03 17:18:23.624: I/DEBUG(176): #15 pc 00026fe0 /system/lib/libdvm.so
01-03 17:18:23.624: I/DEBUG(176): #16 pc 0002dfa0 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
01-03 17:18:23.624: I/DEBUG(176): #17 pc 0002b638 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
01-03 17:18:23.624: I/DEBUG(176): #18 pc 00060865 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+392)
01-03 17:18:23.624: I/DEBUG(176): #19 pc 000687c7 /system/lib/libdvm.so
01-03 17:18:23.624: I/DEBUG(176): #20 pc 00026fe0 /system/lib/libdvm.so
01-03 17:18:23.624: I/DEBUG(176): #21 pc 0002dfa0 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
01-03 17:18:23.624: I/DEBUG(176): #22 pc 0002b638 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
01-03 17:18:23.624: I/DEBUG(176): #23 pc 00060581 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
01-03 17:18:23.624: I/DEBUG(176): #24 pc 00049d0b /system/lib/libdvm.so
01-03 17:18:23.624: I/DEBUG(176): #25 pc 0004cde7 /system/lib/libandroid_runtime.so
01-03 17:18:23.624: I/DEBUG(176): #26 pc 0004db0b /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+354)
01-03 17:18:23.624: I/DEBUG(176): #27 pc 0000105b /system/bin/app_process
01-03 17:18:23.624: I/DEBUG(176): #28 pc 0000e34b /system/lib/libc.so (__libc_init+50)
01-03 17:18:23.624: I/DEBUG(176): #29 pc 00000d7c /system/bin/app_process
01-03 17:18:23.624: I/DEBUG(176): stack:
01-03 17:18:23.624: I/DEBUG(176): bef63338 00000000
01-03 17:18:23.624: I/DEBUG(176): bef6333c 400e7e6b /system/lib/libc.so (dlmalloc+4254)
01-03 17:18:23.624: I/DEBUG(176): bef63340 00020004
01-03 17:18:23.624: I/DEBUG(176): bef63344 40120e00 /system/lib/libc.so
01-03 17:18:23.624: I/DEBUG(176): bef63348 400e6dcd /system/lib/libc.so (dlmalloc)
01-03 17:18:23.624: I/DEBUG(176): bef6334c 795402d8 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef63350 000000a0
01-03 17:18:23.624: I/DEBUG(176): bef63354 bef63450 [stack]
01-03 17:18:23.624: I/DEBUG(176): bef63358 75aac91c [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef6335c 791e0378 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef63360 00000000
01-03 17:18:23.624: I/DEBUG(176): bef63364 00000001
01-03 17:18:23.624: I/DEBUG(176): bef63368 76b8ef38 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef6336c 400e4bf9 /system/lib/libc.so (malloc+12)
01-03 17:18:23.624: I/DEBUG(176): bef63370 795402d8 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef63374 4015ab69 /system/lib/libutils.so (android::LinearAllocator::newPage(unsigned int)+26)
01-03 17:18:23.624: I/DEBUG(176): #00 bef63378 7dbdc008 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef6337c 4015aba7 /system/lib/libutils.so (android::LinearAllocator::ensureNext(unsigned int)+56)
01-03 17:18:23.624: I/DEBUG(176): #01 bef63380 795402d8 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef63384 4015abeb /system/lib/libutils.so (android::LinearAllocator::alloc(unsigned int)+44)
01-03 17:18:23.624: I/DEBUG(176): #02 bef63388 00000001
01-03 17:18:23.624: I/DEBUG(176): bef6338c 79540150 [anon:libc_malloc]
01-03 17:18:23.624: I/DEBUG(176): bef63390 40bdbf45 /system/lib/libhwui.so
01-03 17:18:23.624: I/DEBUG(176): bef63394 40bd9e99 /system/lib/libhwui.so
01-03 17:18:23.644: I/DEBUG(176): memory near r1:
01-03 17:18:23.644: I/DEBUG(176): 0001ffe4 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 0001fff4 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020004 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020014 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020024 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020034 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020044 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020054 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020064 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020074 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020084 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 00020094 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 000200a4 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 000200b4 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 000200c4 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): 000200d4 ffffffff ffffffff ffffffff ffffffff
01-03 17:18:23.644: I/DEBUG(176): memory near r3:
01-03 17:18:23.644: I/DEBUG(176): 795402b8 0000000c 0a0a0a01 00000008 3f400000
01-03 17:18:23.644: I/DEBUG(176): 795402c8 00000000 00000000 0000000b 7953e5f8
01-03 17:18:23.644: I/DEBUG(176): 795402d8 00020000 00000400 7dbfbfec 7dbdc008
01-03 17:18:23.644: I/DEBUG(176): 795402e8 79540400 3f986f40 0005fae0 00001fd0
01-03 17:18:23.644: I/DEBUG(176): 795402f8 00000000 0000004b 00000001 000000c5
01-03 17:18:23.644: I/DEBUG(176): 79540308 000001a5 00000046 000000d1 3e450000
01-03 17:18:23.644: I/DEBUG(176): 79540318 3ed28000 3e858000 3f1d8000 0000004b
01-03 17:18:23.644: I/DEBUG(176): 79540328 00610000 00000000 0000000f ffffff20
01-03 17:18:23.644: I/DEBUG(176): 79540338 00000000 00000000 76b97ef0 0000005b
01-03 17:18:23.644: I/DEBUG(176): 79540348 76448690 42923333 3f800000 00000000
01-03 17:18:23.644: I/DEBUG(176): 79540358 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 79540368 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 79540378 00000000 ff888888 00000000 40800000
01-03 17:18:23.644: I/DEBUG(176): 79540388 0b000501 752e3d30 00000001 00000001
01-03 17:18:23.644: I/DEBUG(176): 79540398 00000054 00000023 0000000a 00000001
01-03 17:18:23.644: I/DEBUG(176): 795403a8 4c2d6e65 2d6e7461 75005355 78eba550
01-03 17:18:23.644: I/DEBUG(176): memory near r4:
01-03 17:18:23.644: I/DEBUG(176): 795402b8 0000000c 0a0a0a01 00000008 3f400000
01-03 17:18:23.644: I/DEBUG(176): 795402c8 00000000 00000000 0000000b 7953e5f8
01-03 17:18:23.644: I/DEBUG(176): 795402d8 00020000 00000400 7dbfbfec 7dbdc008
01-03 17:18:23.644: I/DEBUG(176): 795402e8 79540400 3f986f40 0005fae0 00001fd0
01-03 17:18:23.644: I/DEBUG(176): 795402f8 00000000 0000004b 00000001 000000c5
01-03 17:18:23.644: I/DEBUG(176): 79540308 000001a5 00000046 000000d1 3e450000
01-03 17:18:23.644: I/DEBUG(176): 79540318 3ed28000 3e858000 3f1d8000 0000004b
01-03 17:18:23.644: I/DEBUG(176): 79540328 00610000 00000000 0000000f ffffff20
01-03 17:18:23.644: I/DEBUG(176): 79540338 00000000 00000000 76b97ef0 0000005b
01-03 17:18:23.644: I/DEBUG(176): 79540348 76448690 42923333 3f800000 00000000
01-03 17:18:23.644: I/DEBUG(176): 79540358 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 79540368 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 79540378 00000000 ff888888 00000000 40800000
01-03 17:18:23.644: I/DEBUG(176): 79540388 0b000501 752e3d30 00000001 00000001
01-03 17:18:23.644: I/DEBUG(176): 79540398 00000054 00000023 0000000a 00000001
01-03 17:18:23.644: I/DEBUG(176): 795403a8 4c2d6e65 2d6e7461 75005355 78eba550
01-03 17:18:23.644: I/DEBUG(176): memory near r6:
01-03 17:18:23.644: I/DEBUG(176): bef63430 00000000 79540150 7644dd28 00000000
01-03 17:18:23.644: I/DEBUG(176): bef63440 6d46ea14 41504418 bef6351c 40bd971d
01-03 17:18:23.644: I/DEBUG(176): bef63450 bef6346c 00000000 00000000 40be017d
01-03 17:18:23.644: I/DEBUG(176): bef63460 448a0000 00000000 44f00000 79540150
01-03 17:18:23.644: I/DEBUG(176): bef63470 791e0378 00000001 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): bef63480 440a0000 41600000 400d1028 00000000
01-03 17:18:23.644: I/DEBUG(176): bef63490 791d0f28 7644dd28 00000000 40be871b
01-03 17:18:23.644: I/DEBUG(176): bef634a0 7644dd28 00000000 00000001 791d0f28
01-03 17:18:23.644: I/DEBUG(176): bef634b0 bef63508 40be8763 00410001 7644dd28
01-03 17:18:23.644: I/DEBUG(176): bef634c0 00000000 00000004 6d46ea2c 40be9201
01-03 17:18:23.644: I/DEBUG(176): bef634d0 448a0000 00000001 00000000 40be91cd
01-03 17:18:23.644: I/DEBUG(176): bef634e0 41504408 40203cf5 448a0000 00000001
01-03 17:18:23.644: I/DEBUG(176): bef634f0 6d4e68b8 41522bd0 00000000 00000780
01-03 17:18:23.644: I/DEBUG(176): bef63500 00000450 00000001 6d46ea14 00000001
01-03 17:18:23.644: I/DEBUG(176): bef63510 00000008 415e6fd0 41ed3c88 41553127
01-03 17:18:23.644: I/DEBUG(176): bef63520 6d46ea14 6f0b0a82 40203caf 41504418
01-03 17:18:23.644: I/DEBUG(176): memory near r7:
01-03 17:18:23.644: I/DEBUG(176): 75aac8fc 75cef668 fefefe00 00000000 43cc8001
01-03 17:18:23.644: I/DEBUG(176): 75aac90c 00000000 3f800000 00000000 3f800000
01-03 17:18:23.644: I/DEBUG(176): 75aac91c 40bf9b88 752d6fc8 fbfbfb00 44b9a000
01-03 17:18:23.644: I/DEBUG(176): 75aac92c 43ca0000 44bda000 43cc0000 40bf9740
01-03 17:18:23.644: I/DEBUG(176): 75aac93c 752cc218 00000000 44bf2000 43cc8000
01-03 17:18:23.644: I/DEBUG(176): 75aac94c 44c2a000 43e00000 752c45b8 75cef668
01-03 17:18:23.644: I/DEBUG(176): 75aac95c 40bf9700 00000000 43cc8001 00000000
01-03 17:18:23.644: I/DEBUG(176): 75aac96c 3f800000 00000000 3f800000 40bf9740
01-03 17:18:23.644: I/DEBUG(176): 75aac97c 78e9b7a8 00000000 44bee000 43ce0000
01-03 17:18:23.644: I/DEBUG(176): 75aac98c 44c2e000 43de0000 76b95460 75cef668
01-03 17:18:23.644: I/DEBUG(176): 75aac99c 40bf9b00 00000000 43cc8001 00000000
01-03 17:18:23.644: I/DEBUG(176): 75aac9ac 3f800000 00000000 3f800000 40bf9b88
01-03 17:18:23.644: I/DEBUG(176): 75aac9bc 752d6fc8 43cd0000 44bee000 43ca0000
01-03 17:18:23.644: I/DEBUG(176): 75aac9cc 44c2e000 43cc0000 40bf9740 752cc218
01-03 17:18:23.644: I/DEBUG(176): 75aac9dc 75aac900 44c46000 43cc8000 44c7e000
01-03 17:18:23.644: I/DEBUG(176): 75aac9ec 43e00000 752c45b8 75cef668 40bf9700
01-03 17:18:23.644: I/DEBUG(176): memory near r8:
01-03 17:18:23.644: I/DEBUG(176): 791e0358 00000001 00000002 00000003 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e0368 00000000 000003e8 00000000 00000243
01-03 17:18:23.644: I/DEBUG(176): 791e0378 40bfa170 00000780 00000450 3a888889
01-03 17:18:23.644: I/DEBUG(176): 791e0388 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e0398 baed7304 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e03a8 00000000 bf800000 00000000 bf800000
01-03 17:18:23.644: I/DEBUG(176): 791e03b8 3f800000 80000000 3f800000 00000013
01-03 17:18:23.644: I/DEBUG(176): 791e03c8 3f800000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e03d8 00000000 3f800000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e03e8 00000000 00000000 3f800000 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e03f8 00000000 00000000 00000000 3f800000
01-03 17:18:23.644: I/DEBUG(176): 791e0408 00000010 00000002 7644c788 752c3078
01-03 17:18:23.644: I/DEBUG(176): 791e0418 00000000 00000000 44f00000 448a0000
01-03 17:18:23.644: I/DEBUG(176): 791e0428 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 791e0438 00000000 3f800000 00000000 3f800000
01-03 17:18:23.644: I/DEBUG(176): 791e0448 00000000 00000000 3f800000 00000000
01-03 17:18:23.644: I/DEBUG(176): memory near fp:
01-03 17:18:23.644: I/DEBUG(176): 76b8ef18 00250003 00550043 004e0056 00030047
01-03 17:18:23.644: I/DEBUG(176): 76b8ef28 00000000 00000007 00000040 0000001b
01-03 17:18:23.644: I/DEBUG(176): 76b8ef38 76b97af8 76b97c78 76b97c70 76b97c88
01-03 17:18:23.644: I/DEBUG(176): 76b8ef48 00000018 0000005b 76448690 44160000
01-03 17:18:23.644: I/DEBUG(176): 76b8ef58 3f800000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 76b8ef68 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 76b8ef78 00000000 00000000 00000000 ff888888
01-03 17:18:23.644: I/DEBUG(176): 76b8ef88 00000000 40800000 0b010501 791e06e0
01-03 17:18:23.644: I/DEBUG(176): 76b8ef98 00000001 00000001 00000009 0000005b
01-03 17:18:23.644: I/DEBUG(176): 76b8efa8 76448690 42923333 3f800000 00000000
01-03 17:18:23.644: I/DEBUG(176): 76b8efb8 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 76b8efc8 00000000 00000000 00000000 00000000
01-03 17:18:23.644: I/DEBUG(176): 76b8efd8 00000000 ff444444 00000000 40800000
01-03 17:18:23.644: I/DEBUG(176): 76b8efe8 0b000501 78ebaf68 00000001 00000001
01-03 17:18:23.644: I/DEBUG(176): 76b8eff8 00000054 0000002b 00000001 00000010
01-03 17:18:23.644: I/DEBUG(176): 76b8f008 00000000 00000000 76e80480 00000000
01-03 17:18:23.644: I/DEBUG(176): memory near sp:
01-03 17:18:23.644: I/DEBUG(176): bef63358 75aac91c 791e0378 00000000 00000001
01-03 17:18:23.644: I/DEBUG(176): bef63368 76b8ef38 400e4bf9 795402d8 4015ab69
01-03 17:18:23.644: I/DEBUG(176): bef63378 7dbdc008 4015aba7 795402d8 4015abeb
01-03 17:18:23.644: I/DEBUG(176): bef63388 00000001 79540150 40bdbf45 40bd9e99
01-03 17:18:23.644: I/DEBUG(176): bef63398 79540150 40bda625 00000003 00000001
01-03 17:18:23.644: I/DEBUG(176): bef633a8 752c3280 448a1000 448a0000 448a0000
01-03 17:18:23.644: I/DEBUG(176): bef633b8 00000000 00000001 76b95460 448a0000
01-03 17:18:23.644: I/DEBUG(176): bef633c8 00000000 00000450 00000780 bef63450
01-03 17:18:23.644: I/DEBUG(176): bef633d8 40bdbf45 bef63450 00000001 0000010d
01-03 17:18:23.644: I/DEBUG(176): bef633e8 00000000 00000001 76b8ef38 40bd8ccf
01-03 17:18:23.644: I/DEBUG(176): bef633f8 00000001 75aac91c 00000001 7953c9e0
01-03 17:18:23.644: I/DEBUG(176): bef63408 791e0378 40bd96a7 448a0000 00000000
01-03 17:18:23.644: I/DEBUG(176): bef63418 00000000 400e4c0d 00000000 75aac91c
01-03 17:18:23.644: I/DEBUG(176): bef63428 00000000 791d0f28 00000000 79540150
01-03 17:18:23.644: I/DEBUG(176): bef63438 7644dd28 00000000 6d46ea14 41504418
01-03 17:18:23.644: I/DEBUG(176): bef63448 bef6351c 40bd971d bef6346c 00000000
01-03 17:18:23.644: I/DEBUG(176): code around pc:
01-03 17:18:23.644: I/DEBUG(176): 4015ab48 6182020c b508bd10 695a4603 f0213107
01-03 17:18:23.644: I/DEBUG(176): 4015ab58 18110003 615969da 61d91c51 ebf0f7fe
01-03 17:18:23.644: I/DEBUG(176): 4015ab68 60022200 b510bd08 f7ff4604 bb08ffc0
01-03 17:18:23.644: I/DEBUG(176): 4015ab78 b16b68e3 f5b06820 d2093f00 f5b10041
01-03 17:18:23.644: I/DEBUG(176): 4015ab88 bf283f00 3100f44f f0221cca 60230303
01-03 17:18:23.644: I/DEBUG(176): 4015ab98 682169a0 46201842 f7ff61a2 68e1ffd4
01-03 17:18:23.644: I/DEBUG(176): 4015aba8 6008b101 60e06923 6120b903 f0203007
01-03 17:18:23.644: I/DEBUG(176): 4015abb8 60a20203 b538bd10 68433103 0503f021
01-03 17:18:23.644: I/DEBUG(176): 4015abc8 429d4604 4629d909 ff91f7ff e00fb928
01-03 17:18:23.644: I/DEBUG(176): 4015abd8 300760e0 0003f020 4620bd38 f7ff4629
01-03 17:18:23.644: I/DEBUG(176): 4015abe8 68a0ffc2 194269a1 1b4d60a2 bd3861a5
01-03 17:18:23.644: I/DEBUG(176): 4015abf8 46204629 ffa7f7ff 6a236921 62221c5a
01-03 17:18:23.644: I/DEBUG(176): 4015ac08 68e36001 2b006120 e7e1d1e3 edd0b570
01-03 17:18:23.644: I/DEBUG(176): 4015ac18 f2407a05 ee1773cf 429a2a90 4604b086
01-03 17:18:23.644: I/DEBUG(176): 4015ac28 461e460d 4b33d804 7ae7eef8 e00b447b
01-03 17:18:23.654: I/DEBUG(176): 4015ac38 4282482e 4b30d804 7acbeefa e003447b
01-03 17:18:23.654: I/DEBUG(176): code around lr:
01-03 17:18:23.654: I/DEBUG(176): 400e7e48 e0043608 fafcf003 210c2600 49356001
01-03 17:18:23.654: I/DEBUG(176): 400e7e58 f8d14479 079321bc f501d53f f7fd70e0
01-03 17:18:23.654: I/DEBUG(176): 400e7e68 e03aed3c 42b06898 a8d4f43f b8d5f7ff
01-03 17:18:23.654: I/DEBUG(176): 400e7e78 42b56895 aa31f43f ba32f7ff 447e4e2a
01-03 17:18:23.654: I/DEBUG(176): 400e7e88 01bcf8d6 0204f040 21bcf8c6 36fff04f
01-03 17:18:23.654: I/DEBUG(176): 400e7e98 4b13e462 d8d5429f f04fe467 e4850901
01-03 17:18:23.654: I/DEBUG(176): 400e7ea8 f01268da f43f0f08 e4d1acc1 071068da
01-03 17:18:23.654: I/DEBUG(176): 400e7eb8 ace4f57f 481de6cf f7ff4478 481cb8b1
01-03 17:18:23.654: I/DEBUG(176): 400e7ec8 f7ff4478 688cb8ad f43f4294 e5c9adc8
01-03 17:18:23.654: I/DEBUG(176): 400e7ed8 f47f1c71 2500ac22 4630e7d0 8ffee8bd
01-03 17:18:23.654: I/DEBUG(176): 400e7ee8 7ffffffe 00032d8c 0003d6d6 0003d6ba
01-03 17:18:23.654: I/DEBUG(176): 400e7ef8 0003d6a6 0003d63e 0003d5ae 0003d556
01-03 17:18:23.654: I/DEBUG(176): 400e7f08 0003d53c 0003d51a 0003d4de 0003d474
01-03 17:18:23.654: I/DEBUG(176): 400e7f18 00032ac0 0003d3dc 0003d384 0003d36c
01-03 17:18:23.654: I/DEBUG(176): 400e7f28 0003d352 0003d324 0003d2f6 0003293c
01-03 17:18:23.654: I/DEBUG(176): 400e7f38 00032934 4ff7e92d 4b5c461e 468a4604
01-03 17:18:23.834: W/ActivityManager(593): Force finishing activity com.kaebe.kingscastle/com.kaebe.kingscastlelib.KingsCastle
01-03 17:18:24.174: I/ActivityManager(593): Process com.kaebe.kingscastle (pid 15604) has died.
01-03 17:18:24.174: I/WindowState(593): WIN DEATH: Window{42329cd8 u0 SurfaceView}
01-03 17:18:24.174: I/WindowState(593): WIN DEATH: Window{42af0fe8 u0 com.kaebe.kingscastle/com.kaebe.kingscastle.KingsCastleFree}
01-03 17:18:24.184: I/WindowState(593): WIN DEATH: Window{4236fa28 u0 SurfaceView}
01-03 17:18:24.184: I/WindowState(593): WIN DEATH: Window{4236efa8 u0 com.kaebe.kingscastle/com.kaebe.kingscastlelib.KingsCastle}
01-03 17:18:24.194: I/ActivityManager(593): Start proc com.kaebe.kingscastle for activity com.kaebe.kingscastle/.KingsCastleFree: pid=17067 uid=10115 gids={50115}
01-03 17:18:24.204: D/dalvikvm(17067): Late-enabling CheckJNI
01-03 17:18:24.235: D/Zygote(178): Process 15604 terminated by signal (11)
I want to know how to prevent native heap memory leaks since i have no idea how to alloc on the native block over the dalvik heap.
I solved the issue by the way, just want to write it out to help other people since I couldn't find an answer to this from days of searching.
I spent days looking for a solution to why my native heap was increasing and my dalvik heap remained constant. After many questions and android documentation pages read i eventually tried to shut off hardware acceleration since I came across a OOM question relating the two already.
I removed the line setLayerType( View.LAYER_TYPE_HARDWARE , null ) from my SurfaceView and the problem went away. I added that line after some advice from some suggestions on trying to get hardware acceleration turned on and i never really understood what i was doing there. For some reason that line caused about 1mb/2seconds to be added to the native heap until my program crashed.
So to anyone who's looking for solutions to problems try one thing at a time and understand what your trying before you copy paste it to your code.
I still don't know why that caused the native heap to constantly increase though.
I hope this helps someone with OOM native heap issues.
when animation over
try to add setLayerType( View.LAYER_TYPE_SOFTWARE , null) in order to turn off hardware acceleration
maybe solove the issue?
Related
An error occurs at times (more often than not, actually).
A/libc: Fatal signal 11 (SIGSEGV) at 0x830ab2cc (code=1), thread 24294 (Thread-1174)
The code is as follows:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.displaygraph);
Intent intent = getIntent();
GraphView graph = (GraphView) findViewById(R.id.graph);
series = new LineGraphSeries<DataPoint>();
graph.addSeries(series);
Viewport viewport = graph.getViewport();
viewport.setYAxisBoundsManual(true);
viewport.setXAxisBoundsManual(true);
viewport.setMinY(0);
double max=data[0];
for (int i = 0; i < data.length; i++) {
if (data[i] > max) {
max = data[i];
Log.w(TAG,"max"+max);
}
}
viewport.setMaxY(max);
viewport.setMinX(0);
viewport.setMaxX(450);
graph.getViewport().setScalable(true);
graph.getViewport().setScalableY(true);
seriesecg = new LineGraphSeries<DataPoint>();
GraphView graphecg = (GraphView) findViewById(R.id.graphecg);
graphecg.addSeries(seriesecg);
Viewport viewportecg = graphecg.getViewport();
viewportecg.setYAxisBoundsManual(true);
viewportecg.setXAxisBoundsManual(true);
viewportecg.setMinY(0);
viewportecg.setMaxY(3000);
viewportecg.setMinX(0);
viewportecg.setMaxX(450);
graphecg.getViewport().setScalable(true);
graphecg.getViewport().setScalableY(true);
}
#Override
protected void onResume() {
super.onResume();
new Thread(new Runnable() {
#Override
public void run() {
// we add 450 new entries
for (int i = 0; i <= 449; i++) {
final int finalI = i;
final int finalII = i;
Log.w(TAG, "finalI"+finalI);
runOnUiThread(new Runnable() {
#Override
public void run() {
addEntry(finalI,ppg);
}
});
// sleep to slow down the add of entries
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// manage error ...
}
}
}
}).start();
}
// add random data to graph
private void addEntry(int i,double[] data) {
if(i<=449) {
Log.w(TAG, "ppg" + data[i]+"/"+i);
series.appendData(new DataPoint(i, data[i]), false, 450);
}
}
The logcat is as follows:
01-22 19:27:01.650 1041-1370/? I/KeyguardUpdateMonitor: visibility is same
01-22 19:27:01.650 818-818/? D/CrashAnrDetector: Build: samsung/lt03ltezs/lt03lte:4.4.2/KOT49H/P605ZSUCOD1:user/release-keys
Hardware: MSM8974
Revision: 11
Bootloader: P605ZSUCOD1
Radio: unknown
Kernel: Linux version 3.4.0-4665213 (dpi#SWDD5621) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Mon Apr 13 11:19:19 KST 2015
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/lt03ltezs/lt03lte:4.4.2/KOT49H/P605ZSUCOD1:user/release-keys'
Revision: '11'
pid: 12476, tid: 12476, name: elerometergraph >>> com.android.accelerometergraph <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 82f5583c
r0 402aaedb r1 82f55838 r2 402aaed8 r3 42caa968
r4 bedfd1b8 r5 42277008 r6 bedfd20c r7 402aaaa8
r8 00000000 r9 42caad98 sl 416b049c fp 80000000
ip 00000003 sp bedfd010 lr 4172ff51 pc 4172ff3e cpsr 900f0030
d0 0080000000001000 d1 0200000000004000
d2 0000000000000008 d3 0000888800000000
d4 0000004080000000 d5 0000200000000000
d6 1000000000200000 d7 0000800000000010
d8 44618b1844624bf2 d9 3e99999a4040da00
d10 43380000c3892666 d11 c389266644618b18
d12 4252ccd044624bf2 d13 c07124cccccccccd
d14 4034000000000000 d15 43a38000c3892666
d16 0100000000000000 d17 0004400000020000
d18 0004400000000000 d19 2000010000440000
d20 000a402000088100 d21 0000000000044000
d22 0022000000008800 d23 1100000000000000
d24 3fd1b10853a79915 d25 3fd554fa9ca0567a
d26 3fdb6db71408e660 d27 3fe33333332d4313
d28 3ff0000000000000 d29 0000000000000001
d30 4059000000000000 d31 4024000000000000
scr 20000013
backtrace:
#00 pc 00075f3e /system/lib/libdvm.so (mspace_bulk_free+89)
#01 pc 00076e63 /system/lib/libdvm.so (dvmHeapSourceFreeList(unsigned int, void**)+70)
#02 pc 0003a7b4 /system/lib/libdvm.so
#03 pc 0002c4ec /system/lib/libdvm.so (dvmHeapBitmapSweepWalk(HeapBitmap const*, HeapBitmap const*, unsigned int, unsigned int, void (*)(unsigned int, void**, void*), void*)+176)
#04 pc 0003b53c /system/lib/libdvm.so (dvmHeapSweepUnmarkedObjects(bool, bool, unsigned int*, unsigned int*)+284)
#05 pc 0002c94c /system/lib/libdvm.so (dvmCollectGarbageInternal(GcSpec const*)+452)
#06 pc 0002d45c /system/lib/libdvm.so (dvmMalloc(unsigned int, int)+356)
#07 pc 0006cb03 /system/lib/libdvm.so
#08 pc 0002c36f /dev/ashmem/dalvik-jit-code-cache (deleted)
stack:
bedfcfd0 bedfd1ec [stack]
bedfcfd4 40129d5d /system/lib/libc.so (realloc+12)
bedfcfd8 00000008
bedfcfdc bedfd2a8 [stack]
bedfcfe0 78e476f8
bedfcfe4 00000000
bedfcfe8 00000003
bedfcfec bedfd100 [stack]
bedfcff0 42ca9b88 /dev/ashmem/dalvik-heap (deleted)
bedfcff4 bedfd174 [stack]
bedfcff8 42277008 /dev/ashmem/dalvik-heap (deleted)
bedfcffc bedfd20c [stack]
bedfd000 42caa968 /dev/ashmem/dalvik-heap (deleted)
bedfd004 00000000
bedfd008 42caa950 /dev/ashmem/dalvik-heap (deleted)
bedfd00c 4172ff51 /system/lib/libdvm.so (mspace_bulk_free+108)
#00 bedfd010 00029864
bedfd014 416b0438
bedfd018 00000065
bedfd01c 00000065
bedfd020 bedfd078 [stack]
bedfd024 416b0438
bedfd028 42277008 /dev/ashmem/dalvik-heap (deleted)
bedfd02c 41730e67 /system/lib/libdvm.so (dvmHeapSourceFreeList(unsigned int, void**)+74)
#01 bedfd030 00000065
bedfd034 402abf98 /system/lib/libandroidfw.so
bedfd038 bedfd2cc [stack]
bedfd03c bedfd2cc [stack]
bedfd040 00000065
bedfd044 61fff040 /dev/ashmem/dalvik-bitmap-2 (deleted)
bedfd048 617ff040 /dev/ashmem/dalvik-bitmap-1 (deleted)
bedfd04c 0001acbf
bedfd050 bedfd078 [stack]
bedfd054 416f47b8 /system/lib/libdvm.so
#02 bedfd058 00000000
bedfd05c 00000000
bedfd060 00000030
bedfd064 00015010
bedfd068 01501
01-22 19:27:01.650 818-818/? D/CrashAnrDetector: processName:com.android.accelerometergraph
01-22 19:27:01.650 818-818/? D/CrashAnrDetector: broadcastEvent : com.android.accelerometergraph SYSTEM_TOMBSTONE
01-22 19:27:01.660 1041-1055/? D/KeyguardUpdateMonitor: sendKeyguardVisibilityChanged(true)
01-22 19:27:01.660 1041-1055/? I/KeyguardUpdateMonitor: visibility is same
Sometimes the code works but sometimes it doesn't... but when it occurs, it does so before the value of i reaches 449. I thought it had something to do with my jni code. but after commenting and deleting everything that would call a c code, the error still occurred.
Thank you for your help...
I have java application, where I use C++ code. All c++ code is compiled to .so file.
I have to write unit tests for native part of the project.
I wrote such unit test:
#include <gtest/gtest.h>
#include <gtest-all.cc>
#include <myTestedFile.h>
#include <jni.h>
#include <iostream>
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
RUN_ALL_TESTS();
return 0;
}
TEST(MyTest, Test1)
{
jclass jc;
int k = jni_return_five((JNIEnv*)0, jc);
ASSERT_EQ(k,5);
}
there is file myTestedFile.cpp
#include "myTestedFile.h"
JNIEXPORT jint JNICALL jni_return_five(JNIEnv *env, jclass cls)
{
jclass commonClass = env->FindClass(
"com/android/appportal/common/Myclass");
return 5;
}
I start this test with such way
adb push libs/armeabi-v7a/myTest /data/local/tmp
adb push libs/armeabi-v7a/myLibrary.so /data/local/tmp
adb shel "LD_LIBRARY_PATH=/data/local/tmp data/local/tmp/myTest"
After this I have output
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from MyTest
[ RUN ] MyTest.Test1
Segmentation fault
Test is passed succesfully, if I dont get references to java classes in the jni code. Can anyone help me with this error?
There is logcat of the crash
F/libc (10105): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 10105 (myLibrary)
I/DEBUG ( 113): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 113): Build fingerprint: 'samsung/espresso10rfxx/espresso10rf:4.0.3/IML74K/P5100XWALE2:user/release-keys'
I/DEBUG ( 113): Revision: '10'
I/DEBUG ( 113): pid: 10105, tid: 10105, name: myLibrary >>> /data/local/tmp/myTest <<<
I/DEBUG ( 113): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
W/NativeCrashListener( 399): Couldn't find ProcessRecord for pid 10105
I/DEBUG ( 113): be8268c8 004e1de8 [heap]
I/DEBUG ( 113): be8268cc be826a6c [stack]
I/DEBUG ( 113): be8268d0 00000001
I/DEBUG ( 113): be8268d4 4021fdb4 /data/local/tmp/libgnustl_shared.so (operator new[](unsigned int)+8)
I/DEBUG ( 113): be8268d8 004e2610 [heap]
I/DEBUG ( 113): be8268dc 0000bc70 /data/local/tmp/myTest
I/DEBUG ( 113): be8268e0 402a22f0 /system/lib/libc.so
I/DEBUG ( 113): be8268e4 004e1e44 [heap]
I/DEBUG ( 113): be8268e8 00039df8 /data/local/tmp/myTest
I/DEBUG ( 113): be8268ec be826918 [stack]
I/DEBUG ( 113): be8268f0 00000000
I/DEBUG ( 113): be8268f4 be82690c [stack]
I/DEBUG ( 113): be8268f8 e3a070ad
I/DEBUG ( 113): be8268fc ef9000ad
I/DEBUG ( 113): #00 be826900 000384c4 /data/local/tmp/myTest
I/DEBUG ( 113): be826904 00000000
I/DEBUG ( 113): be826908 be826924 [stack]
I/DEBUG ( 113): be82690c 0002d9b4 /data/local/tmp/myTest
I/DEBUG ( 113): #01 be826910 004e1ee0 [heap]
I/DEBUG ( 113): be826914 00000000
I/DEBUG ( 113): be826918 00000000
I/DEBUG ( 113): be82691c 00000000
I/DEBUG ( 113): be826920 be82695c [stack]
I/DEBUG ( 113): be826924 0001df80 /data/local/tmp/myTest
I/DEBUG ( 113): #02 be826928 be826944 [stack]
I/DEBUG ( 113): be82692c 0001f040 /data/local/tmp/myTest
I/DEBUG ( 113): be826930 000105cc /data/local/tmp/myTest
I/DEBUG ( 113): be826934 004e2548 [heap]
I/DEBUG ( 113): be826938 004e1ee0 [heap]
I/DEBUG ( 113): be82693c 00039df8 /data/local/tmp/myTest
I/DEBUG ( 113): be826940 be826954 [stack]
I/DEBUG ( 113): be826944 00010620 /data/local/tmp/myTest
I/DEBUG ( 113): be826948 be826954 [stack]
I/DEBUG ( 113): be82694c 004e1ee0 [heap]
I/DEBUG ( 113): be826950 be82695c [stack]
I/DEBUG ( 113): be826954 004e2568 [heap]
I/DEBUG ( 113): be826958 be826974 [stack]
I/DEBUG ( 113): be82695c 00010e30 /data/local/tmp/myTest
I/DEBUG ( 113): be826960 be82696c [stack]
I/DEBUG ( 113): be826964 004e2548 [heap]
I solved this problem with creating of wrapper for JNIEnv class.
I have an activity that displays a screenshot of a map fragment, along with some other things. Everything shows up perfectly until a second or two later when the app crashes. This is only happening on Android phones using 4.4.2 kitkat, but not on tablets. After the first attempt to load this view, it will sometimes crash before even displaying anything when setContentView is called. Since it crashes at a different time each time I test, I assume something is happening on a background thread, and since it's a Fatal signal 11 I assume it's some sort of strange memory problem, but other than that I really have no clue what's going on.
Here's the activity:
public class TransactionDetailActivity extends CommonActivity implements Animation.AnimationListener {
private TransactionDetail _transaction = null;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.transaction_detail);
getActionBar().setDisplayHomeAsUpEnabled(true);
MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
if (mapFragment.getMap() != null) { // can be null if google play services isn't installed
mapFragment.getMap().getUiSettings().setZoomControlsEnabled(false);
}
Intent intent = getIntent();
String transactionReceiptNumber = intent.getStringExtra("transactionReceiptNumber");
loadTransactionDetail(transactionReceiptNumber);
ClipDialog.showDialog(this, getString(R.string.transaction_detail_loading));
}
#Override
public void onPause() {
super.onPause();
if (_runAnimation) {
final ImageView mapScreenshot = (ImageView) findViewById(R.id.map_screenshot);
MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
if (mapFragment.getMap() != null) {
mapFragment.getMap().snapshot(new GoogleMap.SnapshotReadyCallback() {
#Override
public void onSnapshotReady(Bitmap snapshot) {
mapScreenshot.setImageBitmap(snapshot);
Bitmap screenshot = Rotate3dAnimation.takeScreenshot(TransactionDetailActivity.this);
ImageView imageView = (ImageView) findViewById(R.id.screenshot);
imageView.setImageBitmap(screenshot);
findViewById(R.id.container).setVisibility(View.GONE);
disableActionBarAnimation();
getActionBar().hide();
imageView.startAnimation(new Rotate3dAnimation(false));
}
});
}
}
}
#Override
public void onResume() {
super.onResume();
if (_runAnimation) {
View imageView = findViewById(R.id.screenshot);
if (imageView != null) {
Rotate3dAnimation anim = new Rotate3dAnimation(true);
anim.setAnimationListener(this);
imageView.startAnimation(anim);
}
_runAnimation = false;
}
}
#Override
public void onAnimationEnd(Animation animation) {
ImageView mapScreenshot = (ImageView) findViewById(R.id.map_screenshot);
mapScreenshot.setImageBitmap(null);
ImageView imageView = (ImageView) findViewById(R.id.screenshot);
imageView.setImageBitmap(null);
findViewById(R.id.container).setVisibility(View.VISIBLE);
disableActionBarAnimation();
getActionBar().show();
}
private void loadTransactionDetail(String receiptNumber) {
ClipAPIClient.getInstance().getAPI().transactionDetail(ClipDataManager.getInstance().getCurrentUser().merchant.id, receiptNumber, new Callback() {
#Override
public void success(Object object, Response response) {
_transaction = (TransactionDetail) object;
configureViewForTransaction();
ClipDialog.hideDialog();
}
#Override
public void failure(RetrofitError error) {
ClipDialog.showDialogForDuration(TransactionDetailActivity.this, getString(R.string.transaction_detail_error));
L.e(error, "Transaction detail error");
AnalyticsClient.logError("TransactionDetail", error);
}
});
}
private void configureViewForTransaction() {
findViewById(R.id.map_container).setVisibility(View.VISIBLE);
findViewById(R.id.scroll_view).setVisibility(View.VISIBLE);
LatLng coordinate = new LatLng(new Double(_transaction.latitude), new Double(_transaction.longitude));
MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
if (mapFragment.getMap() != null) { // can be null if google play services isn't installed
mapFragment.getMap().addMarker(new MarkerOptions().position(coordinate));
mapFragment.getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(coordinate, 14));
}
}
}
Here's the xml involving the map fragment:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
>
<LinearLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#f8f8f8"
>
<FrameLayout
android:id="#+id/map_container"
android:layout_width="match_parent"
android:layout_height="100dip"
android:layout_marginTop="?android:attr/actionBarSize"
android:visibility="gone"
>
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"
/>
<ImageView
android:id="#+id/map_screenshot"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>
And here's the logcat:
I/ActivityManager( 3638): Timeline: Activity_launch_request id:com.payclip.clip time:64253930
I/ActivityManager( 478): START u0 {cmp=com.payclip.clip/.activities.TransactionDetailActivity (has extras)} from pid 3638
W/AudioTrack( 478): AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching sample rate (48000 vs 44100)
I/Google Maps Android API( 3638): Google Play services client version: 3225100
I/Google Maps Android API( 3638): Google Play services package version: 4452036
I/fpp ( 3638): Making Creator dynamically
I/Google Maps Android API( 3638): Google Play services client version: 4452000
F/libc ( 3638): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 3694 (DataRequestDisp)
D/Retrofit( 3638): ---> HTTP GET https://devapitest02.payclip.com/payments/history/detail?merchant_id=3fb182ea-58cb-4d7f-a1b2-6c6088beab8c&receipt_no=NHPiZdY
D/Retrofit( 3638): Cookie: X-Blitz-Auth=MWQyN2M4NDgtYzgwYy00NmIyLWJkN2ItMTRhYWNhZjMxZTUx|1401984427|c4fe537b618705f306119435e3557734cf07eea1
D/Retrofit( 3638): ---> END HTTP (0-byte body)
I/DEBUG ( 129): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 129): Build fingerprint: 'google/mysid/toro:4.2.2/JDQ39/573038:user/release-keys'
I/DEBUG ( 129): Revision: '9'
I/DEBUG ( 129): pid: 3638, tid: 3694, name: DataRequestDisp >>> com.payclip.clip <<<
I/DEBUG ( 129): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG ( 129): r0 00000000 r1 00000000 r2 608d404d r3 00000019
I/DEBUG ( 129): r4 00000008 r5 608d404e r6 00000000 r7 ffffffff
I/DEBUG ( 129): r8 00000001 r9 40adff50 sl 00000019 fp 608d404d
I/DEBUG ( 129): ip 5c153b34 sp 63b87910 lr 5c148099 pc 40acaeae cpsr 600f0030
I/DEBUG ( 129): d0 0000000000000000 d1 0000000000000000
I/DEBUG ( 129): d2 0000000000000000 d3 0000000000000000
I/DEBUG ( 129): d4 c0000c66506245fe d5 0000000032000007
I/DEBUG ( 129): d6 000b0000010001ff d7 0023000201000304
I/DEBUG ( 129): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 129): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 129): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 129): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 129): d16 0000000000000000 d17 0000000000000000
I/DEBUG ( 129): d18 3cf0ec89e8959053 d19 36d009d3948721ab
I/DEBUG ( 129): d20 0000000000ffffff d21 0000000000000005
I/DEBUG ( 129): d22 0000000009000000 d23 bebbb7c504f41aab
I/DEBUG ( 129): d24 3e7ad7f29abcaf48 d25 3ff0000000000000
I/DEBUG ( 129): d26 0000000000000000 d27 0000000000000001
I/DEBUG ( 129): d28 bf8dd78e85b24937 d29 3e2d38fc57f240cc
I/DEBUG ( 129): d30 bfc67dae64a5e000 d31 3fc5528670f6093a
I/DEBUG ( 129): scr 60000013
I/DEBUG ( 129):
I/DEBUG ( 129): backtrace:
I/DEBUG ( 129): #00 pc 00026eae /system/lib/libssl.so (SSL_select_next_proto+49)
I/DEBUG ( 129): #01 pc 00007095 /system/lib/libjavacrypto.so
I/DEBUG ( 129): #02 pc 0002f223 /system/lib/libssl.so (ssl_parse_serverhello_tlsext+434)
I/DEBUG ( 129): #03 pc 000180dd /system/lib/libssl.so (ssl3_get_server_hello+1008)
I/DEBUG ( 129): #04 pc 000174d5 /system/lib/libssl.so (ssl3_connect+564)
I/DEBUG ( 129): #05 pc 00026471 /system/lib/libssl.so (SSL_connect+20)
I/DEBUG ( 129): #06 pc 0001201d /system/lib/libssl.so (ssl23_connect+2292)
I/DEBUG ( 129): #07 pc 00027c27 /system/lib/libssl.so (SSL_do_handshake+50)
I/DEBUG ( 129): #08 pc 0000aeaf /system/lib/libjavacrypto.so
I/DEBUG ( 129): #09 pc 0001ea50 /system/lib/libdvm.so (dvmPlatformInvoke+116)
I/DEBUG ( 129): #10 pc 0004f667 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
I/DEBUG ( 129): #11 pc 00027ee0 /system/lib/libdvm.so
I/DEBUG ( 129): #12 pc 0002f3d8 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
I/DEBUG ( 129): #13 pc 0002ca7c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
I/DEBUG ( 129): #14 pc 00061ae3 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+338)
I/DEBUG ( 129): #15 pc 00061b07 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
I/DEBUG ( 129): #16 pc 000567f3 /system/lib/libdvm.so
I/DEBUG ( 129): #17 pc 0000d248 /system/lib/libc.so (__thread_entry+72)
I/DEBUG ( 129): #18 pc 0000d3e0 /system/lib/libc.so (pthread_create+240)
I/DEBUG ( 129):
I/DEBUG ( 129): stack:
I/DEBUG ( 129): 63b878d0 40243d77 /system/lib/libandroid_runtime.so
I/DEBUG ( 129): 63b878d4 0d427cfb
I/DEBUG ( 129): 63b878d8 00000002
I/DEBUG ( 129): 63b878dc 5c147fd1 /system/lib/libjavacrypto.so
I/DEBUG ( 129): 63b878e0 00000002
I/DEBUG ( 129): 63b878e4 5c147fd1 /system/lib/libjavacrypto.so
I/DEBUG ( 129): 63b878e8 00000003
I/DEBUG ( 129): 63b878ec 40a9be64 /system/lib/libcrypto.so
I/DEBUG ( 129): 63b878f0 401fa1b8
I/DEBUG ( 129): 63b878f4 40a9be64 /system/lib/libcrypto.so
I/DEBUG ( 129): 63b878f8 5ef837b8
I/DEBUG ( 129): 63b878fc 401bcf37 /system/lib/libc.so (dlmalloc+4250)
I/DEBUG ( 129): 63b87900 00000003
I/DEBUG ( 129): 63b87904 00020384
I/DEBUG ( 129): 63b87908 401bbe9d /system/lib/libc.so (dlmalloc)
I/DEBUG ( 129): 63b8790c 00000003
I/DEBUG ( 129): #00 63b87910 40a9be64 /system/lib/libcrypto.so
I/DEBUG ( 129): 63b87914 63b87990
I/DEBUG ( 129): 63b87918 63b8798c
I/DEBUG ( 129): 63b8791c 608d404d
I/DEBUG ( 129): 63b87920 00000019
I/DEBUG ( 129): 63b87924 608d404d
I/DEBUG ( 129): 63b87928 578d1bc0
I/DEBUG ( 129): 63b8792c 63b8798c
I/DEBUG ( 129): 63b87930 63b87990
I/DEBUG ( 129): 63b87934 5ef83598
I/DEBUG ( 129): 63b87938 40adff50 /system/lib/libssl.so
I/DEBUG ( 129): 63b8793c 00000019
I/DEBUG ( 129): 63b87940 608d4049
I/DEBUG ( 129): 63b87944 5c148099 /system/lib/libjavacrypto.so
I/DEBUG ( 129): #01 63b87948 00000000
I/DEBUG ( 129): 63b8794c ffffffff
I/DEBUG ( 129): 63b87950 608d4066
I/DEBUG ( 129): 63b87954 63b879c8
I/DEBUG ( 129): 63b87958 63b879c8
I/DEBUG ( 129): 63b8795c 608d404d
I/DEBUG ( 129): 63b87960 00003374
I/DEBUG ( 129): 63b87964 40ad3225 /system/lib/libssl.so (ssl_parse_serverhello_tlsext+436)
I/DEBUG ( 129): #02 63b87968 00000019
I/DEBUG ( 129): 63b8796c 00000000
I/DEBUG ( 129): 63b87970 40adb4a5 /system/lib/libssl.so
I/DEBUG ( 129): 63b87974 00000001
I/DEBUG ( 129): 63b87978 00000001
I/DEBUG ( 129): 63b8797c 63b879cc
I/DEBUG ( 129): 63b87980 608d4062
I/DEBUG ( 129): 63b87984 608d4066
I/DEBUG ( 129): 63b87988 5ef83598
I/DEBUG ( 129): 63b8798c 5d907490
I/DEBUG ( 129): 63b87990 40a99dc0 /system/lib/libcrypto.so
I/DEBUG ( 129): 63b87994 5ef83598
I/DEBUG ( 129): 63b87998 0000005a
I/DEBUG ( 129): 63b8799c 608d400c
I/DEBUG ( 129): 63b879a0 5d9076a8
I/DEBUG ( 129): 63b879a4 608d402f
I/DEBUG ( 129): ........ ........
I/DEBUG ( 129):
I/DEBUG ( 129): memory near r2:
I/DEBUG ( 129): 608d402c c0000c66 32000007 00000000 010001ff
I/DEBUG ( 129): 608d403c 000b0000 01000304 00230002 00743300
I/DEBUG ( 129): 608d404c 70730819 332f7964 7306312e 2f796470
I/DEBUG ( 129): 608d405c 74680833 312f7074 0000312e 00000000
I/DEBUG ( 129): 608d406c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d407c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d408c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d409c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40ac 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40bc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40cc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40dc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40ec 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40fc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d410c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d411c 00000000 00000000 00000000 00000000
I/DEBUG ( 129):
I/DEBUG ( 129): memory near r5:
I/DEBUG ( 129): 608d402c c0000c66 32000007 00000000 010001ff
I/DEBUG ( 129): 608d403c 000b0000 01000304 00230002 00743300
I/DEBUG ( 129): 608d404c 70730819 332f7964 7306312e 2f796470
I/DEBUG ( 129): 608d405c 74680833 312f7074 0000312e 00000000
I/DEBUG ( 129): 608d406c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d407c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d408c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d409c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40ac 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40bc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40cc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40dc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40ec 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40fc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d410c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d411c 00000000 00000000 00000000 00000000
I/DEBUG ( 129):
I/DEBUG ( 129): memory near r9:
I/DEBUG ( 129): 40adff30 00000040 00000020 00000002 00000002
I/DEBUG ( 129): 40adff40 00000105 0000c030 00000000 00000000
I/DEBUG ( 129): 40adff50 00000001 40ad6440 0300c007 00000080
I/DEBUG ( 129): 40adff60 00000040 00000004 00000002 00000002
I/DEBUG ( 129): 40adff70 00000041 0000c030 00000080 00000080
I/DEBUG ( 129): 40adff80 00000001 40ad6454 0300c008 00000080
I/DEBUG ( 129): 40adff90 00000040 00000002 00000002 00000002
I/DEBUG ( 129): 40adffa0 00000181 0000c030 000000a8 000000a8
I/DEBUG ( 129): 40adffb0 00000001 40ad646d 0300c009 00000080
I/DEBUG ( 129): 40adffc0 00000040 00000040 00000002 00000002
I/DEBUG ( 129): 40adffd0 00000181 0000c030 00000080 00000080
I/DEBUG ( 129): 40adffe0 00000001 40ad6484 0300c00a 00000080
I/DEBUG ( 129): 40adfff0 00000040 00000080 00000002 00000002
I/DEBUG ( 129): 40ae0000 00000181 0000c030 00000100 00000100
I/DEBUG ( 129): 40ae0010 00000001 40ad649b 0300c00b 00000020
I/DEBUG ( 129): 40ae0020 00000010 00000020 00000002 00000002
I/DEBUG ( 129):
I/DEBUG ( 129): memory near fp:
I/DEBUG ( 129): 608d402c c0000c66 32000007 00000000 010001ff
I/DEBUG ( 129): 608d403c 000b0000 01000304 00230002 00743300
I/DEBUG ( 129): 608d404c 70730819 332f7964 7306312e 2f796470
I/DEBUG ( 129): 608d405c 74680833 312f7074 0000312e 00000000
I/DEBUG ( 129): 608d406c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d407c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d408c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d409c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40ac 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40bc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40cc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40dc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40ec 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d40fc 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d410c 00000000 00000000 00000000 00000000
I/DEBUG ( 129): 608d411c 00000000 00000000 00000000 00000000
I/DEBUG ( 129):
I/DEBUG ( 129): memory near ip:
I/DEBUG ( 129): 5c153b14 40a319e5 409f5a8d 40a2812d 40a27dd1
I/DEBUG ( 129): 5c153b24 40a28b25 40a20e65 40a2c10d 401bf0cd
I/DEBUG ( 129): 5c153b34 40acae7d 401ba8a8 401ba9ac 40a3f3d5
I/DEBUG ( 129): 5c153b44 40aca6fd 40158927 40186559 401295b5
I/DEBUG ( 129): 5c153b54 40a34491 40a2cded 40a2cc61 40a2cc01
I/DEBUG ( 129): 5c153b64 40a2d169 40a2f1f9 401d178d 40a2f1d9
I/DEBUG ( 129): 5c153b74 40a2f2bd 401b9cd1 401bf4a5 401bdfc5
I/DEBUG ( 129): 5c153b84 401296f5 40acaef9 40acddb1 40a66cd5
I/DEBUG ( 129): 5c153b94 409ff4b9 409ff5a1 40a66d1d 40a0271d
I/DEBUG ( 129): 5c153ba4 409f8991 409fb1a1 40a66475 40a5a135
I/DEBUG ( 129): 5c153bb4 40a01189 40a049b1 40a34dc1 40a04a55
I/DEBUG ( 129): 5c153bc4 409f48b5 40a35405 40a25345 40a25695
I/DEBUG ( 129): 5c153bd4 40a24ec5 40a250c9 40a254e1 40a24e4d
I/DEBUG ( 129): 5c153be4 40a252dd 40a3f279 40a252e9 40a252e1
I/DEBUG ( 129): 5c153bf4 40a251cd 40a36b09 40a36a0d 40a36e41
I/DEBUG ( 129): 5c153c04 409f5a95 40a2578d 409f3951 409fea55
I/DEBUG ( 129):
I/DEBUG ( 129): memory near sp:
I/DEBUG ( 129): 63b878f0 401fa1b8 40a9be64 5ef837b8 401bcf37
I/DEBUG ( 129): 63b87900 00000003 00020384 401bbe9d 00000003
I/DEBUG ( 129): 63b87910 40a9be64 63b87990 63b8798c 608d404d
I/DEBUG ( 129): 63b87920 00000019 608d404d 578d1bc0 63b8798c
I/DEBUG ( 129): 63b87930 63b87990 5ef83598 40adff50 00000019
I/DEBUG ( 129): 63b87940 608d4049 5c148099 00000000 ffffffff
I/DEBUG ( 129): 63b87950 608d4066 63b879c8 63b879c8 608d404d
I/DEBUG ( 129): 63b87960 00003374 40ad3225 00000019 00000000
I/DEBUG ( 129): 63b87970 40adb4a5 00000001 00000001 63b879cc
I/DEBUG ( 129): 63b87980 608d4062 608d4066 5ef83598 5d907490
I/DEBUG ( 129): 63b87990 40a99dc0 5ef83598 0000005a 608d400c
I/DEBUG ( 129): 63b879a0 5d9076a8 608d402f 40adff50 00000000
I/DEBUG ( 129): 63b879b0 00001110 40abc0e1 63b879c8 63b879c4
I/DEBUG ( 129): 63b879c0 5ef83598 00000001 5c1481f9 608d4032
I/DEBUG ( 129): 63b879d0 5ef83598 00001120 5c1481f9 5c1481f9
I/DEBUG ( 129): 63b879e0 00000000 00001120 00001000 40abb4d9
I/DEBUG ( 129):
I/DEBUG ( 129): code around pc:
I/DEBUG ( 129): 40acae8c d02c2b00 9f0f9701 21009102 4001f81b
I/DEBUG ( 129): 40acae9c 0801f101 eb0bb1cf eb0b0001 90030508
I/DEBUG ( 129): 40acaeac f8162000 f1009000 454c0a01 eb06d109
I/DEBUG ( 129): 40acaebc 4628010a f7e54622 4601efcc 29002001
I/DEBUG ( 129): 40acaecc eb0ad00a 42b80009 9a04d3eb 0104eb08
I/DEBUG ( 129): 40acaedc 42912002 e000d3da 99029e03 1c729f01
I/DEBUG ( 129): 40acaeec 7832603a b005700a 8ff0e8bd 3178f8d0
I/DEBUG ( 129): 40acaefc 600b2b00 0100f04f f890bf18 6011117c
I/DEBUG ( 129): 40acaf0c bf004770 11a4f8c0 21a8f8c0 bf004770
I/DEBUG ( 129): 40acaf1c 11acf8c0 21b0f8c0 bf004770 4605b570
I/DEBUG ( 129): 40acaf2c f8d54614 460e01bc f7e5b108 490cee42
I/DEBUG ( 129): 40acaf3c 6296f240 44794809 46204401 ee2cf7e5
I/DEBUG ( 129): 40acaf4c f8c52101 b13001bc 46224631 ee6cf7e5
I/DEBUG ( 129): 40acaf5c f8c52100 460841c0 bf00bd70 ffffb4ae
I/DEBUG ( 129): 40acaf6c 00013b02 4605b570 f8d54614 460e019c
I/DEBUG ( 129): 40acaf7c f7e5b108 490cee1e 62aaf240 44794809
I/DEBUG ( 129):
I/DEBUG ( 129): code around lr:
I/DEBUG ( 129): 5c148078 46402300 f7fe2121 6a6aef9a b13c6aab
I/DEBUG ( 129): 5c148088 000ce88d 46314638 9b084622 ef76f7fe
I/DEBUG ( 129): 5c148098 e8bd2000 b53881fc b1884604 b1556a05
I/DEBUG ( 129): 5c1480a8 ffccf7ff 68296803 47906d9a f7fe4628
I/DEBUG ( 129): 5c1480b8 2000ef84 21006220 60e12001 bd386161
I/DEBUG ( 129): 5c1480c8 b508bd38 6d5a6803 bd084790 6803b508
I/DEBUG ( 129): 5c1480d8 47906dda b508bd08 6fda6803 bd084790
I/DEBUG ( 129): 5c1480e8 6804b510 4084f8d4 bd1047a0 b513b40c
I/DEBUG ( 129): 5c1480f8 6804ab04 2b04f853 40c8f8d4 47a09301
I/DEBUG ( 129): 5c148108 401ce8bd 4770b002 b513b40c 6804ab04
I/DEBUG ( 129): 5c148118 2b04f853 40f8f8d4 47a09301 401ce8bd
I/DEBUG ( 129): 5c148128 4770b002 b513b40c 6804ab04 2b04f853
I/DEBUG ( 129): 5c148138 41ccf8d4 47a09301 401ce8bd 4770b002
I/DEBUG ( 129): 5c148148 6803b508 229cf8d3 bd084790 6803b508
I/DEBUG ( 129): 5c148158 22acf8d3 bd084790 6804b510 42b0f8d4
I/DEBUG ( 129): 5c148168 bd1047a0 6803b508 32b4f8d3 bd084798
I/BootReceiver( 478): Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
W/ActivityManager( 478): Force finishing activity com.payclip.clip/.activities.TransactionDetailActivity
W/ActivityManager( 478): Force finishing activity com.payclip.clip/.activities.TransactionHistoryActivity
I/WindowState( 478): WIN DEATH: Window{41e898d0 u0 com.payclip.clip/com.payclip.clip.activities.AmountActivity}
I/WindowState( 478): WIN DEATH: Window{421551e8 u0 Panel:com.payclip.clip/com.payclip.clip.activities.TransactionHistoryActivity}
I/WindowState( 478): WIN DEATH: Window{421d9b40 u0 com.payclip.clip/com.payclip.clip.activities.TransactionDetailActivity}
I/WindowState( 478): WIN DEATH: Window{423ecf60 u0 com.payclip.clip/com.payclip.clip.activities.TransactionDetailActivity}
I/WindowState( 478): WIN DEATH: Window{4214a618 u0 com.payclip.clip/com.payclip.clip.activities.TransactionHistoryActivity}
I/ActivityManager( 478): Process com.payclip.clip (pid 3638) has died.
V/Zygote ( 3701): Switching descriptor 32 to /dev/null
V/Zygote ( 3701): Switching descriptor 9 to /dev/null
D/dalvikvm( 3701): Late-enabling CheckJNI
D/Zygote ( 132): Process 3638 terminated by signal (11)
On a 4.4.2 tablet, which doesn't crash, this is what shows after the view is all loaded:
D/dalvikvm(27019): GC_FOR_ALLOC freed 1137K, 14% free 12105K/14048K, paused 25ms, total 25ms
So it turns out that the crash was caused by an SSL error. I was using an older version of Retrofit that was causing bugs with not only google maps, but also with a Webview. The solution was to upgrade to the latest version of retrofit. Thanks for the suggestions.
I have an Android App, in which I have below class containing fields of both native (C++) objects wrapped with JNI, and other java objects:
class MyClass
{
Node nativeNode; // containing Native objects wrapped using NDK and JNI
long otherVars; // some java instances
public void dispose()
{
freeNativeNode();
}
}
In my app, I continuously create instances of MyClass:
for(int i=0;i<1000;i++)
{
MyClass obj = new MyClass();
...
obj.freeNativeNode(); // Here, free native resources (A)
//System.gc(); // Here explicitly collect memory (B)
}
The app crashes when i is bigger than some number, e.g. when i>400 or i>450.
Since I have freed the native memory explicitly as in line (A) above, so I think there should be no memory leak, and java shall use garbage collection to revoke the memory. But the app crashes, and I suspect it might be a memory leak problem.
As I know, it is possible to free the managed memory in Java by calling:
System.GC();
I tried to call this in (B) above, however, the app crashes more often, and say when i > 60, it already crashes.
My questions are:
[1] Should I call System.GC() explicitly? As many have different opinions on calling this ourselves, and some say this is not a good practice.
[2] How do I elegantly free the memory in the loop to avoid crash?
Edit: I understand it is less appropriate to print full log here, but it might be useful to get the whole picture for troubleshooting the problem.
From the log, it seems to be not a memory leak problem, but one of my colleague believes so, and I have no strong evidence showing this is NOT, :)
The tombstone log: debuggerd: 2014-05-01 23:56:47
Build fingerprint: 'htc_asia_hk/endeavoru/endeavoru:4.1.1/JRO03C/128187.28:user/release-keys'
pid: 31725, tid: 31725, name: com.cityu.scm >>> com.cityu.scm <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000003
r0 000ff7ff r1 ffffffff r2 00000000 r3 ffffffff
r4 00000110 r5 553b36f8 r6 00000008 r7 00000000
r8 00000000 r9 48ce1c44 sl 40c5b020 fp bec7761c
ip 00000110 sp bec76db0 lr 400491b7 pc 400497b6 cpsr a0000030
d0 0000000000000008 d1 3ddb7cdfd9d7bdbb
d2 3fece61cf8e1788d d3 4435800000000000
d4 000002d0000002d6 d5 0000000042000000
d6 44340000435f0000 d7 0000000040000000
d8 00000000440a8000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 0000000000000000 d17 0000000000000001
d18 0000000000000000 d19 3ff0000000000000
d20 0000000000000000 d21 0000000000000000
d22 0000000000000000 d23 0000000000000000
d24 3ff0000000000000 d25 3ff0000000000000
d26 0000000000000000 d27 c053000000000000
d28 0000000000000006 d29 3ff0000000000000
d30 3ff0000000000000 d31 3ff0000000000000
scr 20000011
backtrace:
#00 pc 000147b6 /system/lib/libc.so (dlmalloc+1589)
#01 pc 00017123 /system/lib/libc.so (malloc+10)
#02 pc 003774fc /data/data/com.cityu.scm/lib/libjniosg.so (operator new(unsigned int)+24)
stack:
bec76d70 5516df70
bec76d74 bec77608 [stack]
bec76d78 48ce1c44
bec76d7c 40c5b020
bec76d80 c0000000
bec76d84 0000001b
bec76d88 0000000e
bec76d8c 003ef75c
bec76d90 0000000e
bec76d94 bec77310 [stack]
bec76d98 c0000000
bec76d9c 00000108
bec76da0 00000000
bec76da4 003ef75c
bec76da8 df0027ad
bec76dac 00000000
#00 bec76db0 524af370
bec76db4 53dc0677 /data/data/com.cityu.scm/lib/libjniosg.so
bec76db8 00000000
bec76dbc 53dc0b15 /data/data/com.cityu.scm/lib/libjniosg.so
(std::_Rb_tree >, std::_Select1st > >, std::less, std::allocator > > >::find(std::string const&)+58)
bec76dc0 00000000
bec76dc4 00000108
bec76dc8 524af160
bec76dcc 003ef75c
bec76dd0 00000164
bec76dd4 bec77608 [stack]
bec76dd8 48ce1c44
bec76ddc 40c5b020
bec76de0 bec7761c [stack]
bec76de4 4004c125 /system/lib/libc.so (malloc+12)
#01 bec76de8 53cbd8ad /data/data/com.cityu.scm/lib/libjniosg.so
bec76dec 53c09500 /data/data/com.cityu.scm/lib/libjniosg.so (operator new(unsigned int)+28)
#02 bec76df0 00000000
bec76df4 524af160
bec76df8 bec7724c [stack]
bec76dfc 53cbd8b7 /data/data/com.cityu.scm/lib/libjniosg.so
bec76e00 00000000
bec76e04 53dc5af9 /data/data/com.cityu.scm/lib/libjniosg.so
(osgDB::InputStream::readObjectFields(std::string const&, unsigned int, osg::Object*)+80)
bec76e08 bec76e34 [stack]
bec76e0c 00000009
bec76e10 bec7724c [stack]
bec76e14 53c1a70b /data/data/com.cityu.scm/lib/libjniosg.so
(BinaryInputIterator::readUInt(unsigned int&)+14)
bec76e18 bec7724c [stack]
bec76e1c bec77288 [stack]
bec76e20 bec7724c [stack]
bec76e24 bec7724c [stack]
bec76e28 00000000
bec76e2c 53dc5c53 /data/data/com.cityu.scm/lib/libjniosg.so
(osgDB::InputStream::readObject(osg::Object*)+114)
memory near r0:
000ff7dc ffffffff ffffffff ffffffff ffffffff ................
000ff7ec ffffffff ffffffff ffffffff ffffffff ................
000ff7fc ffffffff ffffffff ffffffff ffffffff ................
000ff80c ffffffff ffffffff ffffffff ffffffff ................
000ff81c ffffffff ffffffff ffffffff ffffffff ................
memory near r5:
553b36d8 00000000 00000000 53ffa940 553b3701 ........#..S.7;U
553b36e8 00000000 00000000 00000000 00000000 ................
553b36f8 00000000 00000111 553b15f0 553b0b68 ..........;Uh.;U
553b3708 ffffffff 00000000 524133b8 00000000 .........3AR....
553b3718 00000020 000000f1 552da1d0 552fd620 .........-U ./U
memory near r9:
48ce1c24 4cdbee30 4bc88be8 00000006 48ce1c5c 0..L...K....\..H
48ce1c34 5270279c 4bff8370 00000006 00000000 .'pRp..K........
48ce1c44 4390001d 48ce1c84 526f0310 4bff83a8 ...C...H..oR...K
48ce1c54 5270279c 00000000 48ce1c84 526f0308 .'pR.......H..oR
48ce1c64 4bc81c28 00000006 410ace98 48ce1cbc (..K.......A...H
memory near sl:
40c5b000 00000000 00000000 00000000 00000453 ............S...
40c5b010 4cd06328 48ce1c44 4bff83a8 52486000 (c.LD..H...K.`HR
40c5b020 8b300dd1 00001d30 bec77730 00000000 ..0.0...0w......
40c5b030 bec77764 00000001 00000000 40791380 dw............y#
40c5b040 00000000 00000000 402e0570 48cdc300 ........p..#...H
memory near fp:
bec775fc 54f4c024 4bff8370 407911f4 48ce1c44 $..Tp..K..y#D..H
bec7760c 00000001 4119d1f8 52722f8f 0000003b .......A./rR;...
bec7761c 407c3c87 48ce1c44 52722f8d 53bc6a01 .<|#D..H./rR.j.S
bec7762c 40c5b020 a3a00019 00000000 4082c238 ..#........8..#
bec7763c 40085a98 00000022 40103033 40cdbb10 .Z.#"...30.#...#
memory near sp:
bec76d90 0000000e bec77310 c0000000 00000108 .....s..........
bec76da0 00000000 003ef75c df0027ad 00000000 ....\.>..'......
bec76db0 524af370 53dc0677 00000000 53dc0b15 p.JRw..S.......S
bec76dc0 00000000 00000108 524af160 003ef75c ........`.JR\.>.
bec76dd0 00000164 bec77608 48ce1c44 40c5b020 d....v..D..H ..#
code around pc:
40049794 0240f3c0 66a8f8df f102fa30 0c02eb03 ..#....f0.......
400497a4 0501eb0c eb06447e 25000085 312cf8d0 ....~D.....%..,1
400497b4 685ae00d f0226919 ebc40c03 4542020c ..Zh.i".......BE
400497c4 4642bf2c b901461d 460b6959 2b004690 ,.BF.F..Yi.F.F.+
400497d4 2d00d1ef 818ff000 2668f8df 6890447a ...-......h&zD.h
code around lr:
40049194 b930fd11 2becf8df f8d2447a 078b11b4 ..0....+zD......
400491a4 f8dfd50a 447d5be4 70dcf505 f7fe2500 .....[}D...p.%..
400491b4 2800e886 8249f041 f2002cf4 2c0a823f ...(A.I..,..?..,
400491c4 340bd903 0407f024 2410e000 7bbcf8df ...4$......$...{
400491d4 447f08e2 fa36683e 079df302 f003d042 ...D>h6.....B...
pid: 31725, tid: 31727, name: GC
r0 fffffffc r1 00000080 r2 fffffffc r3 4fe62e30
r4 40cdbbb0 r5 40cdbbac r6 fffffffc r7 000000f0
r8 00001388 r9 00000000 sl 4082df98 fp 00000001
ip 00000000 sp 4fe62e10 lr 40047f80 pc 40042ca4 cpsr 60000010
d0 42c80000428cea01 d1 3ff00000003db190
d2 0000000100000001 d3 b684088000080000
d4 0000000040dc8000 d5 000000000006e400
d6 00578fe000000963 d7 000000464dc0cae2
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 4139200000000000 d17 4132d9f000000000
d18 0033003200310030 d19 0000000000000000
d20 4008000000000000 d21 3fbc71c71c71c71c
d22 3fcc7288e957b53b d23 3fd24998d6307188
d24 3fd99a27ad32ddf5 d25 3fe555b0aaeac752
d26 0000000000000000 d27 0000000000000000
d28 0000000000000005 d29 0000000000000000
d30 0000000000000000 d31 0000000000000000
scr 80000010
backtrace:
#00 pc 0000dca4 /system/lib/libc.so (__futex_syscall3+12)
#01 pc 00012f7c /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 00012fd8 /system/lib/libc.so (__pthread_cond_timedwait+60)
#03 pc 00057029 /system/lib/libdvm.so (dvmRelativeCondWait(pthread_cond_t*, pthread_mutex_t*, long long, int)+112)
#04 pc 00078655 /system/lib/libdvm.so
#05 pc 000591e7 /system/lib/libdvm.so
#06 pc 00012e48 /system/lib/libc.so (__thread_entry+72)
#07 pc 0001257c /system/lib/libc.so (pthread_create+208)
stack:
4fe62dd0 01e9b4a6
4fe62dd4 7fffffff
4fe62dd8 01e9b50c
4fe62ddc 0004e200
4fe62de0 0000fa00
4fe62de4 40046314 /system/lib/libc.so (__divdi3+244)
4fe62de8 01e9b517
4fe62dec 4082c238 /system/lib/libdvm.so
4fe62df0 40cdbab0 [heap]
4fe62df4 00000000
4fe62df8 4fe62e00
4fe62dfc 000003e8
4fe62e00 00000000
4fe62e04 00001388
4fe62e08 00000000
4fe62e0c 00001388
#00 4fe62e10 40cdbbb0 [heap]
4fe62e14 4fe62e30
#01 4fe62e18 00000001
4fe62e1c 40cdbbac [heap]
4fe62e20 40cdbbb0 [heap]
4fe62e24 40cdbbb0 [heap]
4fe62e28 40cdbbac [heap]
4fe62e2c 40047fdc /system/lib/libc.so (__pthread_cond_timedwait+64)
#02 4fe62e30 00000004
4fe62e34 3b9ac618
4fe62e38 4fe62e40
4fe62e3c 1c09ac61
4fe62e40 00007d62
4fe62e44 407ca02d /system/lib/libdvm.so (dvmRelativeCondWait(pthread_cond_t*, pthread_mutex_t*, long long, int)+116)
#03 4fe62e48 00007d62
4fe62e4c 1c09ac61
4fe62e50 00001388
4fe62e54 407eb765 /system/lib/libdvm.so
4fe62e58 4082df98
4fe62e5c 00000000
4fe62e60 00000001
4fe62e64 407cc19d /system/lib/libdvm.so
4fe62e68 00100000
4fe62e6c 407eb659 /system/lib/libdvm.so
#04 4fe62e70 00000000
4fe62e74 00000001
4fe62e78 00000001
4fe62e7c 00000000
4fe62e80 00000008
4fe62e84 40c725e0
4fe62e88 4082c238 /system/lib/libdvm.so
4fe62e8c bec77768 [stack]
4fe62e90 00000078
4fe62e94 407cc19d /system/lib/libdvm.so
4fe62e98 00100000
4fe62e9c 40c725e0
4fe62ea0 00000001
4fe62ea4 407cc1e9 /system/lib/libdvm.so
#05 4fe62ea8 40c725e0
4fe62eac 00010002
4fe62eb0 40ccbc80
4fe62eb4 40cea080 /dev/ashmem/dalvik-heap (deleted)
4fe62eb8 4fe62f00
4fe62ebc 40c725e0
4fe62ec0 407cc190 /system/lib/libdvm.so (dvmDetachCurrentThread()+763)
4fe62ec4 40047e4c /system/lib/libc.so (__thread_entry+76)
#06 4fe62ec8 00000000
4fe62ecc 00000000
4fe62ed0 00000000
4fe62ed4 00000000
4fe62ed8 00000000
4fe62edc 4fe62f00
4fe62ee0 40cce0a0
4fe62ee4 bec77770 [stack]
4fe62ee8 00000078
4fe62eec 407cc19d /system/lib/libdvm.so
4fe62ef0 00100000
4fe62ef4 40c725e0
4fe62ef8 00000001
4fe62efc 40047580 /system/lib/libc.so (pthread_create+212)
#07 4fe62f00 4fe62f00
4fe62f04 40cce0a0
4fe62f08 00000000
4fe62f0c 00000000
4fe62f10 00000000
4fe62f14 00000000
4fe62f18 4e68a460
4fe62f1c 00000000
4fe62f20 00000000
4fe62f24 00000000
4fe62f28 00000000
4fe62f2c 00000000
4fe62f30 00000000
4fe62f34 00000000
4fe62f38 00000000
4fe62f3c 00000000
pid: 31725, tid: 31729, name: Signal Catcher
r0 fffffffc r1 00000000 r2 00000000 r3 00000008
r4 4ff62e58 r5 40828261 r6 bec77778 r7 000000b1
r8 407cc19d r9 52415800 sl 5010be38 fp 00042e74
ip 40827e6c sp 4ff62e18 lr 4004f453 pc 40042554 cpsr 20000010
d0 42c800004266db5b d1 3ff00000002aff38
d2 0000000100000001 d3 b684088000080000
d4 0000000040dc8000 d5 000000000006e400
d6 004a7ff000000963 d7 000000394d865d8f
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 40d3000000000000 d17 40c3cc0000000000
d18 0033003200310030 d19 0000000000000000
d20 4008000000000000 d21 3fbc71c71c71c71c
d22 3fcc7288e957b53b d23 3fd24998d6307188
d24 3fd99a27ad32ddf5 d25 3fe555b0aaeac752
d26 0000000000000000 d27 0000000000000000
d28 0000000000000005 d29 0000000000000000
d30 0000000000000000 d31 0000000000000000
scr 80000010
backtrace:
#00 pc 0000d554 /system/lib/libc.so (__rt_sigtimedwait+12)
#01 pc 0001a44f /system/lib/libc.so (sigwait+20)
#02 pc 00055fcf /system/lib/libdvm.so
#03 pc 000591e7 /system/lib/libdvm.so
#04 pc 00012e48 /system/lib/libc.so (__thread_entry+72)
#05 pc 0001257c /system/lib/libc.so (pthread_create+208)
stack:
4ff62dd8 00000000
4ff62ddc 00000000
4ff62de0 00000000
4ff62de4 00000000
4ff62de8 00000000
4ff62dec 00000000
4ff62df0 40827c88 /system/lib/libdvm.so
4ff62df4 52415800
4ff62df8 4bc64570 /dev/ashmem/dalvik-LinearAlloc (deleted)
4ff62dfc 4ff62e78
4ff62e00 4ff62e78
4ff62e04 40cbffc4
4ff62e08 4ce76760 /system/framework/core.odex
4ff62e0c 4ff62e78
4ff62e10 00000000
4ff62e14 407d9c21 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+276)
#00 4ff62e18 4ff62e58
4ff62e1c 40811cfc /system/lib/libdvm.so
#01 4ff62e20 00000204
4ff62e24 00000000
4ff62e28 5010be38
4ff62e2c 407c8fd3 /system/lib/libdvm.so
#02 4ff62e30 00000001
4ff62e34 40cea080 /dev/ashmem/dalvik-heap (deleted)
4ff62e38 4bc64570 /dev/ashmem/dalvik-LinearAlloc (deleted)
4ff62e3c 40003310
4ff62e40 52415b6c
4ff62e44 407c88ef /system/lib/libdvm.so (dvmRemoveFromReferenceTable(ReferenceTable*, Object**, Object*)+30)
4ff62e48 52415800
4ff62e4c 00042e8a
4ff62e50 410a0ec8 /dev/ashmem/dalvik-heap (deleted)
4ff62e54 00000204
4ff62e58 ffffffe0
4ff62e5c 52415800
4ff62e60 410a0ec8 /dev/ashmem/dalvik-heap (deleted)
4ff62e64 407cb485 /system/lib/libdvm.so (dvmAttachCurrentThread(JavaVMAttachArgs const*, bool)+452)
4ff62e68 40cea080 /dev/ashmem/dalvik-heap (deleted)
4ff62e6c 410a0ec8 /dev/ashmem/dalvik-heap (deleted)
........ ........
#03 4ff62ea8 5010be38
4ff62eac 00010002
4ff62eb0 40c6d380
4ff62eb4 40cea080 /dev/ashmem/dalvik-heap (deleted)
4ff62eb8 4ff62f00
4ff62ebc 5010be38
4ff62ec0 407cc190 /system/lib/libdvm.so (dvmDetachCurrentThread()+763)
4ff62ec4 40047e4c /system/lib/libc.so (__thread_entry+76)
#04 4ff62ec8 00000000
4ff62ecc 00000000
4ff62ed0 00000000
4ff62ed4 00000000
4ff62ed8 00000000
4ff62edc 4ff62f00
4ff62ee0 40cce8f8
4ff62ee4 bec77780 [stack]
4ff62ee8 00000078
4ff62eec 407cc19d /system/lib/libdvm.so
4ff62ef0 00100000
4ff62ef4 5010be38
4ff62ef8 00000001
4ff62efc 40047580 /system/lib/libc.so (pthread_create+212)
#05 4ff62f00 4ff62f00
4ff62f04 40cce8f8
4ff62f08 00000000
4ff62f0c 00000000
4ff62f10 00000000
4ff62f14 00000000
4ff62f18 52415800
4ff62f1c 00000000
4ff62f20 00000000
4ff62f24 00000000
4ff62f28 00000000
4ff62f2c 00000000
4ff62f30 00000000
4ff62f34 00000000
4ff62f38 00000000
4ff62f3c 00000000
pid: 31725, tid: 31730, name: JDWP
r0 00000031 r1 50062de0 r2 00000000 r3 00000000
r4 00000000 r5 00000000 r6 00000000 r7 0000008e
r8 501011b0 r9 00000030 sl 0003b777 fp 00000001
ip 50062dc0 sp 50062db0 lr 407dad43 pc 40041cb4 cpsr 40000010
d0 42c800004266db5b d1 3ff00000002aff38
d2 0000000100000001 d3 b684088000080000
d4 0000000040dc8000 d5 000000000006e400
d6 004a7ff000000963 d7 000000394d865d8f
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 40d3000000000000 d17 40c3cc0000000000
d18 0033003200310030 d19 0000000000000000
d20 4008000000000000 d21 3fbc71c71c71c71c
d22 3fcc7288e957b53b d23 3fd24998d6307188
d24 3fd99a27ad32ddf5 d25 3fe555b0aaeac752
d26 0000000000000000 d27 0000000000000000
d28 0000000000000005 d29 0000000000000000
d30 0000000000000000 d31 0000000000000000
scr 80000010
backtrace:
#00 pc 0000ccb4 /system/lib/libc.so (select+16)
#01 pc 00067d3f /system/lib/libdvm.so
#02 pc 0006acd1 /system/lib/libdvm.so
#03 pc 000591e7 /system/lib/libdvm.so
#04 pc 00012e48 /system/lib/libc.so (__thread_entry+72)
#05 pc 0001257c /system/lib/libc.so (pthread_create+208)
[1] Should I call System.GC() explicitly? As many have different
opinions on calling this ourselves, and some say this is not a good
practice.
Probably not. As previously mentioned by user3580294, System.GC() is really only a suggestion to the VM and what it does when you call that method directly is totally up to the implementation. I would never use this function to prevent a program from crashing.
[2] How do I elegantly free the memory in the loop to avoid crash?
What exactly is using up all the memory? Clearly when MyClass is
constructed some native resouces are being created... Are these JNI
objects? Are they C alloced memory?
I am going to go out on a limb here based on the backtrace and say that the objects eating up all your memory are JNI objects that were created in C/C++ (probably on a separate thread) and passed back to the JVM. Try calling DeleteLocalRef() on the JNI object(s) that are passed back to the VM.
Again, my above suggestion is based on a lot of assumption. You really need to attach a memory profiler like jvisualvm to the JVM to see exactly what is using up all the memory and then determine why the GC didn't catch it. (Hint: there is probably still a reference to it)
i'm developing android app that uses Clang via C API (libclang) for ARM.
I've wrote wrapper to invoke clang_..() functions and map data between Java<->native code. So the app is working for few times and then crashing. It's interacting with native code from java background thread (if that helps).
My idea about what's wrong is:
i'm trying to delete already deleted pointer
there is a memory leak in my code/clang and heap is fully allocated
concurrency issue
Any thoughts are highly appreciated:
12-10 23:03:55.382: ASSERT/libc(2763): Fatal signal 11 (SIGSEGV) at 0x00000acb (code=0), thread 3690 (Thread-545)
// ...
12-10 23:03:55.883: INFO/DEBUG(167): backtrace:
12-10 23:03:55.883: INFO/DEBUG(167): #00 pc 0017b198 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::cxdiag::lazyCreateDiags(CXTranslationUnitImpl*, bool)+200)
12-10 23:03:55.883: INFO/DEBUG(167): #01 pc 00009028 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (Java_name_antonsmirnov_clang_clang_1wrapper_getDiagnostics+72)
12-10 23:03:55.883: INFO/DEBUG(167): #02 pc 0001fb70 /system/lib/libdvm.so (dvmPlatformInvoke+112)
12-10 23:03:55.883: INFO/DEBUG(167): #03 pc 0004e8b9 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+360)
12-10 23:03:55.883: INFO/DEBUG(167): #04 pc 00029020 /system/lib/libdvm.so
12-10 23:03:55.883: INFO/DEBUG(167): #05 pc 0002d7e8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
12-10 23:03:55.883: INFO/DEBUG(167): #06 pc 0005fed5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
12-10 23:03:55.883: INFO/DEBUG(167): #07 pc 0005feff /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
12-10 23:03:55.883: INFO/DEBUG(167): #08 pc 00055327 /system/lib/libdvm.so
12-10 23:03:55.883: INFO/DEBUG(167): #09 pc 00012e70 /system/lib/libc.so (__thread_entry+48)
12-10 23:03:55.883: INFO/DEBUG(167): #10 pc 000125c8 /system/lib/libc.so (pthread_create+172)
12-10 23:03:55.883: INFO/DEBUG(167): stack:
12-10 23:03:55.883: INFO/DEBUG(167): 76475be0 00000004
12-10 23:03:55.883: INFO/DEBUG(167): 76475be4 1d300005
12-10 23:03:55.883: INFO/DEBUG(167): 76475be8 76475c04 [stack:3690]
12-10 23:03:55.883: INFO/DEBUG(167): 76475bec 735086e0
12-10 23:03:55.883: INFO/DEBUG(167): 76475bf0 731a51c8
12-10 23:03:55.883: INFO/DEBUG(167): 76475bf4 00000000
12-10 23:03:55.883: INFO/DEBUG(167): 76475bf8 731a3f48
12-10 23:03:55.883: INFO/DEBUG(167): 76475bfc 76475c80 [stack:3690]
12-10 23:03:55.883: INFO/DEBUG(167): 76475c00 7373df30
12-10 23:03:55.883: INFO/DEBUG(167): 76475c04 7160ca88
12-10 23:03:55.883: INFO/DEBUG(167): 76475c08 76475c7c [stack:3690]
12-10 23:03:55.883: INFO/DEBUG(167): 76475c0c 40137ff1 /system/lib/libc.so (malloc+12)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c10 75fcda38 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so
12-10 23:03:55.883: INFO/DEBUG(167): 76475c14 402028ff /system/lib/libstdc++.so (operator new[](unsigned int)+6)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c18 df0027ad
12-10 23:03:55.883: INFO/DEBUG(167): 76475c1c 00000000
12-10 23:03:55.883: INFO/DEBUG(167): #00 76475c20 1d300005
12-10 23:03:55.883: INFO/DEBUG(167): 76475c24 7308de78
12-10 23:03:55.883: INFO/DEBUG(167): 76475c28 76475c54 [stack:3690]
12-10 23:03:55.883: INFO/DEBUG(167): 76475c2c 715ebdb0 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (unmapTranslationUnit+56)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c30 7308de78
12-10 23:03:55.883: INFO/DEBUG(167): 76475c34 715f1620 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so
12-10 23:03:55.883: INFO/DEBUG(167): 76475c38 1d200005
12-10 23:03:55.883: INFO/DEBUG(167): 76475c3c 0008de78
12-10 23:03:55.883: INFO/DEBUG(167): 76475c40 1d300005
12-10 23:03:55.883: INFO/DEBUG(167): 76475c44 6da271c0 /dev/ashmem/dalvik-LinearAlloc (deleted)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c48 7160ca78
12-10 23:03:55.883: INFO/DEBUG(167): 76475c4c 00000004
12-10 23:03:55.883: INFO/DEBUG(167): 76475c50 7373df38
12-10 23:03:55.883: INFO/DEBUG(167): 76475c54 715ef02c /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (Java_name_antonsmirnov_clang_clang_1wrapper_getDiagnostics+76)
12-10 23:03:55.883: INFO/DEBUG(167): #01 76475c58 6d707560 /dev/ashmem/dalvik-LinearAlloc (deleted)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c5c 1d300005
12-10 23:03:55.883: INFO/DEBUG(167): 76475c60 1d300001
12-10 23:03:55.883: INFO/DEBUG(167): 76475c64 7308de78
12-10 23:03:55.883: INFO/DEBUG(167): 76475c68 42802618 /dev/ashmem/dalvik-heap (deleted)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c6c 731a51c8
12-10 23:03:55.883: INFO/DEBUG(167): 76475c70 7160ca78
12-10 23:03:55.883: INFO/DEBUG(167): 76475c74 7160cb20
12-10 23:03:55.883: INFO/DEBUG(167): 76475c78 76475c94 [stack:3690]
12-10 23:03:55.883: INFO/DEBUG(167): 76475c7c 41463b74 /system/lib/libdvm.so (dvmPlatformInvoke+116)
12-10 23:03:55.883: INFO/DEBUG(167): #02 76475c80 7373df2c
12-10 23:03:55.883: INFO/DEBUG(167): 76475c84 00000001
12-10 23:03:55.883: INFO/DEBUG(167): 76475c88 427fe0c8 /dev/ashmem/dalvik-heap (deleted)
12-10 23:03:55.883: INFO/DEBUG(167): 76475c8c 741b6c52 /data/dalvik-cache/data#app#name.antonsmirnov.android.arduinodroid-1.apk#classes.dex
12-10 23:03:55.883: INFO/DEBUG(167): 76475c90 00000000
12-10 23:03:55.883: INFO/DEBUG(167): 76475c94 414928bd /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+364)
12-10 23:03:55.893: INFO/DEBUG(167): memory near r0:
12-10 23:03:55.893: INFO/DEBUG(167): 76475c00 7373df30 7160ca88 76475c7c 40137ff1 0.ss..`q|\Gv...#
12-10 23:03:55.893: INFO/DEBUG(167): 76475c10 75fcda38 402028ff df0027ad 00000000 8..u.( #.'......
12-10 23:03:55.893: INFO/DEBUG(167): 76475c20 1d300005 7308de78 76475c54 715ebdb0 ..0.x..sT\Gv..^q
12-10 23:03:55.893: INFO/DEBUG(167): 76475c30 7308de78 715f1620 1d200005 0008de78 x..s ._q.. .x...
12-10 23:03:55.893: INFO/DEBUG(167): 76475c40 1d300005 6da271c0 7160ca78 00000004 ..0..q.mx.`q....
12-10 23:03:55.893: INFO/DEBUG(167): memory near r2:
12-10 23:03:55.893: INFO/DEBUG(167): 73265708 00000002 7326f158 72d26e70 7324d350 ....X.&spn.rP.$s
12-10 23:03:55.893: INFO/DEBUG(167): 73265718 0000006a 00000000 00000050 00000043 j.......P...C...
12-10 23:03:55.893: INFO/DEBUG(167): 73265728 00000001 401000f0 00000000 00000006 .......#........
12-10 23:03:55.893: INFO/DEBUG(167): 73265738 0000000a 0000000a 00000008 00000000 ................
12-10 23:03:55.893: INFO/DEBUG(167): 73265748 00000e60 749a3930 749a3930 00000000 `...09.t09.t....
12-10 23:03:55.893: INFO/DEBUG(167): memory near r4:
12-10 23:03:55.893: INFO/DEBUG(167): 735086c0 00790063 00750066 00760079 00000076 c.y.f.u.y.v.v...
12-10 23:03:55.893: INFO/DEBUG(167): 735086d0 006a0020 00670062 00000068 0000001b .j.b.g.h.......
12-10 23:03:55.893: INFO/DEBUG(167): 735086e0 75fcda38 00000000 00000000 00000000 8..u............
12-10 23:03:55.893: INFO/DEBUG(167): 735086f0 00000000 0000001b 00000001 00000001 ................
12-10 23:03:55.893: INFO/DEBUG(167): 73508700 72cfb378 00000000 00000018 000000bb x..r............
12-10 23:03:55.893: INFO/DEBUG(167): memory near r5:
12-10 23:03:55.893: INFO/DEBUG(167): 731a51a8 749a3930 749a3930 749a3930 00000000 09.t09.t09.t....
12-10 23:03:55.893: INFO/DEBUG(167): 731a51b8 00000000 00000000 00000000 00000023 ............#...
12-10 23:03:55.893: INFO/DEBUG(167): 731a51c8 715a1dc0 731a3f48 72dbafc0 735086e0 ..ZqH?.s...r..Ps
12-10 23:03:55.893: INFO/DEBUG(167): 731a51d8 73121220 00000000 00000000 0000001b ..s............
12-10 23:03:55.893: INFO/DEBUG(167): 731a51e8 00000005 00000005 00000000 6e616c63 ............clan
12-10 23:03:55.893: INFO/DEBUG(167): memory near r6:
12-10 23:03:55.893: INFO/DEBUG(167): 73265708 00000002 7326f158 72d26e70 7324d350 ....X.&spn.rP.$s
12-10 23:03:55.893: INFO/DEBUG(167): 73265718 0000006a 00000000 00000050 00000043 j.......P...C...
12-10 23:03:55.893: INFO/DEBUG(167): 73265728 00000001 401000f0 00000000 00000006 .......#........
12-10 23:03:55.893: INFO/DEBUG(167): 73265738 0000000a 0000000a 00000008 00000000 ................
12-10 23:03:55.893: INFO/DEBUG(167): 73265748 00000e60 749a3930 749a3930 00000000 `...09.t09.t....
12-10 23:03:55.893: INFO/DEBUG(167): memory near r7:
12-10 23:03:55.893: INFO/DEBUG(167): 731a3f28 00000001 00000001 70a57cd8 00000000 .........|.p....
12-10 23:03:55.893: INFO/DEBUG(167): 731a3f38 732657a8 70a32c28 00000020 000003b3 .W&s(,.p .......
12-10 23:03:55.893: INFO/DEBUG(167): 731a3f48 75fcdfc8 731225f0 72d8ddd8 733af500 ...u.%.s...r..:s
12-10 23:03:55.893: INFO/DEBUG(167): 731a3f58 715b2ac8 00000000 73043e00 73690600 .*[q.....>.s..is
12-10 23:03:55.893: INFO/DEBUG(167): 731a3f68 734d9f88 00000000 00000000 00000000 ..Ms............
12-10 23:03:55.893: INFO/DEBUG(167): memory near r8:
12-10 23:03:55.893: INFO/DEBUG(167): 76475c60 1d300001 7308de78 42802618 731a51c8 ..0.x..s.&.B.Q.s
12-10 23:03:55.893: INFO/DEBUG(167): 76475c70 7160ca78 7160cb20 76475c94 41463b74 x.`q .`q.\Gvt;FA
12-10 23:03:55.893: INFO/DEBUG(167): 76475c80 7373df2c 00000001 427fe0c8 741b6c52 ,.ss.......BRl.t
12-10 23:03:55.893: INFO/DEBUG(167): 76475c90 00000000 414928bd 7373df2c 741b6c50 .....(IA,.ssPl.t
12-10 23:03:55.893: INFO/DEBUG(167): 76475ca0 715eefe0 7160ca88 00000000 00000000 ..^q..`q........
12-10 23:03:55.893: INFO/DEBUG(167): memory near r9:
12-10 23:03:55.893: INFO/DEBUG(167): 7373df10 00000000 00000000 7373df48 7417562c ........H.ss,V.t
12-10 23:03:55.893: INFO/DEBUG(167): 7373df20 6da271c0 00000000 00000000 1d300001 .q.m..........0.
12-10 23:03:55.893: INFO/DEBUG(167): 7373df30 1d300005 7373df84 741750a8 6da26b58 ..0...ss.P.tXk.m
12-10 23:03:55.893: INFO/DEBUG(167): 7373df40 7417562c 00000000 6d707560 00000000 ,V.t....`upm....
12-10 23:03:55.893: INFO/DEBUG(167): 7373df50 00000000 00000000 00000006 1d200005 .............. .
12-10 23:03:55.893: INFO/DEBUG(167): memory near sl:
12-10 23:03:55.893: INFO/DEBUG(167): 7160ca68 00000002 00000000 00000010 00000453 ............S...
12-10 23:03:55.893: INFO/DEBUG(167): 7160ca78 74175628 7373df2c 6da26b58 70991000 (V.t,.ssXk.m...p
12-10 23:03:55.893: INFO/DEBUG(167): 7160ca88 427fded8 00000007 76475da8 00000000 ...B.....]Gv....
12-10 23:03:55.893: INFO/DEBUG(167): 7160ca98 76475ddc 00000010 00000000 41463d00 .]Gv.........=FA
12-10 23:03:55.893: INFO/DEBUG(167): 7160caa8 00000000 00000000 6ca88670 7373a300 ........p..l..ss
12-10 23:03:55.893: INFO/DEBUG(167): memory near fp:
12-10 23:03:55.893: INFO/DEBUG(167): 76475c5c 1d300005 1d300001 7308de78 42802618 ..0...0.x..s.&.B
12-10 23:03:55.893: INFO/DEBUG(167): 76475c6c 731a51c8 7160ca78 7160cb20 76475c94 .Q.sx.`q .`q.\Gv
12-10 23:03:55.893: INFO/DEBUG(167): 76475c7c 41463b74 7373df2c 00000001 427fe0c8 t;FA,.ss.......B
12-10 23:03:55.893: INFO/DEBUG(167): 76475c8c 741b6c52 00000000 414928bd 7373df2c Rl.t.....(IA,.ss
12-10 23:03:55.893: INFO/DEBUG(167): 76475c9c 741b6c50 715eefe0 7160ca88 00000000 Pl.t..^q..`q....
12-10 23:03:55.893: INFO/DEBUG(167): memory near sp:
12-10 23:03:55.893: INFO/DEBUG(167): 76475c00 7373df30 7160ca88 76475c7c 40137ff1 0.ss..`q|\Gv...#
12-10 23:03:55.893: INFO/DEBUG(167): 76475c10 75fcda38 402028ff df0027ad 00000000 8..u.( #.'......
12-10 23:03:55.893: INFO/DEBUG(167): 76475c20 1d300005 7308de78 76475c54 715ebdb0 ..0.x..sT\Gv..^q
12-10 23:03:55.893: INFO/DEBUG(167): 76475c30 7308de78 715f1620 1d200005 0008de78 x..s ._q.. .x...
12-10 23:03:55.893: INFO/DEBUG(167): 76475c40 1d300005 6da271c0 7160ca78 00000004 ..0..q.mx.`q....
12-10 23:03:55.893: INFO/DEBUG(167): code around pc:
12-10 23:03:55.893: INFO/DEBUG(167): 7537b178 ebff8235 e3560000 15963000 e1a0000d 5.....V..0......
12-10 23:03:55.893: INFO/DEBUG(167): 7537b188 e1a02006 12833001 15863000 e5973020 . ...0...0.. 0..
12-10 23:03:55.893: INFO/DEBUG(167): 7537b198 e5931408 eb0152d7 e59f305c e58d4018 .....R..\0...#..
12-10 23:03:55.893: INFO/DEBUG(167): 7537b1a8 e58d401c e08f3003 e2833008 e597412c .#...0...0..,A..
12-10 23:03:55.893: INFO/DEBUG(167): 7537b1b8 e58d3000 e5977130 ea000002 e1a01004 .0..0q..........
12-10 23:03:55.893: INFO/DEBUG(167): code around lr:
12-10 23:03:55.893: INFO/DEBUG(167): 7537b15c e8800048 e580600c e5c06010 e585000c H....`...`......
12-10 23:03:55.893: INFO/DEBUG(167): 7537b16c e3a00038 ebff779f e1a06000 ebff8235 8....w...`..5...
12-10 23:03:55.893: INFO/DEBUG(167): 7537b17c e3560000 15963000 e1a0000d e1a02006 ..V..0....... ..
12-10 23:03:55.893: INFO/DEBUG(167): 7537b18c 12833001 15863000 e5973020 e5931408 .0...0.. 0......
12-10 23:03:55.893: INFO/DEBUG(167): 7537b19c eb0152d7 e59f305c e58d4018 e58d401c .R..\0...#...#..
12-10 23:03:55.923: DEBUG/WifiStateMachine(539): ConnectedState{ what=131155 when=-4ms arg1=1 }
12-10 23:03:55.933: DEBUG/WifiStateMachine(539): L2ConnectedState{ what=131155 when=-4ms arg1=1 }
Another crash (probably another reason):
12-11 00:10:38.106: INFO/DEBUG(166): r0 00000027 r1 deadbaad r2 4024cb0c r3 00000000
12-11 00:10:38.106: INFO/DEBUG(166): r4 00000000 r5 7e7a82bc r6 00000002 r7 00000002
12-11 00:10:38.106: INFO/DEBUG(166): r8 00000030 r9 7d3c0590 sl 7d3aae24 fp 40253a6c
12-11 00:10:38.106: INFO/DEBUG(166): ip 00004000 sp 7e7a82b8 lr 4021ec89 pc 4021b32a cpsr 60000030
12-11 00:10:38.106: INFO/DEBUG(166): d0 20656c6966206e69 d1 646564756c636e69
12-11 00:10:38.106: INFO/DEBUG(166): d2 6f63206d6f726620 d3 645f6574656c706d
12-11 00:10:38.106: INFO/DEBUG(166): d4 000002db000002c9 d5 000002ed000002ec
12-11 00:10:38.106: INFO/DEBUG(166): d6 000003ae0000039c d7 000003d4000003c1
12-11 00:10:38.106: INFO/DEBUG(166): d8 4418800000000262 d9 4434000043898000
12-11 00:10:38.106: INFO/DEBUG(166): d10 0000000042c00000 d11 0000000000000000
12-11 00:10:38.106: INFO/DEBUG(166): d12 0000000000000000 d13 0000000000000000
12-11 00:10:38.106: INFO/DEBUG(166): d14 0000000000000000 d15 0000000000000000
12-11 00:10:38.106: INFO/DEBUG(166): d16 6769736e75202c2a d17 29746e692064656e
12-11 00:10:38.106: INFO/DEBUG(166): d18 6c63206e6f697461 d19 78654c3a3a676e61
12-11 00:10:38.106: INFO/DEBUG(166): d20 537465673a3a7265 d21 636f4c656372756f
12-11 00:10:38.106: INFO/DEBUG(166): d22 6863286e6f697461 d23 74736e6f63207261
12-11 00:10:38.106: INFO/DEBUG(166): d24 0000000000000000 d25 0000000000000000
12-11 00:10:38.106: INFO/DEBUG(166): d26 0000000000000000 d27 0000000000000000
12-11 00:10:38.106: INFO/DEBUG(166): d28 0048004700460044 d29 004a0048004a0049
12-11 00:10:38.106: INFO/DEBUG(166): d30 0000000000000000 d31 0000000000000000
12-11 00:10:38.106: INFO/DEBUG(166): scr 28000013
12-11 00:10:38.126: INFO/DEBUG(166): backtrace:
12-11 00:10:38.126: INFO/DEBUG(166): #00 pc 0001832a /system/lib/libc.so
12-11 00:10:38.126: INFO/DEBUG(166): #01 pc 0000dc04 /system/lib/libc.so (abort+4)
12-11 00:10:38.126: INFO/DEBUG(166): #02 pc 0001f0df /system/lib/libc.so (__assert2+30)
12-11 00:10:38.126: INFO/DEBUG(166): #03 pc 0077c954 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const+76)
12-11 00:10:38.126: INFO/DEBUG(166): #04 pc 0077ca4c /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::FormTokenWithChars(clang::Token&, char const*, clang::tok::TokenKind)+100)
12-11 00:10:38.126: INFO/DEBUG(166): #05 pc 00781098 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::LexTokenInternal(clang::Token&)+5616)
12-11 00:10:38.126: INFO/DEBUG(166): #06 pc 0015de68 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::LexFromRawLexer(clang::Token&)+116)
12-11 00:10:38.126: INFO/DEBUG(166): #07 pc 00781d3c /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getRawToken(clang::SourceLocation, clang::Token&, clang::SourceManager const&, clang::LangOptions const&)+220)
12-11 00:10:38.126: INFO/DEBUG(166): #08 pc 00781d9c /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::MeasureTokenLength(clang::SourceLocation, clang::SourceManager const&, clang::LangOptions const&)+36)
12-11 00:10:38.126: INFO/DEBUG(166): #09 pc 001d1824 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::DiagnosticRenderer::emitMacroExpansions(clang::SourceLocation, clang::DiagnosticsEngine::Level, llvm::ArrayRef<clang::CharSourceRange>, llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const&, unsigned int&, unsigned int)+840)
12-11 00:10:38.126: INFO/DEBUG(166): #10 pc 001d13ec /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::DiagnosticRenderer::emitDiagnostic(clang::SourceLocation, clang::DiagnosticsEngine::Level, llvm::StringRef, llvm::ArrayRef<clang::CharSourceRange>, llvm::ArrayRef<clang::FixItHint>, clang::SourceManager const*, llvm::PointerUnion<clang::Diagnostic const*, clang::StoredDiagnostic const*>)+1224)
12-11 00:10:38.126: INFO/DEBUG(166): #11 pc 001d1b20 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::DiagnosticRenderer::emitStoredDiagnostic(clang::StoredDiagnostic&)+304)
12-11 00:10:38.126: INFO/DEBUG(166): #12 pc 0017b1c8 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::cxdiag::lazyCreateDiags(CXTranslationUnitImpl*, bool)+248)
12-11 00:10:38.126: INFO/DEBUG(166): #13 pc 00009028 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang_wrapper.so (Java_name_antonsmirnov_clang_clang_1wrapper_getDiagnostics+72)
12-11 00:10:38.126: INFO/DEBUG(166): #14 pc 0001fb70 /system/lib/libdvm.so (dvmPlatformInvoke+112)
12-11 00:10:38.126: INFO/DEBUG(166): #15 pc 0004e8b9 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+360)
12-11 00:10:38.126: INFO/DEBUG(166): #16 pc 00029020 /system/lib/libdvm.so
12-11 00:10:38.126: INFO/DEBUG(166): #17 pc 0002d7e8 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
12-11 00:10:38.126: INFO/DEBUG(166): #18 pc 0005fed5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
12-11 00:10:38.126: INFO/DEBUG(166): #19 pc 0005feff /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
12-11 00:10:38.126: INFO/DEBUG(166): #20 pc 00055327 /system/lib/libdvm.so
12-11 00:10:38.126: INFO/DEBUG(166): #21 pc 00012e70 /system/lib/libc.so (__thread_entry+48)
12-11 00:10:38.126: INFO/DEBUG(166): #22 pc 000125c8 /system/lib/libc.so (pthread_create+172)
12-11 00:10:38.126: INFO/DEBUG(166): stack:
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8278 00000000
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a827c c6c488f5
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8280 00001000
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8284 00000262
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8288 44188000 /dev/ashmem/dalvik-heap (deleted)
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a828c 43898000 /dev/ashmem/dalvik-heap (deleted)
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8290 40247774 /system/lib/libc.so
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8294 4024cd10
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a8298 00000000
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a829c 4021ec89 /system/lib/libc.so (_fwalk+32)
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82a0 00000001
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82a4 7e7a82bc [stack:5011]
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82a8 00000002
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82ac 00000002
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82b0 df0027ad
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82b4 00000000
12-11 00:10:38.126: INFO/DEBUG(166): #00 7e7a82b8 75ff7ec2 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82bc fffffbdf
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82c0 4023dbfc /system/lib/libc.so
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82c4 00000002
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82c8 00000002
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82cc 4021e1f5 /system/lib/libc.so (fprintf+16)
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82d0 40247718 /system/lib/libc.so
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82d4 75ff7ec2 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82d8 4023dbfc /system/lib/libc.so
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82dc 40210c08 /system/lib/libc.so (__pthread_clone)
12-11 00:10:38.126: INFO/DEBUG(166): #01 7e7a82e0 7e7a82e0 [stack:5011]
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82e4 402220e3 /system/lib/libc.so (__assert2+34)
12-11 00:10:38.126: INFO/DEBUG(166): #02 7e7a82e8 0000042d
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82ec 75feace7 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const::__PRETTY_FUNCTION__)
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82f0 75feace7 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const::__PRETTY_FUNCTION__)
12-11 00:10:38.126: INFO/DEBUG(166): 7e7a82f4 75a7c958 /data/data/name.antonsmirnov.android.arduinodroid/lib/libclang.so (clang::Lexer::getSourceLocation(char const*, unsigned int) const+80)
12-11 00:10:38.136: INFO/DEBUG(166): memory near r2:
12-11 00:10:38.136: INFO/DEBUG(166): 4024caec 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.136: INFO/DEBUG(166): 4024cafc 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.136: INFO/DEBUG(166): 4024cb0c 00000001 00000000 00000000 00000000 ................
12-11 00:10:38.136: INFO/DEBUG(166): 4024cb1c 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.136: INFO/DEBUG(166): 4024cb2c 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.136: INFO/DEBUG(166): memory near r5:
12-11 00:10:38.136: INFO/DEBUG(166): 7e7a829c 4021ec89 00000001 7e7a82bc 00000002 ..!#......z~....
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82ac 00000002 df0027ad 00000000 75ff7ec2 .....'.......~.u
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82bc fffffbdf 4023dbfc 00000002 00000002 ......##........
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82cc 4021e1f5 40247718 75ff7ec2 4023dbfc ..!#.w$#.~.u..##
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82dc 40210c08 7e7a82e0 402220e3 0000042d ..!#..z~. "#-...
12-11 00:10:38.146: INFO/DEBUG(166): memory near r9:
12-11 00:10:38.146: INFO/DEBUG(166): 7d3c0570 7d39c9fc 7e020006 0003be14 00000001 ..9}...~........
12-11 00:10:38.146: INFO/DEBUG(166): 7d3c0580 00000000 7e020015 0003be15 00000004 .......~........
12-11 00:10:38.146: INFO/DEBUG(166): 7d3c0590 7e313d3c 7e000069 0003be19 00000001 <=1~i..~........
12-11 00:10:38.146: INFO/DEBUG(166): 7d3c05a0 00000000 7e000016 0003be1e 0000000d .......~........
12-11 00:10:38.146: INFO/DEBUG(166): 7d3c05b0 7e1cbd10 7e0200a6 00000000 00000002 ...~...~........
12-11 00:10:38.146: INFO/DEBUG(166): memory near sl:
12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae04 7d3aae24 7d3aaf15 706d6f63 6574656c $.:}..:}complete
12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae14 6d65645f 6e692e6f 70632e6f 67670070 _demo.ino.cpp.gg
12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae24 636e6923 6564756c 72413c20 6e697564 #include <Arduin
12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae34 3e682e6f 7274730a 20746375 0a7b2073 o.h>.struct s {.
12-11 00:10:38.146: INFO/DEBUG(166): 7d3aae44 6e692020 3b692074 746e690a 203b6620 int i;.int f;
12-11 00:10:38.146: INFO/DEBUG(166): memory near fp:
12-11 00:10:38.146: INFO/DEBUG(166): 40253a4c 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.146: INFO/DEBUG(166): 40253a5c 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.146: INFO/DEBUG(166): 40253a6c c6c488f5 00000000 00000000 00000000 ................
12-11 00:10:38.146: INFO/DEBUG(166): 40253a7c 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.146: INFO/DEBUG(166): 40253a8c 00000000 00000000 00000000 00000000 ................
12-11 00:10:38.146: INFO/DEBUG(166): memory near ip:
12-11 00:10:38.146: INFO/DEBUG(166): 00003fe0 ffffffff ffffffff ffffffff ffffffff ................
12-11 00:10:38.146: INFO/DEBUG(166): 00003ff0 ffffffff ffffffff ffffffff ffffffff ................
12-11 00:10:38.146: INFO/DEBUG(166): 00004000 ffffffff ffffffff ffffffff ffffffff ................
12-11 00:10:38.146: INFO/DEBUG(166): 00004010 ffffffff ffffffff ffffffff ffffffff ................
12-11 00:10:38.146: INFO/DEBUG(166): 00004020 ffffffff ffffffff ffffffff ffffffff ................
12-11 00:10:38.146: INFO/DEBUG(166): memory near sp:
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a8298 00000000 4021ec89 00000001 7e7a82bc ......!#......z~
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82a8 00000002 00000002 df0027ad 00000000 .........'......
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82b8 75ff7ec2 fffffbdf 4023dbfc 00000002 .~.u......##....
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82c8 00000002 4021e1f5 40247718 75ff7ec2 ......!#.w$#.~.u
12-11 00:10:38.146: INFO/DEBUG(166): 7e7a82d8 4023dbfc 40210c08 7e7a82e0 402220e3 ..##..!#..z~. "#
12-11 00:10:38.146: INFO/DEBUG(166): code around pc:
12-11 00:10:38.146: INFO/DEBUG(166): 4021b308 e000b164 6823461c d1fb2b00 68e3e026 d....F#h.+..&..h
12-11 00:10:38.146: INFO/DEBUG(166): 4021b318 4a17b123 447a2401 47986014 20274911 #..J.$zD.`.G.I'
12-11 00:10:38.146: INFO/DEBUG(166): 4021b328 70082400 eb9cf7f4 f7f52106 a902ecdc .$.p.....!......
12-11 00:10:38.146: INFO/DEBUG(166): 4021b338 f04f2006 460a5380 94029304 f7f59403 . O..S.F........
12-11 00:10:38.146: INFO/DEBUG(166): 4021b348 4629e8ba 20024622 e8c2f7f5 eb88f7f4 ..)F"F. ........
12-11 00:10:38.146: INFO/DEBUG(166): code around lr:
12-11 00:10:38.146: INFO/DEBUG(166): 4021ec68 41f0e92d 4c0b2600 447c4680 68a56824 -..A.&.L.F|D$h.h
12-11 00:10:38.146: INFO/DEBUG(166): 4021ec78 e0076867 300cf9b5 dd022b00 47c04628 gh.....0.+..(F.G
12-11 00:10:38.146: INFO/DEBUG(166): 4021ec88 35544306 d5f53f01 2c006824 4630d1ef .CT5.?..$h.,..0F
12-11 00:10:38.146: INFO/DEBUG(166): 4021ec98 81f0e8bd 0002888e 43f0e92d fb01461f ........-..C.F..
12-11 00:10:38.146: INFO/DEBUG(166): 4021eca8 f8dff602 b0878058 44f8460c 8000f8d8 ....X....F.D....
12-11 00:10:38.146: INFO/DEBUG(166): memory map around fault addr deadbaad:
12-11 00:10:38.146: INFO/DEBUG(166): be8ef000-be910000 [stack]
12-11 00:10:38.146: INFO/DEBUG(166): (no map for address)
12-11 00:10:38.146: INFO/DEBUG(166): ffff0000-ffff1000 [vectors]
12-11 00:10:38.536: INFO/BootReceiver
It was concurrency issue. Clang methods/structures seem to be not thread-safe so one have to synchronize access. One more suggestion: do not share the same JNIEnv* between threads! use vm>GetEnv() from within a thread to get JNIEnv pointer.