DynamoRIO/drmemory

add support for running Java Android applications

Open

#1 881 ouverte le 10 avr. 2016

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)C (289 forks)auto 404
Bug-AppCrashOpSys-ARMOpSys-Androidhelp wanted

Métriques du dépôt

Stars
 (2 727 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

We have now fixed configuration issues (#1857) and several other issues in DynamoRIO (DynamoRIO/dynamorio#1912) and can now run at least the calculator app under plain DR.

However, running it under Dr. Memory still hits some problems.

One is #1880, which I have a fix for.

Another is an mmap conflict, which I am presumably fixing by moving the preferred base:

04-07 00:53:04.587 28591 28591 W art     : Failed to open oat file '/data/dalvik-cache/arm/system@framework@boot.oat' referenced from image /data/dalvik-cache/arm/system@framework@boot.art: Failed to allocate ElfFile reservation for /data/dalvik-cache/arm/system@framework@boot.oat: Failed to mmap at expected address, mapped at 0xb125e000 instead of 0x7138e000 : Requested region 0x7138e000-0x74953000 overlaps with existing map 0x73800000-0x739ca000 (/data/local/tmp/build_DRtoo_android_dbg/bin/debug/libdrmemorylib.so)

After fixing those, I'm seeing strange kernel crashes when I run calc under DrM and it's not clear exactly why.

If I run with -leaks_only -no_count_leaks -no_track_allocs we hit an app crash:

04-07 12:01:02.273 13909 13909 F libc    : Fatal signal 11 (SIGSEGV) in tid 13909 (oid.calculator2)
04-07 12:01:02.328   194   194 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-07 12:01:02.328   194   194 F DEBUG   : Build fingerprint: 'google/razor/flo:6.0/MASTER/2713960:userdebug/dev-keys'
04-07 12:01:02.328   194   194 F DEBUG   : Revision: '0'
04-07 12:01:02.329   194   194 F DEBUG   : ABI: 'arm'
04-07 12:01:02.329   194   194 F DEBUG   : pid: 13909, tid: 13909, name: oid.calculator2  >>> com.android.calculator2 <<<
04-07 12:01:02.329 10989 11193 W NativeCrashListener: Couldn't find ProcessRecord for pid 13909
04-07 12:01:02.329   194   194 F DEBUG   : signal 11 (SIGSEGV), code 0 (SI_USER), fault addr 0x9c
04-07 12:01:02.344   194   194 F DEBUG   : Abort message: 'art/runtime/gc/heap.cc:336] Check failed: main_mem_map_2.get() != nullptr Failed anonymous mmap(0x0, 536870912, 0x3, 0x2, 12, 0): Out of memory. See process maps in the log.'
04-07 12:01:02.345   194   194 E DEBUG   : AM write failed: Broken pipe
04-07 12:01:02.345   194   194 F DEBUG   :     r0 00000000  r1 00000010  r2 0000000a  r3 b4bf8bf8
04-07 12:01:02.345   194   194 F DEBUG   :     r4 00000000  r5 b4bfc928  r6 00000000  r7 beffdd2c
04-07 12:01:02.345   194   194 F DEBUG   :     r8 fffff7dc  r9 fffff7d0  sl beffdcf8  fp beffdcfc
04-07 12:01:02.345   194   194 F DEBUG   :     ip 00000000  sp beffdc68  lr b4889c89  pc b4af0f2e  cpsr 40000030
04-07 12:01:02.368   194   194 F DEBUG   : 
04-07 12:01:02.368   194   194 F DEBUG   : backtrace:
04-07 12:01:02.368   194   194 F DEBUG   :     #00 pc 00359f2e  /system/lib/libart.so (_ZN3art14DumpCheckpoint3RunEPNS_6ThreadE+205)
04-07 12:01:02.368   194   194 F DEBUG   :     #01 pc 0035abd9  /system/lib/libart.so (_ZN3art10ThreadList13RunCheckpointEPNS_7ClosureE+212)
04-07 12:01:02.368   194   194 F DEBUG   :     #02 pc 0035b107  /system/lib/libart.so (_ZN3art10ThreadList4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+142)
04-07 12:01:02.368   194   194 F DEBUG   :     #03 pc 00333995  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+424)
04-07 12:01:02.368   194   194 F DEBUG   :     #04 pc 000f45fb  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2226)
04-07 12:01:02.368   194   194 F DEBUG   :     #05 pc 001b58cf  /system/lib/libart.so (_ZN3art2gc4HeapC1EjjjjddjjRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS_14InstructionSetENS0_13CollectorTypeESC_NS0_5space20LargeObjectSpaceTypeEjjjbjjbbbbbbbbbby+4334)
04-07 12:01:02.368   194   194 F DEBUG   :     #06 pc 00336c57  /system/lib/libart.so (_ZN3art7Runtime4InitERKNSt3__16vectorINS1_4pairINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKvEENS7_ISC_EEEEb+3862)
04-07 12:01:02.368   194   194 F DEBUG   :     #07 pc 00338c45  /system/lib/libart.so (_ZN3art7Runtime6CreateERKNSt3__16vectorINS1_4pairINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPKvEENS7_ISC_EEEEb+596)
04-07 12:01:02.368   194   194 F DEBUG   :     #08 pc 0025bf97  /system/lib/libart.so (JNI_CreateJavaVM+542)
04-07 12:01:02.368   194   194 F DEBUG   :     #09 pc 0006006b  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime7startVmEPP7_JavaVMPP7_JNIEnvb+2358)
04-07 12:01:02.368   194   194 F DEBUG   :     #10 pc 0006044f  /system/lib/libandroid_runtime.so (_ZN7android14AndroidRuntime5startEPKcRKNS_6VectorINS_7String8EEEb+250)
04-07 12:01:02.368   194   194 F DEBUG   :     #11 pc 00001721  /system/bin/app_process32
04-07 12:01:02.368   194   194 F DEBUG   :     #12 pc 00017359  /system/lib/libc.so (__libc_init+44)
04-07 12:01:02.368   194   194 F DEBUG   :     #13 pc 00001868  /system/bin/app_process32
04-07 12:01:02.940   194   194 F DEBUG   : 
04-07 12:01:02.940   194   194 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_05
04-07 12:01:02.941 10989 11021 I BootReceiver: Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
04-07 12:01:02.958 13907 13907 I wrap.sh : <Application /system/bin/app_process32 (13909).  Dr. Memory internal crash at PC 0xb4af0f2e.  Please report this at http://drmemory.org/issues.  Program aborted.
04-07 12:01:02.958 13907 13907 I wrap.sh : Received SIGSEGV atunknown pc 0xb4af0f2e in thread 13909
04-07 12:01:02.958 13907 13907 I wrap.sh : Base: 0x2a000000
04-07 12:01:02.958 13907 13907 I wrap.sh : Registers:  r0 =0x00000000 r1 =0x00000010 r2 =0x0000000a r3 =0xb4bf8bf8
04-07 12:01:02.958 13907 13907 I wrap.sh :      r4 =0x00000000 r5 =0xb4bfc928 r6 =0x00000000 r7 =0xbeffdd2c
04-07 12:01:02.958 13907 13907 I wrap.sh :      r8 =0xfffff7dc r9 =0
04-07 12:01:02.958 13907 13907 I wrap.sh : 1.10.16898-1-(Apr  7 2016 11:46:50)0
04-07 12:01:02.958 13907 13907 I wrap.sh : -no_dynamic_options -disasm_mask 8 -logdir '/data/data/com.android.calculator2/Dr. Memory/dynamorio' -client_lib '/data/local/tmp/build_DRtoo_android_rel/bin/release/libdrmemorylib.so;0;`-leaks_only` `-no_count_leaks` `-no_track_allocs` -logdir `/data/data/com.android.calculator2/Dr. Memory` -symcache_dir `/data/data/com
04-07 12:01:02.958 13907 13907 I wrap.sh : 0xbeffdcfc 0x00000000
04-07 12:01:02.958 13907 13907 I wrap.sh : 0xb6ce4850 0x00000015
04-07 12:01:02.958 13907 13907 I wrap.sh : 0xb6ce0b88 0xb6cbc2d1
04-07 12:01:02.958 13907 13907 I wrap.sh : 0xb6cbc279 0x25481246>
04-07 12:01:02.965 13907 13907 I wrap.sh : wrap.sh terminated by exit(255)
04-07 12:01:02.967 10767 10767 W Zygote  : Error reading pid from wrapped process, child may have died
04-07 12:01:02.967 10767 10767 W Zygote  : java.io.EOFException

This is where I'm having to leave this until I get more time. Hopefully others can try running some small apps and help contribute to figuring out what the problems are.

Guide contributeur