Skip to content

cmd/compile: add nostackallocvariablemake goexperiment #73253

Closed
@qmuntal

Description

@qmuntal

CL 653856 made small variable-sized make calls to allocate on the stack rather than on the heap. This is causing widespread failures among Windows code using syscall and x/sys/windows, given that it is easy to take wrong assumptions about object lifespans and memory layout. See for example #73199 and #73170.

We will fix the bugs found in the Go standard library and in x/sys/windows, but we don't have enough code coverage to be 100% sure all bugs related to CL 653856 are found and fixed, and we can't control third-party code making wrong assumptions.

We should add a goexperiment setting to disable stack allocated variable-sized make calls to facilitate upgrading to Go 1.25. This setting could be named nostackallocvariablemake..

@randall77 @golang/compiler

Metadata

Metadata

Assignees

Labels

ImplementationIssues describing a semantics-preserving change to the Go implementation.NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.compiler/runtimeIssues related to the Go compiler and/or runtime.release-blocker

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions