runtime: gcWriteBarrier implementations assume argument slots are immutable #25512
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
gcWriteBarrier
currently promises to preserve all general purpose registers. It does this by saving the general purpose registers to the stack. However it saves its arguments into the argument slots forgcBufFlush
and then restores them from the same slots. This isn't technically correct. As @randall77 mentioned in this post:This should probably be fixed for correctness. We could either mark
gcWriteBarrier
as clobbering its argument registers and then not bothering to restore them at all or we can save them to the stack somewhere else.Examples of unsafe restores:
amd64:
go/src/runtime/asm_amd64.s
Lines 1451 to 1455 in 5776bd5
s390x:
go/src/runtime/asm_s390x.s
Lines 862 to 865 in 5776bd5
The text was updated successfully, but these errors were encountered: