Skip to content

cmd/compile: -l=4 triggers "write barrier prohibited by caller; oneNewExtraM" #22342

@mdempsky

Description

@mdempsky
$ go build -a -gcflags=-l=4 runtime
# runtime
../src/runtime/proc.go:1655:10: write barrier prohibited by caller; oneNewExtraM
        /home/mdempsky/wd/go/src/runtime/proc.go:1618:16: called by newextram
        /home/mdempsky/wd/go/src/runtime/proc.go:1200:11: called by mstart1
        /home/mdempsky/wd/go/src/runtime/proc.go:1170:9: called by mstart

It's complaining about the mp.curg = gp asignment in oneNewExtraM. This is a pointer assignment, and type runtime.g is not labeled go:notinheap.

mstart is labeled go:nowritebarrierrec, and none of mstart1, newextram, or oneNewExtraM are labeled go:yeswritebarrierrec.

I suspect there's also a compiler bug here that this isn't being detected at -l=0, but filing as a runtime bug first for investigation.

/cc @aclements

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions