Description
#50936 is a crash due to SIGSEGV while in the SIGPROF signal handler. Since our signal handlers have all signals masked, the SIGSEGV is handled via the default termination action by the kernel, exit via signal 11. This results in no output to stderr at all to aid in debugging.
I think we should try to get a bit more debug info out of such crashes.
One approach may be to unmask some signals during signal handling to detect nested signals. Something like:
func sighandler(...) {
if getg().m.insig {
// Also print critical siginfo details: PC, addr
throw("signal during signal handling")
}
getg().m.insig = true
unblocksig(SIGSEGV, SIGBUS, SIGILL, SIGFPE, etc)
...
// Reset insig, mask (does kernel do this?).
}
This approach keeps all signals masked in the sigaction, which limits the risk of infinite signal recursion. The downside being an extra syscall required in the signal handler.
(Edit: What we should do with C signal handlers is unclear. Do we unmask prior to calling a C signal handler? (I'd lean against this)).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status