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: recover does not correctly recover from panic #43921

Closed
mdempsky opened this issue Jan 26, 2021 · 2 comments
Closed

runtime: recover does not correctly recover from panic #43921

mdempsky opened this issue Jan 26, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Jan 26, 2021

This program should exit normally, but it currently exits with a panic: https://play.golang.org/p/XnJ41HvD9Gw

It exits normally when compiled with gccgo or with -gcflags=-N. Notably, it does not crash with the alternative code I suggested at https://go-review.googlesource.com/c/go/+/286712/1/src/runtime/panic.go#1038. (Discovered this by accident while trying to test gccgo instead and happened to still have that test code patched into my local tree.)

/cc @danscales @randall77

@danscales danscales self-assigned this Jan 27, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Jan 27, 2021

Change https://golang.org/cl/286712 mentions this issue: runtime: make sure to remove open-coded defer entries in all cases after a recover

@danscales
Copy link

@danscales danscales commented Jan 27, 2021

Thanks for the test case @mdempsky . I fixed this bug and added your test case to https://golang.org/cl/286712 . I didn't fix the other bug that you filed -- that looks more complex to fix. But I think we can just go with cl/286712 for the immediate Go 1.16 release (if reviewers are happy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants