-
Notifications
You must be signed in to change notification settings - Fork 18k
Go process receiving SIGABRT or SIGSEGV signals is exiting with 2 exit status #72084
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
Labels
BugReport
Issues describing a possible bug in the Go implementation.
Comments
This is a documented behaviour of the runtime package (exit 2 on crash). |
Well even though that's documented I feel that's wrong and a bug to be planned. And at least an env variable should be provided to define the exit code, given that |
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 3, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 3, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 3, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 3, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 3, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
Unfortunately I don't think we can change this behavior now. |
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 12, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 12, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
3v1n0
added a commit
to 3v1n0/authd
that referenced
this issue
Mar 12, 2025
Sadly some signals such as SIGABRT or SIGSEGV are handled by go and in the wrong way because it never redirects them as expected, so in such cases we just fail with a normal exit error instead of because of a signal. Reported this upstream and adding comments about. See: golang/go#72084
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Go version
go1.23.6
Output of
go env
in your module/workspace:What did you do?
Having a simple go process around and signaling it (or itself) with
SIGSEGV
orSIGABRT
makes the process to show the trace and then exit2
exit status, instead of with the right signal exit code.Or similar using:
What did you see happen?
While having the trace can be useful, the process should then consistently exit in the same way it has been stopped, by calling the default handler for such signals.
In fact calling a go process from another C process, and doing
For a go process that gets signaled we receive:
And this is wrong because it makes impossible for the calling process to figure out what's the reason for the process being stopped (and react accordingly).
What did you expect to see?
The calling process should instead print
Waiting pid 277520, returned 277520, exited: 0, signaled: 1
andWTERMSIG
should provide the signal information.This works well in fact when using
SIGKILL
or other signals that aren't handled by go by default.The text was updated successfully, but these errors were encountered: