-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: SIGTRAP or SIGQUIT in TestStress on NetBSD #10027
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
Comments
Odd. I'm at a loss. Looking at the NetBSD kernel sources, the only reasons I can find that i386 would trigger SIGTRAP is when using ptrace() or if the process hits a breakpoint instruction. |
Oh, duh, I think this is the cause: 306 // Cannot grow signal stack. (The stack trace shows asm_386.s:314, because that's the next instruction after the INT.) So somehow NetBSD is running out of stack space in its signal handler? |
I'm still puzzled though. If we were running on m_gsignal, then we should have been running in a signal handler already when we hit INT 3 and triggered the SIGTRAP. However, we mask all signals while handling signals. Also, at least on Linux, if you use INT 3 and have masked SIGTRAP, then the process core dumps immediately. Looking at NetBSD's trapsignal() kernel function, I think they do the same. So the confusing part is, how did we print that SIGTRAP backtrace? |
I don't think that we are running out of stack space. More likely we invoke the handler on a wrong stack. We've seen such crashes when native code calls sigaltstack and resetups signal stack. Check that SP is within gsignal stack at least in the very first function, sigtramp or how it is called. We ought to have such check. |
This still happens with go1.6beta1+ (071fcd1) on both netbsd/386 and netbsd/amd64. |
@mikioh If you can repeat this, can you post the trace back with GOTRACEBACK=2? Thanks. I just ran TestStress 100 times on a netbsd/amd64 AWS system, with no failures. |
@ianlancetaylor, sorry I already dropped netbsd vm for saving storage space on my laptop. |
I recommend to test NetBSD-current, there were incorporated many fixes around ptrace(2) and signal handling. |
@krytarowski Any concrete suggestions for pull-ups for NetBSD 7.1? |
Nothing offhand, I just suggest to check NetBSD-current. |
Fixed by requiring NetBSD 8+ for Go 1.10. Documentation bug is #22911 |
Seen once at:
http://build.golang.org/log/fe7210aa075d8bbd6b4e5e5edf22722f27703d1d
(rev daddeb2 but fixed in the following commit)
/cc @bsiegert @minux @mdempsky
The text was updated successfully, but these errors were encountered: