Is there a way to get more useful information from an android crash? Deliberately inducing a UAF crash in android ICS I get the following output to my logcat, but is there a way to do a more complete stack dump and heap dump at the time of the crash? I can't seem to do it in ddms because as soon as the fatal signal is hit ddms abandons the process (because it doesn't exist anymore)
F/libc ( 598): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
I/DEBUG ( 33): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEUG ( 33): Build fingerprint: 'generic/sdk/generic:4.0.2/ICS_MR0/229537:eng/test-keys'
I/DEBUG ( 33): pid: 598, tid: 621 >>> com.android.browser <<<
I/DEBUG ( 33): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG ( 33): r0 4b7824f0 r1 004b6da0 r2 00000000 r3 00000000
I/DEBUG ( 33): r4 00e8d7c0 r5 004b6da0 r6 00348370 r7 00000000
I/DEBUG ( 33): r8 49c61b10 r9 4afc808d 10 497df75d fp 00108698
I/DEBUG ( 33): ip 00000000 sp 4b7824f0 lr 496bf215 pc 00000000 cpsr 20000010
I/DEBUG ( 33): d0 44750000cf000000 d1 44c1000000000000
I/DEBUG ( 33): d2 0000000044c10000 d3 4475000044750000
I/DEBUG ( 33): d4 0000000000000000 d5 44c1000000000000
I/DEBUG ( 33): d6 0000000000000000 d7 0000000000000000
I/DEBUG ( 33): d8 0000000000000000 d9 3fa999999999999a
I/DEBUG ( 33): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 33): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 33): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 33): scr 60000013
I/DEBUG ( 33):
I/DEBUG ( 33): #00 pc 00000000
I/DEBUG ( 33): #01 pc 00191212 /system/lib/libwebcore.so
I/DEBUG ( 33): #02 pc 001745c8 /system/lib/libwebcore.so
I/DEBUG ( 33): #03 pc 002b1766 /system/lib/libwebcore.so
I/DEBUG ( 33): #04 pc 004dccae /system/lib/libwebcore.so
I/DEBUG ( 33): #05 pc 004e052a /system/lib/libwebcore.so
I/DEBUG ( 33): #06 pc 004c3aae /system/lib/libwebcore.so
I/DEBUG ( 33): #07 pc 004c3b34 /system/lib/libwebcore.so
I/DEBUG ( 33):
I/DEBUG ( 33): code around pc:
I/DEBUG ( 33): 00000000 ffffffff ffffffff ffffffff ffffffff
I/DEBUG ( 33): 00000010 ffffffff ffffffff ffffffff ffffffff
I/DEBUG ( 33): 00000020 ffffffff ffffffff ffffffff ffffffff
I/DEBUG ( 33): 00000030 ffffffff ffffffff ffffffff ffffffff
I/DEBUG ( 33): 00000040 ffffffff ffffffff ffffffff ffffffff
I/DEBUG ( 33):
I/DEBUG ( 33): code around lr:
I/DEBUG ( 33): 496bf1f4 47904668 bd0e9801 68c3b507 b1134601
I/DEBUG ( 33): 496bf204 fc64f004 6800e005 20b0f8d0 47904668
I/DEBUG ( 33): 496bf214 bd0e9800 68c3b510 f004b113 e001fc49
I/DEBUG ( 33): 496bf224 fd18f7fe bf00bd10 68c3b510 f004b113
I/DEBUG ( 33): 496bf234 e001fc31 fd04f7fe bf00bd10 0124f1a1
I/DEBUG ( 33):
I/DEBUG ( 33): stack:
I/DEBUG ( 33): 4b7824b0 00738f28
I/DEBUG ( 33): 4b7824b4 00348370
I/DEBUG ( 33): 4b7824b8 00000000
I/DEBUG ( 33): 4b7824bc 49c61b10
I/DEBUG ( 33): 4b7824c0 4afc808d
I/DEBUG ( 33): 4b7824c4 497df75d /system/lib/libwebcore.so
I/DEBUG ( 33): 4b7824c8 00108698
I/DEBUG ( 33): 4b7824cc 49857421 /system/lib/libwebcore.so
I/DEBUG ( 33): 4b7824d0 00e7c388
I/DEBUG ( 33): 4b7824d4 00000000
I/DEBUG ( 33): 4b7824d8 00e7c388
I/DEBUG ( 33): 4b7824dc 498573f9 /system/lib/libwebcore.so
I/DEBUG ( 33): 4b7824e0 00e7c388
I/DEBUG ( 33): 4b7824e4 00000000
I/DEBUG ( 33): 4b7824e8 df0027ad
I/DEBUG ( 33): 4b7824ec 00000000
I/DEBUG ( 33): #01 4b7824f0 004b6da0
I/DEBUG ( 33): 4b7824f4 00000001
I/DEBUG ( 33): 4b7824f8 00000000
I/DEBUG ( 33): 4b7824fc 496a25cd /system/lib/libwebcore.so
You can see the complete logs of the device by selecting All messages(no filters) option in Logcat.
For some reason I cannot get Native (C/C++) address / stack traces happening on the ICS devices I have here.
On my Nexus 7 nothing is output when a native library crashes. log.redirect-stdio is set to 1 when set through /system/default.prop and /data/local.prop, neither worked.
I tried setting log.redirect-stdio to true using the stop, setprop, start command but still no native stacktrace was output to logcat.
Google I mean come on... I loose more and more faith in Google every day just because of my buggy, unpredictable relationship with Android.
check HERE because u may have to alter the NDK/ndk-build step... by changing 'Android.mk' , 'Application.mk' files in ./jni folder.
have u tried this:
$ adb shell stop
$ adb shell setprop log.redirect-stdio true
$ adb shell start
when i do that in JB, i get stuff like the following in normal logcat...
F/libc (13345): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 13345 (bpo.media.notes)
I/DEBUG ( 121): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 121): Build fingerprint: 'google/takju/maguro:4.1.1/JRO03C/398337:user/release-keys'
I/DEBUG ( 121): pid: 13345, tid: 13345, name: bpo.media.notes >>> com.b2bpo.media.notes <<<
I/DEBUG ( 121): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG ( 121): r0 4110e470 r1 dbe00019 r2 dda00021 r3 59e4d144
I/DEBUG ( 121): r4 4110e470 r5 00000000 r6 dbe00019 r7 00000000
I/DEBUG ( 121): r8 dda00021 r9 5cab8e50 sl 4110fa18 fp be95a5d4
I/DEBUG ( 121): ip 00000000 sp be95a5a0 lr 59e4bd11 pc 00000000 cpsr 48000010
I/DEBUG ( 121): d0 756f6620746f6e20 d1 203a5d333930315b
I/DEBUG ( 121): d2 207972617262694c d3 276765706d666627
I/DEBUG ( 121): d4 0066007200750053 d5 0054006500630061
I/DEBUG ( 121): d6 0000000000780065 d7 00000000c3120000
I/DEBUG ( 121): d8 000000000000040e d9 4434000000000000
I/DEBUG ( 121): d10 000000004481c000 d11 0000000000000000
I/DEBUG ( 121): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 121): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 121): d16 0000000000000001 d17 0000000000000001
I/DEBUG ( 121): d18 0000000000000002 d19 0000000000000000
I/DEBUG ( 121): d20 4062400000000000 d21 3ff0000000000000
I/DEBUG ( 121): d22 8000000000000000 d23 0000000000000000
I/DEBUG ( 121): d24 0000000000000000 d25 8000000000000000
I/DEBUG ( 121): d26 3ff0000000000000 d27 3fdb6f2281b5dfe3
I/DEBUG ( 121): d28 3fe3341cf8e40e47 d29 bfa8605c00000000
I/DEBUG ( 121): d30 40079e7e00000000 d31 3fe2b80340000000
I/DEBUG ( 121): scr 60000011
I/DEBUG ( 121):
I/DEBUG ( 121): backtrace:
I/DEBUG ( 121): #00 pc 00000000 <unknown>
I/DEBUG ( 121): #01 pc 00000d0f /data/data/com.b2bpo.media.notes/lib/libffmpeginvoke.so (Java_com_b2bpo_media_notes_RecorderActivity_run+66)
I/DEBUG ( 121): #02 pc 0001de30 /system/lib/libdvm.so (dvmPlatformInvoke+112)
I/DEBUG ( 121): #03 pc 0004d083 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+394)
I/DEBUG ( 121): #04 pc 0004f19f /system/lib/libdvm.so (dvmResolveNativeMethod(unsigned int const*, JValue*, Method const*, Thread*)+174)
I/DEBUG ( 121): #05 pc 00027260 /system/lib/libdvm.so
I/DEBUG ( 121): #06 pc 0002bb68 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
I/DEBUG ( 121): #07 pc 0005fab7 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374)
I/DEBUG ( 121): #08 pc 0006700d /system/lib/libdvm.so
I/DEBUG ( 121): #09 pc 00027260 /system/lib/libdvm.so
I/DEBUG ( 121): #10 pc 0002bb68 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
I/DEBUG ( 121): #11 pc 0005fab7 /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374)
I/DEBUG ( 121): #12 pc 0006700d /system/lib/libdvm.so
I/DEBUG ( 121): #13 pc 00027260 /system/lib/libdvm.so
I/DEBUG ( 121): #14 pc 0002bb68 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+180)
I/DEBUG ( 121): #15 pc 0005f7f1 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
I/DEBUG ( 121): #16 pc 00049673 /system/lib/libdvm.so
I/DEBUG ( 121): #17 pc 0004698d /system/lib/libandroid_runtime.so
I/DEBUG ( 121): #18 pc 0004746f /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+390)
I/DEBUG ( 121): #19 pc 00000dcf /system/bin/app_process
I/DEBUG ( 121):
I/DEBUG ( 121): stack:
I/DEBUG ( 121): be95a560 be95a5d4 [stack]
I/DEBUG ( 121): be95a564 4017fb61 /system/bin/linker
I/DEBUG ( 121): be95a568 4018afd0 /system/bin/linker
I/DEBUG ( 121): be95a56c 4018afeb /system/bin/linker
I/DEBUG ( 121): be95a570 40197c0c
I/DEBUG ( 121): be95a574 00000000
I/DEBUG ( 121): be95a578 00000000
I/DEBUG ( 121): be95a57c 59e4bd07 /data/data/com.b2bpo.media.notes/lib/libffmpeginvoke.so (Java_com_b2bpo_media_notes_RecorderActivity_run+58)
I/DEBUG ( 121): be95a580 59e4d144 /data/data/com.b2bpo.media.notes/lib/libffmpeginvoke.so
I/DEBUG ( 121): be95a584 4017fbfd /system/bin/linker
I/DEBUG ( 121): be95a588 00000000
I/DEBUG ( 121): be95a58c 59e4d144 /data/data/com.b2bpo.media.notes/lib/libffmpeginvoke.so
I/DEBUG ( 121): be95a590 4110e470 [heap]
I/DEBUG ( 121): be95a594 c200001d
I/DEBUG ( 121): be95a598 df0027ad
I/DEBUG ( 121): be95a59c 00000000
I/DEBUG ( 121): #00 be95a5a0 dda00021
I/DEBUG ( 121): ........ ........
I/DEBUG ( 121): #01 be95a5a0 dda00021
I/DEBUG ( 121): be95a5a4 56ddb4e0 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG ( 121): be95a5a8 4110fa08 [heap]
I/DEBUG ( 121): be95a5ac 00000000
I/DEBUG ( 121): be95a5b0 410c6cdc
I/DEBUG ( 121): be95a5b4 be95a5c0 [stack]
I/DEBUG ( 121): be95a5b8 410c6cd4
I/DEBUG ( 121): be95a5bc 4074ee34 /system/lib/libdvm.so (dvmPlatformInvoke+116)
I/DEBUG ( 121): #02 be95a5c0 410c6cd0
I/DEBUG ( 121): be95a5c4 00000001
I/DEBUG ( 121): be95a5c8 41ba41b8 /dev/ashmem/dalvik-heap (deleted)
I/DEBUG ( 121): be95a5cc 59e4902b /data/dalvik-cache/data#app#com.b2bpo.media.notes-2.apk#classes.dex
I/DEBUG ( 121): be95a5d0 00000019
I/DEBUG ( 121): be95a5d4 4077e087 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
I/DEBUG ( 121):
I/DEBUG ( 121): memory near r0:
I/DEBUG ( 121): 4110e450 6c436d65 0000001b 411254d8 4007c51c emCl.....T.A...#
I/DEBUG ( 121): 4110e460 74696e49 4007003b 00000018 00000023 Init;..#....#...
I/DEBUG ( 121): 4110e470 407d4970 407d4de4 00000001 4110fa08 pI}#.M}#.......A
I/DEBUG ( 121): 4110e480 00000000 58ba5a30 00000000 0000001b ....0Z.X........
I/DEBUG ( 121): 4110e490 00000000 00000000 00000000 4110e490 ...............A
I/DEBUG ( 121):
I/DEBUG ( 121): memory near r3:
I/DEBUG ( 121): 59e4d124 e0833102 e2830008 e28dd014 e8bd8000 .1..............
I/DEBUG ( 121): 59e4d134 e92d4008 ebfffac7 e92d4008 ebfffac5 .#-......#-.....
I/DEBUG ( 121): 59e4d144 6176614a 6d6f635f 6232625f 6d5f6f70 Java_com_b2bpo_m
I/DEBUG ( 121): 59e4d154 61696465 746f6e5f 525f7365 726f6365 edia_notes_Recor
I/DEBUG ( 121): 59e4d164 41726564 76697463 5f797469 7552616e derActivity_naRu
I/DEBUG ( 121):
I/DEBUG ( 121): memory near r4:
I/DEBUG ( 121): 4110e450 6c436d65 0000001b 411254d8 4007c51c emCl.....T.A...#
I/DEBUG ( 121): 4110e460 74696e49 4007003b 00000018 00000023 Init;..#....#...
I/DEBUG ( 121): 4110e470 407d4970 407d4de4 00000001 4110fa08 pI}#.M}#.......A
I/DEBUG ( 121): 4110e480 00000000 58ba5a30 00000000 0000001b ....0Z.X........
I/DEBUG ( 121): 4110e490 00000000 00000000 00000000 4110e490 ...............A
I/DEBUG ( 121):
I/DEBUG ( 121): memory near r9:
I/DEBUG ( 121): 5cab8e30 4023af08 5cab8d80 00000033 00000007 ..##...\3.......
I/DEBUG ( 121): 5cab8e40 00000002 00000000 59c61708 00000011 ...........Y....
I/DEBUG ( 121): 5cab8e50 5bd26990 4007c514 00000010 00000012 .i.[...#........
I/DEBUG ( 121): 5cab8e60 59e810b4 4007c514 00000010 00000043 ...Y...#....C...
I/DEBUG ( 121): 5cab8e70 4023aea0 5cb8a368 4023aec0 59f65d60 ..##h..\..##`].Y
I/DEBUG ( 121):
I/DEBUG ( 121): memory near sl:
I/DEBUG ( 121): 4110f9f8 00000000 00000800 4109e008 00000453 ...........AS...
I/DEBUG ( 121): 4110fa08 57c0df5a 410c6cd0 56ddb400 59c6b000 Z..W.l.A...V...Y
I/DEBUG ( 121): 4110fa18 0000007a 98b9bd7e be95a710 00000000 z...~...........
I/DEBUG ( 121): 4110fa28 be95a744 00000001 00000000 4074efc0 D.............t#
I/DEBUG ( 121): 4110fa38 00000000 00000000 4066fe70 410c1300 ........p.f#...A
I/DEBUG ( 121):
I/DEBUG ( 121): memory near fp:
I/DEBUG ( 121): be95a5b4 be95a5c0 410c6cd4 4074ee34 410c6cd0 .....l.A4.t#.l.A
I/DEBUG ( 121): be95a5c4 00000001 41ba41b8 59e4902b 00000019 .....A.A+..Y....
I/DEBUG ( 121): be95a5d4 4077e087 410c6cd0 59e49028 59e4bccd ..w#.l.A(..Y...Y
I/DEBUG ( 121): be95a5e4 4110fa18 00000000 00000000 59fe8dc0 ...A...........Y
I/DEBUG ( 121): be95a5f4 40083a4c 00000000 40048571 40048539 L:.#....q..#9..#
I/DEBUG ( 121):
I/DEBUG ( 121): memory near sp:
I/DEBUG ( 121): be95a580 59e4d144 4017fbfd 00000000 59e4d144 D..Y...#....D..Y
I/DEBUG ( 121): be95a590 4110e470 c200001d df0027ad 00000000 p..A.....'......
I/DEBUG ( 121): be95a5a0 dda00021 56ddb4e0 4110fa08 00000000 !......V...A....
I/DEBUG ( 121): be95a5b0 410c6cdc be95a5c0 410c6cd4 4074ee34 .l.A.....l.A4.t#
I/DEBUG ( 121): be95a5c0 410c6cd0 00000001 41ba41b8 59e4902b .l.A.....A.A+..Y
I/DEBUG ( 121):
I/DEBUG ( 121): code around pc:
I/DEBUG ( 121): 00000000 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 121): 00000010 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 121): 00000020 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 121): 00000030 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 121): 00000040 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 121):
I/DEBUG ( 121): code around lr:
I/DEBUG ( 121): 59e4bcf0 f8d34629 460732a8 47984620 46384907 )F...2.F F.G.I8F
I/DEBUG ( 121): 59e4bd00 f7ff4479 4631efc4 46054642 47a84620 yD....1FBF.F F.G
I/DEBUG ( 121): 59e4bd10 e8bd4638 f7ff43f8 bf00bf99 00001440 8F...C......#...
I/DEBUG ( 121): 59e4bd20 e5903000 e3130101 13833102 03c33102 .0.......1...1..
I/DEBUG ( 121): 59e4bd30 e0800003 e12fff1e e92d4ff0 e59f51ac ....../..O-..Q..
I/ActivityManager(11604): Process com.b2bpo.media.notes (pid 13345) has died.
I/WindowState(11604): WIN DEATH: Window{425a34d0 com.b2bpo.media.notes/com.b2bpo.media.notes.RecorderActivity paused=false}
W/ActivityManager(11604): Force removing ActivityRecord{425839e0 com.b2bpo.media.notes/.RecorderActivity}: app died, no saved stat
Greetings to everyone!
I'm trying to compile pjsua using the following branch:
http://svn.pjsip.org/repos/pjproject/branches/projects/android/. I've
tried to do a push (adb push pjsua /data/local/) to my Android-sdk
emulator but, when I've tried to execute it via adb shell, the Android
LogCat gave me the following SIGFAULT error: where am I wrong? Thanks
in advance.
F/libc ( 464): Fatal signal 11 (SIGSEGV) at 0x000000f0 (code=1)
I/DEBUG ( 33): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 33): Build fingerprint:'generic/sdk/generic:4.0.3/MR1/237985:eng/test-keys'
I/DEBUG ( 33): pid: 464, tid: 464 >>> ./pjsua-arm-unknown-linux-androideabi <<<
I/DEBUG ( 33): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000000f0
I/DEBUG ( 33): r0 ffffffff r1 beef7c30 r2 beef7c30 r3 ffffffff
I/DEBUG ( 33): r4 00000000 r5 00000000 r6 00000000 r7 00000000
I/DEBUG ( 33): r8 00000000 r9 00000000 10 00000000 fp 00000000
I/DEBUG ( 33): ip 4003c4b9 sp beef7c60 lr 4003c4b1 pc b000469a cpsr 00000030
I/DEBUG ( 33): d0 00000000bd6bc8e3 d1 0000000000000000
I/DEBUG ( 33): d2 0000000000000000 d3 0000000000000000
I/DEBUG ( 33): d4 0000000000000000 d5 41c8f0a46e800000
I/DEBUG ( 33): d6 3f50624dd2f1a9fc d7 c18af9670cce266f
I/DEBUG ( 33): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 33): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 33): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 33): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 33): scr 00000010
I/DEBUG ( 33):
I/DEBUG ( 33): #00 pc b000469a /system/bin/linker
I/DEBUG ( 33): #01 pc 000264ac /system/lib/libc.so (__set_errno)
I/DEBUG ( 33):
I/DEBUG ( 33): code around pc:
I/DEBUG ( 33): b0004678 95004840 44784a40 4d414b40 447b447a #H..#JxD#KAMzD{D
I/DEBUG ( 33): b0004688 682d447d f44f9103 95017140 f0009402 }D-h..O.#q......
I/DEBUG ( 33): b0004698 f8d4ff67 b10330f0 f8d44798 b17000e0 g....0...G....p.
I/DEBUG ( 33): b00046a8 10e4f8d4 f7ff2200 2000f9b5 f8d4e007 ....."..... ....
I/DEBUG ( 33): b00046b8 f04f20a8 f04230ff f8c40102 b00710a8 .O..0B.........
I/DEBUG ( 33):
I/DEBUG ( 33): code around lr:
I/DEBUG ( 33): 4003c490 f240b507 9300736c 33fff04f 466b9301 ..#.ls..O..3..kF
I/DEBUG ( 33): 4003c4a0 fd80f7ff bf00bd0e 4604b510 fe90f7ec ...........F....
I/DEBUG ( 33): 4003c4b0 f04f6004 bd1030ff 0ffff110 db02b510 .`O..0..........
I/DEBUG ( 33): 4003c4c0 f7ff4240 bd10fff1 48214603 4478b5f0 #B.......F!H..xD
I/DEBUG ( 33): 4003c4d0 b0976800 68022150 4620ac01 92154e1d .h..P!.h.. F.N..
I/DEBUG ( 33):
I/DEBUG ( 33): stack:
I/DEBUG ( 33): beef7c20 00000000
I/DEBUG ( 33): beef7c24 4003c4c7 /system/lib/libc.so
I/DEBUG ( 33): beef7c28 00000000
I/DEBUG ( 33): beef7c2c 4002f477 /system/lib/libc.so
I/DEBUG ( 33): beef7c30 b00144c4
I/DEBUG ( 33): beef7c34 00000000
I/DEBUG ( 33): beef7c38 10000000
I/DEBUG ( 33): beef7c3c 00000000
I/DEBUG ( 33): beef7c40 00000000
I/DEBUG ( 33): beef7c44 4002f49b /system/lib/libc.so
I/DEBUG ( 33): beef7c48 00000000
I/DEBUG ( 33): beef7c4c 0000c090 /data/local/pjsua-arm-unknown-linux-androideabi
I/DEBUG ( 33): beef7c50 b00144c4
I/DEBUG ( 33): beef7c54 0000c070 /data/local/pjsua-arm-unknown-linux-androideabi
I/DEBUG ( 33): beef7c58 df0027ad
I/DEBUG ( 33): beef7c5c 00000000
I/DEBUG ( 33): #01 beef7c60 00000001
I/DEBUG ( 33): beef7c64 beef7d47 [stack]
I/DEBUG ( 33): beef7c68 00000000
I/DEBUG ( 33): beef7c6c beef7d6d [stack]
I/DEBUG ( 33): beef7c70 beef7d82 [stack]
I/DEBUG ( 33): beef7c74 beef7d92 [stack]
I/DEBUG ( 33): beef7c78 beef7dba [stack]
I/DEBUG ( 33): beef7c7c beef7df7 [stack]
I/DEBUG ( 33): beef7c80 beef7e10 [stack]
I/DEBUG ( 33): beef7c84 beef7e2a [stack]
I/DEBUG ( 33): beef7c88 beef7f55 [stack]
I/DEBUG ( 33): beef7c8c beef7f68 [stack]
I/DEBUG ( 33): beef7c90 beef7f83 [stack]
I/DEBUG ( 33): beef7c94 beef7fa0 [stack]
I/DEBUG ( 33): beef7c98 beef7fb3 [stack]
I/DEBUG ( 33): beef7c9c 00000000
I/DEBUG ( 33): beef7ca0 00000010
I/DEBUG ( 33): beef7ca4 000030d7
EDIT 1: I must remark that I already know solutions such as csipsimple. Anyway, I'm interested to resolve my cross-compiling issue with Android-ndk's tools.
Why not trying to use an android device instead?
I red in the android website that the android simulator is usually not compatible with sip stacks.
I have made some changes to dalvik jit by changing the jit table structure from chained array to a combination of hash table and B-tree. Now when i execute a sample java program which is
public class prog {
public static void main(String args[])
{
long start=System.currentTimeMillis();
int sum=0;
for(int i=1;i<10;i++)
{
for(int j=0;j<10;j++) {
long h=getKey();
System.out.println("key : "+h);
}
}
System.out.println("time : "+(System.currentTimeMillis()-start));
}
public static long getKey()
{
Random rand=new Random();
long key = rand.nextLong();
if(key<0)
return -key;
else
return key;
}
}
using dalvikvm -cp prog.jar prog after pushing libdvm.so(built after changes made to JIT) into the android emulator. Sometimes the program runs perfectly and sometimes it results in segmentation fault. When I checked the logs this is the error shown :
Fatal signal 11 (SIGSEGV) at 0x00000020 (code=1)
I/DEBUG ( 33): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 33): Build fingerprint: 'generic/sdk/generic:4.0.3/MR1/237985:eng/test-keys'
I/DEBUG ( 33): pid: 766, tid: 766 >>> dalvikvm <<<
I/DEBUG ( 33): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000020
I/DEBUG ( 33): r0 00000020 r1 4245b32a r2 0000001f r3 00000001
I/DEBUG ( 33): r4 4245b32a r5 41af7e90 r6 0000f9a0 r7 0000063d
I/DEBUG ( 33): r8 4001edc0 r9 00000000 10 40513620 fp 00000014
I/DEBUG ( 33): ip 400bf108 sp beb6cad0 lr 00000000 pc 00000020 cpsr 20000010
I/DEBUG ( 33): d0 3f4000003f400000 d1 0000000000000000
I/DEBUG ( 33): d2 0000000000000000 d3 0000000000000000
I/DEBUG ( 33): d4 0000000000000000 d5 41ca61a4d0800000
I/DEBUG ( 33): d6 3f50624dd2f1a9fc d7 3ede5bd843b4bb5d
I/DEBUG ( 33): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 33): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 33): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 33): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 33): scr 60000010
I/DEBUG ( 33):
I/DEBUG ( 33): #00 pc 00000020
I/DEBUG ( 33): #01 lr 00000000 <unknown>
I/DEBUG ( 33):
I/DEBUG ( 33): code around pc:
I/DEBUG ( 33): 00000000 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000010 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000020 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000030 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000040 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33):
I/DEBUG ( 33): code around lr:
I/DEBUG ( 33): 00000000 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000010 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000020 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000030 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33): 00000040 ffffffff ffffffff ffffffff ffffffff ................
I/DEBUG ( 33):
I/DEBUG ( 33): stack:
I/DEBUG ( 33): beb6ca90 0000001f
I/DEBUG ( 33): beb6ca94 00000000
I/DEBUG ( 33): beb6ca98 00000000
I/DEBUG ( 33): beb6ca9c 400817ed /system/lib/libdvm.so
I/DEBUG ( 33): beb6caa0 400a4736 /system/lib/libdvm.so
I/DEBUG ( 33): beb6caa4 00000001
I/DEBUG ( 33): beb6caa8 4245b32a /system/framework/core.odex
I/DEBUG ( 33): beb6caac 0000001f
I/DEBUG ( 33): beb6cab0 00000001
I/DEBUG ( 33): beb6cab4 4245b32a /system/framework/core.odex
I/DEBUG ( 33): beb6cab8 41af7e90
I/DEBUG ( 33): beb6cabc 0000f9a0 [heap]
I/DEBUG ( 33): beb6cac0 0000063d
I/DEBUG ( 33): beb6cac4 40081841 /system/lib/libdvm.so
I/DEBUG ( 33): beb6cac8 df0027ad
I/DEBUG ( 33): beb6cacc 00000000
I/DEBUG ( 33): #00 beb6cad0 400b3f90 /system/lib/libdvm.so
I/DEBUG ( 33): beb6cad4 0000f9a0 [heap]
I/DEBUG ( 33): beb6cad8 400b3f90 /system/lib/libdvm.so
I/DEBUG ( 33): beb6cadc beb6cb08 [stack]
I/DEBUG ( 33): beb6cae0 41b40710 /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG ( 33): beb6cae4 beb6cb4c [stack]
I/DEBUG ( 33): beb6cae8 00000000
I/DEBUG ( 33): beb6caec fffffe60
I/DEBUG ( 33): beb6caf0 beb6cb98 [stack]
I/DEBUG ( 33): beb6caf4 40034200 /system/lib/libdvm.so
I/DEBUG ( 33): beb6caf8 00000000
I/DEBUG ( 33): beb6cafc beb6cbc8 [stack]
I/DEBUG ( 33): beb6cb00 00000000
I/DEBUG ( 33): beb6cb04 beb6cbd0 [stack]
I/DEBUG ( 33): beb6cb08 00000000
I/DEBUG ( 33): beb6cb0c 00000000
I/DEBUG ( 33): beb6cb10 00000000
I/DEBUG ( 33): beb6cb14 00000000
I/BootReceiver( 77): Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
what could the possible problem be? Is it memory related problems or bug related to JIT code changed?
Thanks
I have changed the structure of the JIT table (pJitEntryTable in /
dalvik/vm/Globals.h) from a chained array(sort of hash) to a
combination of hash table and B-tree. It finds hashed value based on
PC and enters the corresponding JitEntry(dalvik address,translated
address) into the b-tree pointed by the hashed index. I built the code
successfully and pushed libdvm.so file into the emulator and rebooted
the emulator by killing zygote. But the boot screen is showing
"android" for infinite time and when i did a $adb logcat i found the
following log
I/DEBUG ( 33): *** *** *** *** *** *** *** *** *** *** *** ***
*** *** *** ***
I/DEBUG ( 33): Build fingerprint: 'generic/sdk/generic:4.0.3/
MR1/237985:eng/test-keys'
I/DEBUG ( 33): pid: 491, tid: 520 >>> system_server <<<
I/DEBUG ( 33): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault
addr 002e0080
I/DEBUG ( 33): r0 002e0081 r1 4d685228 r2 00000014 r3 002e006d
I/DEBUG ( 33): r4 4d685228 r5 51669e38 r6 001de3b8 r7 000086f4
I/DEBUG ( 33): r8 407d9dc0 r9 00000002 10 00000000 fp 520a0e68
I/DEBUG ( 33): ip 00000030 sp 520a0da0 lr 00000000 pc
002e0080 cpsr 20000030
I/DEBUG ( 33): d0 437000004382353f d1 3ff0000043700000
I/DEBUG ( 33): d2 3ff0000000000000 d3 4197d78400000000
I/DEBUG ( 33): d4 3ff0000000000000 d5 4028000000000000
I/DEBUG ( 33): d6 43e0000000000000 d7 000000f000000000
I/DEBUG ( 33): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 33): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 33): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 33): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 33): scr 80000012
I/DEBUG ( 33):
D/dalvikvm( 491): in getCodeAddrCommon function
D/dalvikvm( 491): searching in the JIT table
I/DEBUG ( 33): #00 pc 002e0080
I/DEBUG ( 33): #01 lr 00000000 <unknown>
I/DEBUG ( 33):
I/DEBUG ( 33): code around pc:
I/DEBUG ( 33): 002e0060 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 002e0070 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 002e0080 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 002e0090 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 002e00a0 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33):
I/DEBUG ( 33): code around lr:
I/DEBUG ( 33): 00000000 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 00000010 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 00000020 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 00000030 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33): 00000040 ffffffff ffffffff ffffffff
ffffffff ................
I/DEBUG ( 33):
I/DEBUG ( 33): memory map around addr 002e0080:
I/DEBUG ( 33): 0000b000-00237000 [heap]
I/DEBUG ( 33): (no map for address)
I/DEBUG ( 33): 10000000-10001000
I/DEBUG ( 33):
I/DEBUG ( 33): stack:
I/DEBUG ( 33): 520a0d60 4d685228 /system/framework/
framework.odex
I/DEBUG ( 33): 520a0d64 00000000
I/DEBUG ( 33): 520a0d68 00000000
I/DEBUG ( 33): 520a0d6c 407d9dc0 /system/lib/libdvm.so
I/DEBUG ( 33): 520a0d70 00000002
I/DEBUG ( 33): 520a0d74 00000000
I/DEBUG ( 33): 520a0d78 520a0e68
I/DEBUG ( 33): 520a0d7c 4083c78b /system/lib/libdvm.so
I/DEBUG ( 33): 520a0d80 4d685228 /system/framework/
framework.odex
I/DEBUG ( 33): 520a0d84 51669e38
I/DEBUG ( 33): 520a0d88 001de3b8 [heap]
I/DEBUG ( 33): 520a0d8c 000086f4 /system/bin/app_process
I/DEBUG ( 33): 520a0d90 407d9dc0 /system/lib/libdvm.so
I/DEBUG ( 33): 520a0d94 4083c7e5 /system/lib/libdvm.so
I/DEBUG ( 33): 520a0d98 df0027ad
I/DEBUG ( 33): 520a0d9c 00000000
I/DEBUG ( 33): #00 520a0da0 00000000
I/DEBUG ( 33): 520a0da4 001de3b8 [heap]
I/DEBUG ( 33): 520a0da8 4086ef90 /system/lib/libdvm.so
I/DEBUG ( 33): 520a0dac 520a0dd8
I/DEBUG ( 33): 520a0db0 44e6bb60 /dev/ashmem/dalvik-
LinearAlloc (deleted)
I/DEBUG ( 33): 520a0db4 520a0e1c
I/DEBUG ( 33): 520a0db8 00000000
I/DEBUG ( 33): 520a0dbc fffffe60
I/DEBUG ( 33): 520a0dc0 520a0e68
I/DEBUG ( 33): 520a0dc4 407ef200 /system/lib/libdvm.so
I/DEBUG ( 33): 520a0dc8 00000000
I/DEBUG ( 33): 520a0dcc 00000000
I/DEBUG ( 33): 520a0dd0 00000000
I/DEBUG ( 33): 520a0dd4 520a0eb8
I/DEBUG ( 33): 520a0dd8 00000000
I/DEBUG ( 33): 520a0ddc 00000000
I/DEBUG ( 33): 520a0de0 00000000
I/DEBUG ( 33): 520a0de4 00000000
I don't understand the error. Do i need to make any adjustments to the
jit code cache size and heap size? Any help regarding this will be
appreciated.
Thanks
This is a segfault crash. Something is trying to access a segment of memory that hasn't been allocated, or it is otherwise not allowed to. This most likely indicates a bug in the libdvm changes that you made.
Debugging will be tricky. What I would try is to build a libdvm_new.so and dalvikvm_new binary that links against it, and push those to a device/emulator (rather than replacing the existing libdvm.so and dalvikvm) and then use gdb-server and gdb to debug dalvikvm_new, on a command line type program (the typical static void main(String[] args) type program).