java-smt
java-smt copied to clipboard
Evaluate catching SIGSEGV from JNI
This is not a critical feature, but apparently it's possible. See:
http://blog.httrack.com/blog/2013/08/23/catching-posix-signals-on-android/ https://github.com/xroche/coffeecatch
It is indeed possible to catch (most) SigSegv, on Unix even with error-trace. There are 2 main Problems though:
-
You have to wrap every single method with the construct (Possible in our Boolector JNI wrapper for example. But not in our current Z3 binaries)
-
Because the coffeecatch wrapper (as does any other wrapper of this kind by nature) uses not async-signal-safe methods there could (and will) be unforseen behavior in the code. Especially if threads (Z3?) are used! (Deadlocks etc.)
I don't think its a good idea to use this wrapper per default to catch SigSegvs, however it may be a useful tool to find problems (like the MathSat5 Sigsegv).