cmd/cgo: compiler stack overflow on exported function referencing an invalid recursive type #69176
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Milestone
Go version
go version go1.23.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
The Go compiler reports an error if you try to define a type recursively. For example, if you
go build example.go
the following:... you will see:
However, if you compile a cgo module with an invalid recursive type, but that type is used in an exported function, the compiler will crash with a stack overflow.
Example
crash.go
:What did you see happen?
What did you expect to see?
I would have expected to see the same error as the non-cgo case:
The text was updated successfully, but these errors were encountered: