cuplv / TraceRunner

Tool for generating dynamic traces of android applications.
3 stars 0 forks source link

Dex2Oat Exception while running instrumented Oppia-mobile-android app #30

Closed sllam closed 7 years ago

sllam commented 7 years ago

dex2oat exception while running instrumented version of https://github.com/cuplv/callback-verification/tree/tests/tests/realApplications/oppa-mobile-android/bug. Seems to be related to x86 emu. Will try ARM soon.

02-14 14:14:41.282 3182-3182/? W/dex2oat: Unexpected CPU variant for X86 using defaults: x86 02-14 14:14:41.282 3182-3182/? W/dex2oat: Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2) for the command line: 02-14 14:14:41.282 3182-3182/? W/dex2oat: /system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/org.digitalcampus.mobile.learning-1/base.apk --oat-file=/data/dalvik-cache/x86/data@app@org.digitalcampus.mobile.learning-1@base.apk@classes.dex 02-14 14:14:41.282 3182-3182/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/x86/data@app@org.digitalcampus.mobile.learning-1@base.apk@classes.dex: Permission denied 02-14 14:14:41.282 3182-3182/? I/dex2oat: dex2oat took 270.019us (threads: 2) 02-14 14:14:41.283 3167-3167/? W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/org.digitalcampus.mobile.learning-1/base.apk --oat-file=/data/dalvik-cache/x86/data@app@org.digitalcampus.mobile.learning-1@base.apk@classes.dex) because non-0 exit status 02-14 14:14:41.284 3167-3167/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x3c in tid 3167 (mobile.learning) 02-14 14:14:41.297 2293-2704/com.google.android.gms I/Icing: Indexing 488571313E209F9928CBCD1DC1B4381C115F07F5 from com.google.android.googlequicksearchbox 02-14 14:14:41.303 2293-2704/com.google.android.gms I/Icing: Indexing done 69DCEB98D00A18F8E6F09EB26AF8CC4CB01F211C 02-14 14:14:41.307 1545-2673/system_process I/OpenGLRenderer: Initialized EGL, version 1.4 02-14 14:14:41.308 2293-2704/com.google.android.gms I/Icing: Indexing done 488571313E209F9928CBCD1DC1B4381C115F07F5 02-14 14:14:41.387 1231-1231/? A/DEBUG: 02-14 14:14:41.387 1231-1231/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/3393901:userdebug/test-keys' 02-14 14:14:41.387 1231-1231/? A/DEBUG: Revision: '0' 02-14 14:14:41.387 1231-1231/? A/DEBUG: ABI: 'x86' 02-14 14:14:41.387 1231-1231/? A/DEBUG: pid: 3167, tid: 3167, name: mobile.learning >>> org.digitalcampus.mobile.learning <<< 02-14 14:14:41.387 1231-1231/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3c 02-14 14:14:41.388 1231-1231/? A/DEBUG: eax 00000000 ebx b3ffc964 ecx 00000000 edx aa26ce40 02-14 14:14:41.388 1231-1231/? A/DEBUG: esi af76e6b0 edi 00000000 02-14 14:14:41.388 1231-1231/? A/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 00000007 xss 0000007b 02-14 14:14:41.388 1231-1231/? A/DEBUG: eip b3aa45c1 ebp bff7bf88 esp bff7be80 flags 00210286 02-14 14:14:41.389 1231-1231/? A/DEBUG: backtrace: 02-14 14:14:41.389 1231-1231/? A/DEBUG: #00 pc 002045c1 /system/lib/libart.so (art::DexFile::DexFile(unsigned char const, unsigned int, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, unsigned int, art::MemMap, art::OatDexFile const)+111) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #01 pc 0020665f /system/lib/libart.so (art::DexFile::OpenMemory(unsigned char const, unsigned int, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, unsigned int, art::MemMap, art::OatDexFile const, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >)+103) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #02 pc 00207229 /system/lib/libart.so (art::DexFile::Open(art::ZipArchive const&, char const, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, art::DexFile::ZipOpenErrorCode)+233) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #03 pc 002077ec /system/lib/libart.so (art::DexFile::OpenFromZip(art::ZipArchive const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::vector<std::1::unique_ptr<art::DexFile const, std::1::default_delete >, std::1::allocator<std::1::unique_ptr<art::DexFile const, std::1::default_delete > > >)+124) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #04 pc 00207dfb /system/lib/libart.so (art::DexFile::Open(char const, char const, std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::vector<std::1::unique_ptr<art::DexFile const, std::1::default_delete >, std::1::allocator<std::1::unique_ptr<art::DexFile const, std::1::default_delete > > >)+219) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #05 pc 00197688 /system/lib/libart.so (art::ClassLinker::OpenDexFilesFromOat(char const, char const, std::1::vector<std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::allocator<std::__1::basic_string<char, std::1::char_traits, std::1::allocator > > >)+1368) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #06 pc 0045816b /system/lib/libart.so (art::DexFile_openDexFileNative(_JNIEnv, _jclass, _jstring, _jstring*, int)+363) 02-14 14:14:41.389 1231-1231/? A/DEBUG: #07 pc 7249db7a /data/dalvik-cache/x86/system@framework@boot.oat (offset 0x1eb2000) 02-14 14:14:41.549 1231-1231/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_06 02-14 14:14:41.549 1231-1231/? E/DEBUG: AM write failed: Broken pipe 02-14 14:14:41.549 1545-1562/system_process I/BootReceiver: Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE) 02-14 14:14:41.588 1248-1248/? I/Zygote: Process 3167 exited due to signal (11) 02-14 14:14:41.600 1545-2051/system_process I/ActivityManager: Process org.digitalcampus.mobile.learning (pid 3167) has died 02-14 14:14:41.604 3191-3191/? I/art: Not late-enabling -Xcheck:jni (already on) 02-14 14:14:41.616 1545-2051/system_process I/ActivityManager: Start proc 3191:org.digitalcampus.mobile.learning/u0a174 for activity org.digitalcampus.mobile.learning/org.digitalcampus.oppia.activity.StartUpActivity 02-14 14:14:41.656 3206-3206/? W/dex2oat: Unexpected CPU variant for X86 using defaults: x86 02-14 14:14:41.656 3206-3206/? W/dex2oat: Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2) for the command line: 02-14 14:14:41.656 3206-3206/? W/dex2oat: /system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/org.digitalcampus.mobile.learning-1/base.apk --oat-file=/data/dalvik-cache/x86/data@app@org.digitalcampus.mobile.learning-1@base.apk@classes.dex 02-14 14:14:41.656 3206-3206/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/x86/data@app@org.digitalcampus.mobile.learning-1@base.apk@classes.dex: Permission denied 02-14 14:14:41.656 3206-3206/? I/dex2oat: dex2oat took 177.910us (threads: 2) 02-14 14:14:41.657 3191-3191/? W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/org.digitalcampus.mobile.learning-1/base.apk --oat-file=/data/dalvik-cache/x86/data@app@org.digitalcampus.mobile.learning-1@base.apk@classes.dex) because non-0 exit status 02-14 14:14:41.657 3191-3191/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x3c in tid 3191 (mobile.learning) 02-14 14:14:41.763 1231-1231/? A/DEBUG: 02-14 14:14:41.763 1231-1231/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/3393901:userdebug/test-keys' 02-14 14:14:41.763 1231-1231/? A/DEBUG: Revision: '0' 02-14 14:14:41.763 1231-1231/? A/DEBUG: ABI: 'x86' 02-14 14:14:41.763 1231-1231/? A/DEBUG: pid: 3191, tid: 3191, name: mobile.learning >>> org.digitalcampus.mobile.learning <<< 02-14 14:14:41.763 1231-1231/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3c 02-14 14:14:41.765 1231-1231/? A/DEBUG: eax 00000000 ebx b3ffc964 ecx 00000000 edx aa26cf00 02-14 14:14:41.765 1231-1231/? A/DEBUG: esi af76e6b0 edi 00000000 02-14 14:14:41.765 1231-1231/? A/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 00000007 xss 0000007b 02-14 14:14:41.765 1231-1231/? A/DEBUG: eip b3aa45c1 ebp bff7bf88 esp bff7be80 flags 00210286 02-14 14:14:41.766 1231-1231/? A/DEBUG: backtrace: 02-14 14:14:41.766 1231-1231/? A/DEBUG: #00 pc 002045c1 /system/lib/libart.so (art::DexFile::DexFile(unsigned char const*, unsigned int, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, art::MemMap, art::OatDexFile const)+111) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #01 pc 0020665f /system/lib/libart.so (art::DexFile::OpenMemory(unsigned char const*, unsigned int, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, unsigned int, art::MemMap, art::OatDexFile const, std::1::basic_string<char, std::1::char_traits, std::1::allocator >)+103) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #02 pc 00207229 /system/lib/libart.so (art::DexFile::Open(art::ZipArchive const&, char const, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator >, art::DexFile::ZipOpenErrorCode)+233) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #03 pc 002077ec /system/lib/libart.so (art::DexFile::OpenFromZip(art::ZipArchive const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&, std::1::basic_string<char, std::1::char_traits, std::1::allocator >*, std::1::vector<std::__1::unique_ptr<art::DexFile const, std::1::default_delete >, std::1::allocator<std::1::unique_ptr<art::DexFile const, std::1::default_delete > > >)+124) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #04 pc 00207dfb /system/lib/libart.so (art::DexFile::Open(char const, char const*, std::__1::basic_string<char, std::1::char_traits, std::1::allocator >*, std::1::vector<std::1::unique_ptr<art::DexFile const, std::__1::default_delete >, std::1::allocator<std::1::unique_ptr<art::DexFile const, std::__1::default_delete > > >)+219) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #05 pc 00197688 /system/lib/libart.so (art::ClassLinker::OpenDexFilesFromOat(char const, char const*, std::1::vector<std::1::basic_string<char, std::__1::char_traits, std::1::allocator >, std::1::allocator<std::1::basic_string<char, std::__1::char_traits, std::__1::allocator > > >)+1368) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #06 pc 0045816b /system/lib/libart.so (art::DexFile_openDexFileNative(_JNIEnv, _jclass, _jstring, _jstring*, int)+363) 02-14 14:14:41.766 1231-1231/? A/DEBUG: #07 pc 7249db7a /data/dalvik-cache/x86/system@framework@boot.oat (offset 0x1eb2000) 02-14 14:14:41.822 1231-1231/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_07 02-14 14:14:41.822 1231-1231/? E/DEBUG: AM write failed: Broken pipe

sllam commented 7 years ago

Tried it on ARM emulator as well. Can't even install app in ARM, Dex2Oat issue.

sllam commented 7 years ago

Apparently this is an instrumenting issue: I missed this earlier, but the instrumentation failed with the following, even though some apk was written:

Writing APK to: /data/out/oppia-mobile-bug/app-debug.apk do not forget to sign the .apk file with jarsigner and to align it with zipalign org.jf.util.ExceptionWithContext: Unsigned short value out of range: 68570 at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116) at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:329) at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1027) at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:803) at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:252) at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:230) at soot.toDex.DexPrinter.writeTo(DexPrinter.java:251) at soot.toDex.DexPrinter.printApk(DexPrinter.java:192) at soot.toDex.DexPrinter.print(DexPrinter.java:1571) at soot.PackManager.writeOutput(PackManager.java:540) at soot.Main.run(Main.java:273) at soot.Main.main(Main.java:147) at edu.colorad.cs.TraceRunner.TraceRunner$.main(TraceRunner.scala:126) at edu.colorad.cs.TraceRunner.TraceRunner.main(TraceRunner.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.simontuffs.onejar.Boot.run(Boot.java:340) at com.simontuffs.onejar.Boot.main(Boot.java:166)

sllam commented 7 years ago

This is fixed, by instrumenting with the following black list: org.jf.util.:org.joda.time.:org.jarjar.:com.squareup.:org.digitalcampus.oppia.model.:org.apache.http.:okhttp3.internal.:org.apache.:com.splunk.:okhttp3.:com.androidplot.:okio.