Skip to content
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: panic crash should not show top panic frame #17901

Closed
rsc opened this issue Nov 13, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@rsc
Copy link
Contributor

commented Nov 13, 2016

Here's a trivial crash output:

panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x10c0be0, 0x11468b0)
	/Users/rsc/go/src/runtime/panic.go:531 +0x1cf
main.do(0xc42013f800, 0x4b, 0x80)
	/Users/rsc/src/rsc.io/tmp/diffguess/main.go:76 +0xa66
main.main()
	/Users/rsc/src/rsc.io/tmp/diffguess/main.go:32 +0x203

The first line number is useless. I instinctively clicked on it only to find myself in package runtime instead of my own code.

The crash output is supposed to show only non-runtime code by default. The first frame should be the line that panicked: the panic frame itself should not be shown.

This is a regression introduced when we added panic frames to show executing defers. That's fine to keep, but we don't need and shouldn't show the panic frame when it is the first thing we're going to print in the stack trace.

@rsc rsc added this to the Go1.8Maybe milestone Nov 13, 2016

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2016

/cc @aclements who I think added the panic frames.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2016

Confused me again immediately after filing this bug. Fixed locally and sent CL to stop anyone from duplicating effort. Not sure if there are tests to update or write. Will return to this later.

@gopherbot

This comment has been minimized.

Copy link

commented Nov 13, 2016

CL https://golang.org/cl/33165 mentions this issue.

@quentinmit quentinmit added the NeedsFix label Nov 17, 2016

@gopherbot gopherbot closed this in f9feaff Nov 22, 2016

@golang golang locked and limited conversation to collaborators Nov 22, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.