Closed jamiebramwell closed 4 years ago
It doesn't look like either SCR or Axom support signal catching directly, so I think it makes sense to install a simple handler that just calls exitGracefully
for now - once we have SCR integrated we can also have it checkpoint before terminating.
I poked the radiuss people on slack to see if there are any other tools we should be aware of. I doubt it, but I'll let you know if I hear anything.
From @tgamblin on slack: there is libsigsegv — have you looked at that? Problem is that it is GPL. https://www.gnu.org/software/libsigsegv/
Alternately you can just use the backtrace that is in glibc: https://stackoverflow.com/questions/77005/how-to-automatically-generate-a-stacktrace-when-my-program-crashes/77336#77336
https://github.com/LLNL/axom/blob/develop/src/axom/slic/internal/stacktrace.cpp
Axom uses backtrace (and has some windows logic there) to get the stacktraces.
We could still do std::signal
with SIGSEGV
to have slic dump the stack trace before calling exitGracefully
, though this will obviously cause problems if it's slic or exitGracefully
that's segfaulting.
We could still do
std::signal
withSIGSEGV
to have slic dump the stack trace before callingexitGracefully
, though this will obviously cause problems if it's slic orexitGracefully
that's segfaulting.
Who watches the Watchmen?
Using SCR or Sidre or somethine else, we should be able to handle system signals gracefully.