3

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.

alexgolec
  • 26,898
  • 33
  • 107
  • 159

1 Answers1

3

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.

Ravi
  • 3,718
  • 7
  • 39
  • 57
  • 1
    I've looked into the code, and it's clear that the crash is occurring inside a strlen. That tells me that the application is calling strlen with some sort of invalid parameters, but that's about it. – alexgolec Jun 23 '11 at 17:18
  • There's someone on SO today looking to enable core dumps on Android: http://stackoverflow.com/questions/6458420/how-do-i-make-persistent-changes-to-init-rc. It would be interesting if that works, and gdb could be used to examine the core file. – Ravi Jun 23 '11 at 20:46