2012-04-26 10 views
0

我已經將鏈接數組(散列排序)中的JIT表(pJitEntryTable在/ dalvik/vm/Globals.h)中的結構更改爲 組合hash表和B型樹。它根據 PC查找散列值,並將相應的JitEntry(達爾維克地址,轉換爲 地址)輸入到散列索引指向的b樹中。我成功構建了代碼 ,並將libdvm.so文件推入模擬器,並通過殺死zygote來重新啓動模擬器。但開機畫面顯示 「Android」的無限的時間,當我做了$亞行logcat我發現 以下日誌使用新建的libdvm.so重新啓動給出了致命錯誤

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 

回答

1

這是段錯誤崩潰。有些東西試圖訪問尚未分配的內存片段,否則不允許。這很可能表明您所做的libdvm更改中存在一個錯誤。

調試會很棘手。我想嘗試的是構建一個libdvm_new.so和dalvikvm_new二進制文件,並將它們鏈接到設備/模擬器(而不是替換現有的libdvm.so和dalvikvm),然後使用gdb-server和gdb調試dalvikvm_new ,在一個命令行類型程序(典型的靜態void main(String [] args)類型程序)上。

+0

好主意 - 雖然絕大多數DVM進程都是從zygote分離出來的,並自動使用安裝的任何「dvm」,但實際上可以從命令行單獨啓動一個,並進行測試,因爲它會離開其餘的平臺運行在未修改的dvm上。 – 2012-04-26 17:12:04

+0

嗨,感謝您的回覆。我想嘗試這種方法,但我完全不知道gdb的用法,所以請你指點我可以開始的鏈接? – user1262185 2012-04-27 03:49:29

+0

這真的不難找到這個信息。快速搜索導致http://stackoverflow.com/questions/5945086/how-to-debug-an-dalvik-executable-on-android-with-gdb – JesusFreke 2012-04-27 03:54:26

相關問題