-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime, mime/quotedprintable: possible memory corruption #11084
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
I am pretty sure (based on git bisect) that the bug was exposed by changing default GOMAXPROCS to NumCPU() It looks like |
The CL where GOMAXPROCS gets set to NumCPU() is unlikely to be the problem. But it might've exposed an existing bug and made it occur more easily. |
Possibly related (doesn't happen every time):
|
@rsc and I are pretty sure we've found the problem. This test creates a map and a map bucket on the stack. When map assignment happens, writes are being done in the runtime map code to a higher stack frame using typedmemmove. This typedmemmove doesn't generate write barriers because the destination is on the stack. But this violates the assumption made by stack barriers that pointer writes to higher stack frames will always have write barriers. If these updated pointers are above the next stack barrier, then the stack rescan won't see them and the garbage collector will collect them. I'm working on a fix to make typedmemmove detect when its argument is on the stack and remove any stack barriers below (hence forcing the stack re-scan to re-scan what's being updated). The alternative would be to make typedmemmove generate write barriers for stack writes, but this is complicated because we may not have a GC bitmap in this case. |
CL https://golang.org/cl/10791 mentions this issue. |
Using tip (bbc4351):
The following failure happens fairly consistently (but not every time):
The text was updated successfully, but these errors were encountered: