0

My android application crashes in my native code with no message whatsoever. One time, by inspecting the code, I've found out that the problem was there was not enough memory. This time by inspecting the code I see nothing. Is there though a common approach for such cases? How should I approach the problem? Sometimes it crashes with 'invalid address at 0xdeadbad' sometimes it prints an (NDK) stack trace but I really don't know what to do with it.

Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158

2 Answers2

1

See How to use addr2line in Android - the answers explain how you make sense of the crash stack trace.

Community
  • 1
  • 1
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
1

Don't rely on reading code to find bugs, it never works. You will end up in changing code that is actually sane, just leading to more bugs...

Use ndk-gdb, it can catch basic problems like SEGFAULT natively without any breakpoint. You have to compile your binaries with debug symbols. Hopefully all the procedure is really simple since the latest releases of the ndk.

Community
  • 1
  • 1
m-ric
  • 5,621
  • 7
  • 38
  • 51