-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
runtime: fatal error: MSpanList_Insert stack trace on go get #17570
Comments
CC @aclements @RLH |
I was unable to reproduce this on linux/amd64.
This is really weird. In order this is: span, span.next, span.prev, span.list. But the span pointer looks too low (maybe Darwin mmaps really low?), span.next is clearly nonsense, and span.next should really never be non-nil and span.list is nil. @donrudo, could you paste a few more failures? I want to look for patterns. Assuming the tracebacks are the same, just the first line of the failure is all I need. |
@aclements It does not reproduce it in the same my environment, but
I think the cause is different, but it is similar to first |
No problem, here is a number of logs I created by running this:
|
@zchee, thanks for the pointer. This does appear to be memory corruption, similar to #16570. @donrudo, thanks for the logs. Digging into this more, it looks like Darwin does in fact allocate mspans from very low addresses, so the low span pointer is not a surprise. But if the span.next pointer were actually pointing to a span, it would also be a low value. That means this is almost certainly memory corruption. This is odd, because the mspans are in a very "stable" region of memory compared to the heap (once an mspan is allocated, it never gets freed, so the memory is type-stable) and are nowhere near the Go heap, so a bad heap pointer is unlikely to cause this. They are, however, close to the data segment (global variables) and intermingled with some runtime-internal data structures. Also supporting the memory corruption theory is that one of your logs (xtools-5.log) shows a crash following a pointer in workbuf structure. Also interesting is that the bad span.next value does look like a pointer (it's a "largish" 64-bit number, so it's probably not an int, and it's clearly not byte data). They're also all in roughly the same region: 0x[78]xxxxxxxxxx (even the workbuf crash has a pointer in this region if you undo the lfstack mangling). However, this isn't a Go pointer of any sort; it's nowhere near low enough to point to text, data, or runtime structures, and it doesn't have the right pattern to be a heap or heap bitmap pointer. |
It's not a pointer. It's nanoseconds since roughly 2016-10-25T15:15 UTC. I have no idea what the significance of that epoch is, but the progression of the span.next values in the panics correlates precisely with mtimes of your log files. |
/cc @quentinmit. Random timestamp values corrupting memory on Darwin. Sounds right up your alley. :) |
Are you absolutely sure that the go tool you are running is one built from 1.7.3? Because this is what I would expect to see when running an earlier version of the go tool on Sierra. For example, what does |
This is exactly consistent with using a Go version <1.7. "Nanoseconds since roughly 2016-10-25T15:15" sounds like the value of mach_absolute_time. Sierra started writing the value of @donrudo You said that you are running 1.7.3 from brew, but I noticed that your logs are using Maybe try running something like
to confirm that it's really 1.7.3. |
@quentinmit is right, after running his commands I saw this:
the second After fixing the $GOROOT to make it point to the correct brew install ( sorry for making you lose your time with this. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.7.3 (UPDATE: installed from brew)
What operating system and processor architecture are you using (
go env
)?What did you do?
upgraded to 1.7.3
run any of
What did you expect to see?
I was expecting to be able to setup common tools like
What did you see instead?
Some runs will fail if retried with a similar stack in other tool, until it is able to go through all the tools without errors after some retries like godef, dlv and x/tools; others will keep failing (like gb)
The text was updated successfully, but these errors were encountered: