-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime: signal handling: sighandler crash due to race with signal.Ignore #20748
Comments
If we can fix the |
Ping @bcmills, @ianlancetaylor. |
I don't think I'm going to be able to get to this for 1.10. |
Thanks for the update. Bumping to 1.11. |
How's it going @bcmills? Just a kind ping as we had moved this to Go1.11, perhaps a Go1.12 bump too? |
Sadly, yes. I think at this point in the cycle any attempt to mess with signal handling will introduce more risk than it eliminates. |
In reviewing @ianlancetaylor's CL 46003 (addressing #14571), I noticed what I believe to be a rare race-condition that could result in unexpected termination of a Go program.
I attempted to write a reproducer for the race in question, which would cause the program to erroneously exit if a
_SigKill
or_SigThrow
signal arrives in between a call tosignal.Notify
andsignal.Ignore
for that signal. The symptom I was looking for is a termination with the same signal number (for_SigKill
) or a goroutine dump (for_SigThrow
).Unfortunately, I am unable to reproduce the race in question because the program instead crashes with a
SIGSEGV
inruntime.sigfwd
.sigrace/sigrace.go:
Investigation with GDB gives the following stack trace:
The faulting instruction in
runtime.sigfwd
is theCALL
instruction that invokesfwdSig[sig]
(CC @aclements)
The text was updated successfully, but these errors were encountered: