androidlinux-kernelkernel

How can I make android print out core dumps for crashing system applications?


I'M writing some stuff in the wonderful world of system libraries, and I'm getting crashes in libc, which my library is apparently passing bad values.

Is there any way that I can have Android generate a core dump for the crashing application so I can decompose the application stack?

Im particular, I'm causing system_server to crash, if that helps.

EDIT: The gist of my problem is this: When the application crashes within a library like libc, then the tombstone that gets output shows a stack trace within libc. If I had a full stack trace, then I could debug the entire application.


Solution

  • I assume you're writing NDK (C/C++) code? If so, check your logcat output for a stack trace. If you have the corresponding debug so file, you can run it through a stack trace tool such as: http://code.google.com/p/android-ndk-stacktrace-analyzer/wiki/Usage.

    The logcat traces are saved in Tombstones, see this post: http://crazydaks.com/debugging-in-android-with-tombstones.html.

    For crashes within libc.so, you can try running arm-eabi-objdump and arm-eabi-addr2line against the so, and compare addresses to see where the crash occurred.