runtime: poor error message for Goexit on C-created thread #68275
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Go version
tip
Output of
go env
in your module/workspace:What did you do?
What did you see happen?
Note that this error was improved a bit recently in https://go.dev/cl/583675. In 1.22, the error is
What did you expect to see?
A more clear description of the problem.
The problem here is that it is not valid to call
runtime.Goexit
in a cgo callback from C to Go on a C-created thread. I think that restriction is fine (it is unclear what Goexit should do if we were to allow it), but the error message here should be more clear.I think with an additional
mp.isextra
check ingdestroy
we could be more explicit about what the user did wrong.We should also update the
runtime.Goexit
docs to mention this case.The text was updated successfully, but these errors were encountered: