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: wrong Unix error code from panic. #24284
Comments
or simply 1 meaning 'general error' ? |
As has been pointed out in the mail thread, it might be best to leave this alone and say that the error that triggered this is in a program that takes exit code 2 as 'success'. That is certainly nonstandard. |
Sure, although a note in the language spec might avoid some similar confusion in the future.. I'll open an issue with Supervisor (http://supervisord.org/) |
/cc @aclements |
E-mail thread is at https://groups.google.com/d/msg/golang-nuts/u9NgKibJsKI/XxCdDihFDAAJ . |
Thanks! |
How's it going @cachvico? Any news from filing the bug with Supervisord? @ianlancetaylor sure let's document in the spec that a panic returns a non-zero code to the shell. |
Thanks - note that the Supervisord issue should be fixed on their side as per the above linked issue. |
Exit status 127 is used by the shell to indicate "command not found." If a C++ program exits due to an uncaught If a Python program exits due to raising an exception, it exits with status 1. I think we should change an unrecovered |
The quickest solution to the original problem would simply be a correction to the spec at https://golang.org/pkg/builtin/#panic I've submitted a change at https://go-review.googlesource.com/c/go/+/167709 - is this correct? |
Beg pardon - just realised the previous post said not to document the value explicitly. May I make the change suggested by @ianlancetaylor to change the process exit code 2 to 1, and correct my change to the comment appropriately? This would involve an edit to |
Thanks for submitting the change @cachvico! I've posted some comments on it.
Oh yes you can, all yours but we can review and submit those changes piece-meal/independent of the docs update. |
@ianlancetaylor Note that only values greater than 128 are used by the shell to indicate exiting due to a signal. Some documents indicate that 128 is used to indicate an invalid argument to shell builtin |
@Gnouc Thanks for the correction. |
Docs updated in f947c4d to reflect the behaviour of Thanks all! |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +baf3eb1625 Tue Mar 6 01:11:26 2018 +0000 darwin/amd64
Exit code 2 traditionally means 'incorrect arguments', as in flag.Usage.
Panic should be something like 127 or 255 on Unix.
Reported by darren.e.grant@gmail.com on nuts.
The text was updated successfully, but these errors were encountered: