Open
Description
#!stacks
"runtime.gopanic" &&
"types.(*Checker).handleBailout:+7" &&
/* unfortunately there is no way to express bailout-within-bailout
so we must subtract all other patterns that use bailout */
!("go/types.setDefType:+7") // #71029
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.
func (check *Checker) handleBailout(err *error) {
switch p := recover().(type) {
case nil, bailout:
// normal return or early exit
*err = check.firstErr
default:
// re-panic
panic(p) <-- causes deferred call to check.handleBailout to execute again!
}
}
// Files checks the provided files as part of the checker's package.
func (check *Checker) Files(files []*ast.File) (err error) {
...
defer check.handleBailout(&err) <-- this closure is called repeatedly
check.checkFiles(files)
return
}
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
golang.org/x/tools/[email protected] go1.23.7 darwin/arm64 other (2)
Dups: 5qvnIw UFUvMw
Metadata
Metadata
Assignees
Labels
Issues describing a possible bug in the Go implementation.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.This label describes issues relating to any tools in the x/tools repository.Issues related to the Go compiler and/or runtime.Issues related to the Go language server, gopls."can't happen" gopls crashes (races, unsafe, miscompile, runtime bugs, faulty HW)
Type
Projects
Status
Todo