Hello,
Short update from my side. Another idea that was tested came from
this:
http://android.git.kernel.org/?p=platform/bionic.git;a=blob;f=linker/debugger.c
There is a piece of code that redirects system signals (SIGSEGV and
else) to specific handlers:
void debugger_init()
{
signal(SIGILL, debugger_signal_handler);
signal(SIGABRT, debugger_signal_handler);
signal(SIGBUS, debugger_signal_handler);
signal(SIGFPE, debugger_signal_handler);
signal(SIGSEGV, debugger_signal_handler);
signal(SIGSTKFLT, debugger_signal_handler);
signal(SIGPIPE, debugger_signal_handler);
}
I kind of think that what actually happens and why core dump is not
produced when segmentation fault occurs is because
system does not know about SIGSEGV being sent. I think it is intercept
somehow by Android system and that is why
tombstone is produced instead of classic core dump.
I tried adding this to my native C code:
signal(SIGSEGV, SIG_DFL);
but unfortunately it did not help. If somebody has some knowledge
about Android system managing signals it would be a great help
to share it here.
Oh and one more thing. I modified /proc/sys/kernel/core_pattern for
Android emulator to make core files being produced in /data directory
where writing is available.