Skip to content

runtime: wrong Unix error code from panic. #24284

Open
@robpike

Description

@robpike

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

% cat p.go
package main

func main() {
	panic(3)
}
% ./p
panic: 3

goroutine 1 [running]:
main.main()
	/Users/r/p.go:4 +0x39
% echo $?
2
% 

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.early-in-cycleA change that should be done early in the 3 month dev cycle.

    Type

    No type

    Projects

    Status

    Triage Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions