proposal: cmd/go: allow setting runtime godebugs in go.mod / go:debug directives #71283
Open
Description
Proposal Details
Now asyncpreemptoff=1
cannot be specified by //go:debug
:
examples\test\main.go:1:1: invalid //go:debug: unknown //go:debug setting "asyncpreemptoff"
However, there are many situations where disabling async preemption is required as a workaround to make applications work correctly:
- runtime: async preemption support on ARM64 breaks ARM64 on QEMU #36981
- runtime: hangs on windows with golang >= 1.14 #48059
- cmd/cgo: does not compile for iOS simulator arm64 #57442
- runtime: rare stack corruption on Go 1.20 and later #64781
- runtime: stalls under Rosetta2 with MacOS 14.5 #68485
- runtime: a Windows application launched via Steam sometimes freezes #71242
- terraform destroy command is not working and seems to be hanging on Mac OS Big Sur hashicorp/terraform#27350
I propose to enable to specify asyncpreemptoff=1
as //go:debug
and godebug
section in go.mod.
Note that it is still possible to specify it by -ldflags="-X=runtime.godebugDefault=asyncpreemptoff=1"
, but this is pretty hacky.
Metadata
Assignees
Type
Projects
Status
Incoming