user1262185
user1262185

Reputation: 81

reboot using newly built libdvm.so gives fatal error

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

Upvotes: 0

Views: 1203

Answers (1)

JesusFreke
JesusFreke

Reputation: 20282

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).

Upvotes: 1

Related Questions