-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: deferred function executed multiple times #73267
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
Comments
cc: @golang/runtime |
This stack
|
In triage, @randall77 notes that it looks like the defer isn't properly taken off of the defer list, so it gets run twice. But what's weird is the first time defer is called is as an open-coded defer, and we only create the defer record the second time. |
I looked into this for a while, nothing obvious. All the compiler-generated metadata looks good. My only guess is that a stack copy happens at exactly the wrong time, causing defer selection to fail. But that would, I think, only cause defers to be missed, not duplicated. But who knows. |
I suspect this just another the of many varied symptoms of a single bug causing memory corruption; see label. Unfortunately we haven't been able to (knowingly) reproduce any of them even once. |
This stack
|
Issue created by stacks.
Well this is a weird one. Checker.Files. defers a function to recover from certain expected panics; that function re-panics for all other cases. However, the re-panic causes the deferred function to execute a second time (!). Presumably this means the defer bookkeeping (e.g.
*_panic.deferBitsPtr
) has become corrupted.This stack
k7voyQ
was reported by telemetry:crash/crash
runtime.gopanic:+69
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
go/types.(*Checker).handleBailout:+7
go/types.(*Checker).Files.deferwrap1:+0
runtime.gopanic:+50
Dups: 5qvnIw
The text was updated successfully, but these errors were encountered: