Skip to content
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: segfault in mallocgc (atomic.Casuintptr call in unlock) #17796

Closed
mlsteele opened this issue Nov 4, 2016 · 8 comments
Closed

runtime: segfault in mallocgc (atomic.Casuintptr call in unlock) #17796

mlsteele opened this issue Nov 4, 2016 · 8 comments

Comments

@mlsteele
Copy link

mlsteele commented Nov 4, 2016

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

$ go version
go version go1.7.3 darwin/amd64

What operating system and processor architecture are you using (go env)?

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/miles/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.3/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0x/18x_s4fd2tz_mk8j_03v9n_00000gn/T/go-build880909405=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

Ran go guru via go-guru-describe in emacs.

What did you expect to see?

not a panic

What did you see instead?

a panic

https://gist.github.com/mlsteele/caa4e523c4dc0aa77588854bc4f9f74a#file-panic-log

(sorry about the numerous edits of this post, accidentally ctrl+enter'd early)

@ianlancetaylor
Copy link
Contributor

CC @alandonovan

@alandonovan
Copy link
Contributor

This is a segfault in mallocgc, not a bug in guru itself.

Which revision of Go are you using exactly? go version says 1.7.3 but your filenames say 1.6.3, and the line numbers suggest a third revision.

Is it deterministic?

@alandonovan alandonovan changed the title Panic in go guru runtime: segfault in mallocgc (atomic.Casuintptr call in unlock) Nov 4, 2016
@mlsteele
Copy link
Author

mlsteele commented Nov 4, 2016

Wow that's unsettling. I installed Go via homebrew months ago, upgraded via homebrew some weeks ago, and recently upgraded to OSX Sierra.

From my shell it's consistently 1.7.3.

$ go version
go version go1.7.3 darwin/amd64
$ ls /usr/local/Cellar/go
1.6.3  1.7  1.7.3

I agree those filenames say 1.6.3. Not sure what to tell you. The panic seems to occur mostly on invalid identifiers. There may be a concurrent go install happening using the source files I'm guru-ing on also.

@mlsteele
Copy link
Author

mlsteele commented Nov 4, 2016

In case it helps I'm using this version of go-guru for emacs /Users/miles/.emacs.d/elpa/go-guru-20160715.854. emacs package src

@mlsteele
Copy link
Author

mlsteele commented Nov 4, 2016

I wouldn't be surprised if my guru executable was built with 1.6.3. Not sure how to tell. I suspect rebuilding it would make this issue go away, not sure if that's what you want.

@alandonovan
Copy link
Contributor

Rebuilding guru with 1.7.3 would likely make this problem disappear. However, it is a valid bug report against the Go 1.6.3. runtime's mallocgc function.

@mlsteele
Copy link
Author

mlsteele commented Nov 4, 2016

Alright well let me know if you'd like anything else for me, otherwise I'll rebuild my guru tomorrow.

@aclements
Copy link
Member

However, it is a valid bug report against the Go 1.6.3. runtime's mallocgc function.

While true, 1.6.3 is no longer supported. I did dig into this a bit in case it was something that still affected 1.7 or master. Unfortunately, it's clearly memory corruption since something overwrote the global runtime.mheap_.lock field with a bad value. This means it's both very hard to debug (the traceback certainly isn't enough to debug it) and very hard to tell if we've fixed since 1.6.3 (and it's likely we have).

Given all of this, I think you should go ahead and rebuild guru and I'm going to close this issue. Obviously, if it continues to happen, we can reopen it. :)

@golang golang locked and limited conversation to collaborators Nov 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants