Hi, Can someone give me tips about how to debug Dalvik start-up?
I'm trying to attach jdb to the VM as early as I can, to debug some JarVerifier problems on start-up of the Android runtime. But this causes Heisenbergian assertion failures (i.e. that I don't see when not debugging). This is a build of Android for my desktop x86-64 machine running FC13. (Quick summary: I'm resurrecting the "sim" build, for my own sinister purposes that you can ask me about if you like.) If I attach jdb before the InvokeStaticMethod that calls main, it causes an assertion failure. Alternatively, if you can tell why the verification is failing, I can maybe live without being able to attach the debugger early! This is the error I'm trying to debug. W/PackageParser(26345): Exception reading AndroidManifest.xml in /home/ scratch/skell/android-platform-built-gcc/out/host/linux-x86/pr/sim/ system/framework/framework-res.apk: java.lang.SecurityException: /home/ scratch/skell/android-platform-built-gcc/out/host/linux-x86/pr/sim/ system/framework/framework-res.apk failed verification of META-INF/ CERT.SF W/PackageParser(26345): java.lang.SecurityException: /home/scratch/ skell/android-platform-built-gcc/out/host/linux-x86/pr/sim/system/ framework/framework-res.apk failed verification of META-INF/CERT.SF W/PackageParser(26345): at java.util.jar.JarVerifier.failedVerification(JarVerifier.java:135) W/PackageParser(26345): at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:312) W/PackageParser(26345): at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:265) W/PackageParser(26345): at java.util.jar.JarFile.getInputStream(JarFile.java:389) W/PackageParser(26345): at android.content.pm.PackageParser.loadCertificates(PackageParser.java: 343) W/PackageParser(26345): at android.content.pm.PackageParser.collectCertificates(PackageParser.java: 491) W/PackageParser(26345): at com.android.server.PackageManagerService.collectCertificatesLI(PackageManagerService.java: 2570) W/PackageParser(26345): at com.android.server.PackageManagerService.scanPackageLI(PackageManagerService.java: 2656) W/PackageParser(26345): at com.android.server.PackageManagerService.scanDirLI(PackageManagerService.java: 2514) W/PackageParser(26345): at com.android.server.PackageManagerService.<init>(PackageManagerService.java: 930) W/PackageParser(26345): at com.android.server.PackageManagerService.main(PackageManagerService.java: 694) W/PackageParser(26345): at com.android.server.ServerThread.run(SystemServer.java:149) E/PackageParser(26345): Package android has no certificates at entry AndroidManifest.xml; ignoring! W/PackageManager(26345): Failed verifying certificates for package:android If I break the dalvikvm in gdb before it does Check_CallStaticVoidMethodV, then attach jdb and resume both, I get the following. E/dalvikvm(26824): ASSERT FAILED (dalvik/vm/Thread.c:3160): oldStatus ! = THREAD_RUNNING Program received signal SIGSEGV, Segmentation fault. 0x00ad97fb in dvmChangeStatus (self=0x8056820, newStatus=THREAD_RUNNING) at dalvik/vm/Thread.c:3160 3160 assert(oldStatus != THREAD_RUNNING); ... whereas if I step through the main call from gdb, the assertion checks okay. I've tried a few variations on that theme too, attaching the debugger at various points. But they always trigger the assertion failure. It seems like attaching jdb does something to thread statuses that dvmChangeStatus assumes will never happen. This is all on dalvikvm build from the current-ish Android tree (checked out in May) . Thanks for any suggestions! Let me know what extra information I can provide.... Stephen -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting