Description
When first SIGABRT is sent to .net process (kill -SIGABRT $PID
) process continues execution. Process only aborts after the second one.
This happens because currently SIGABRT handler passes signalRestarts=true
to invoke_previous_action
:
runtime/src/coreclr/pal/src/exception/signal.cpp
Lines 696 to 699 in a767111
And invoke_previous_action
simply resets signal handler to previous one without aborting:
runtime/src/coreclr/pal/src/exception/signal.cpp
Lines 389 to 406 in a767111
It seems that currently runtime only handles the case of abort()
, which raises SIGABRT second time when there's non-default signal handler. However, shouldn't runtime abort on the first SIGABRT received?
This can be achieved with:
static void sigabrt_handler(int code, siginfo_t *siginfo, void *context)
{
invoke_previous_action(&g_previous_sigabrt, code, siginfo, context, false);
}