How to figure out the reason of a SIGSEGV in Android How to figure out the reason of a SIGSEGV in Android android android

How to figure out the reason of a SIGSEGV in Android


"I have only one native function and it isn't the problem because it's called once during startup and the problem happens 2-3 minutes later."

Bzzzztt! Wrong. It's entirely possible to trash memory in one place .... then fail when you try to access the (now corrupt) memory in a completely different part of the program.

I assume you're using the NDK.

Suggestions:

1) put "sentinel" values around any global memory or malloc'ed buffer.

2) Carefully double-check all your "malloc()'s" ("deadbaad" sounds suspiciously like something that's been allocated from the heap)

3) Look here for tips on using ndk-gdb:

PS:

Is your native code C or C++?