I work on an embedded system running on Wind River Linux.
It is a mix of Java and C++ with some JNI for communication between technologies.
We have build custom error handling so that in the event of any unexpected errors we generate backtraces and other information to help us determine the problem.
This error handling is always done by a C++ component that all other components must register with (so that the appropriate signals handlers can be installed).
So in the case of a Java component we use JNI to communicate with the C++ error hander.
Our test program uses 35 different scenario's to test all the various types of errors (out of memory, unhandled exceptions, access violations stackoverflows, etc) This is done for both a single main thread case and background threads.
All tests work properly with the exception of a Stackoverflow caused in a JNI main thread and background thread.
On Linux a Stackoverflow should generate a SIGSEGV and the installed sigaction should be invoked. But instead we are simply terminating, i.e. the handler does not get called.
If instead of generating a stackoverflow, we directly cause a SIGSEGV (signal 11), our signal handler does get invoked properly.
Note that we also do a LD_PRELOAD on the Oracle (Java) provided libjsig.so, this is supposedly required to correctly install custom signal handlers when using JNI (and if not done, other test cases fail).
Strangely, if I run the test without the LD_PRELOAD, the signal handler does get invoked for this case.
Looking for ideas on how to debug or solve this problem