-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: "go list std cmd" fault #11105
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
Now I'm wondering if we should delay the introduction of
stack barriers to Go 1.6 instead.
|
My bigger concern is that this might mean we're missing a write barrier in some corner case and stack barriers just make us more sensitive. This is the case, for example, with unbuffered channel sends that write to another G's stack and that G doesn't get scheduled before mark termination, which Russ is going to fix Very Soon. Or it might just be a bug in stack barriers. |
I believe the unmarked object is the backing store of the stk slice in cmd/go/pkg.go:packagesAndErrors. This is a []string (as type importStack), and a pointer to it is passed down to loadPackage and many other functions from there. stk is on packagesAndErrors's stack because it never escapes, but the backing store is in the heap. The only obviously interesting thing that happens to stk is that *importStack has a push method that does an append on the pointed-to slice. But the disassembly of the push method certainly appears to be executing a write barrier when it writes the new backing store through the receiver. Here's a representative checkmarks failure with some annotations:
|
Found it. This is, in fact, a bug I thought I had fixed, but I fixed it wrong. Commit 1303957 was supposed to enable write barriers during the scan phase, but it only enabled calls to the write barrier during the scan phase. The write barrier itself then looked at the phase and bailed out during scan phase. CL coming shortly (assuming I don't lose in-flight wifi again). |
CL https://golang.org/cl/10801 mentions this issue. |
Many of the builders are failing with a fault in go list std cmd such as the one below. I can reproduce this in about 1 in 10 runs with
This appears to be a combination of stack barriers and GOMAXPROCS>1. With GOMAXPROCS=1 or with stack barriers disabled, it doesn't happen.
I think this may be a write through an up-pointer without a write barrier. With the series ending at CL 10791 applied (which fixes checkmarks mode and some bugs in stack barriers), if you set GODEBUG=gccheckmark=1, it quickly fails with a checkmark failure from a slot in the stack that's a fair bit above the next stack barrier for that stack. I confirmed that this is not the known problem with unbuffered channel sends writing to a remote stack.
Annoyingly, I can't reproduce this in my memory tracing Pin tool, so I can't take the brute force approach to finding out what wrote to that stack slot. This also suggests that there may be a race involved that Pin's slow down is preventing.
From http://build.golang.org/log/0641f2eba9b33697d963dd2e22cbffe7a99bcbd4:
/cc @RLH @rsc
The text was updated successfully, but these errors were encountered: