cmd/compile: 32-bit random data corruption #43570
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
I can reproduce on 386.
Looks like something is getting clobbered. If I print out the good and bad time structs in hex, I get
The first 2 words there are valid pointers to the heap. Not sure about the 3rd one.
I think this only happens on 32-bit because on 32-bit the
I belive the bad code is in
I think I see the problem. We have (irrelevant code elided):
That's all fine. But then we run the
Which basically says, if you're moving from
After the opt pass, we have the same code, except v60 copies from v53 instead of v15. Which is bad, because that source is the volatile memory area. It's only a problem if there is an intervening call. In this case there is one, but only if the write barrier is enabled. So the corruption doesn't happen until the write barrier is turned on. (The write barrier replaces v54 with a bunch of code that may call
I think the right fix is to add an extra condition to the move optimization rule to disable it if the source is a volatile region.
to tiptoe around golang/go#43570 for #97685 Kubernetes-commit: 611184aa59d0cd40466bc3bc4b40a3712a038171
to tiptoe around golang/go#43570 for #97685 Kubernetes-commit: d8a1dfb21f1f78595d1aaf9985eb58ee50edc940
to tiptoe around golang/go#43570 for #97685 Kubernetes-commit: f393cb405bd04b9bcc014b7852e8c76ee90eb418