-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: bad compilation #15854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
GOSSAHASH says it is an init function that is bad. There are 11 of them :( Maybe time to add the package name to the thing GOSSAHASH checks... |
Looks like the write barrier is wrong for the store to the global. It's storing junk instead of the result of the New("ID") call.
The result of the New is 16 bytes big and at 16(SP) right after the call. When we branch to the write barrier, it sets up the call to typedmemmove. To do that, it needs to write 24 bytes of arguments. The last 8 of those overwrite the result of New (and hence clobber the string pointer). The result of New must be moved out of the return args section before the call to typedmemmove. |
CL https://golang.org/cl/23522 mentions this issue. |
When run, it often (with GOGC=1) prints the "bad" message and has varying junk for the string contents (but the length is always right).
The bug goes away with -gcflags=-ssa=0
@dsnet
The text was updated successfully, but these errors were encountered: