-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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: Mac OS High Sierra / XCode 9 native go executable gets "Segmentation fault: 11" #22059
Comments
What program are you running? What is the complete output? |
It's a program a friend of mine wrote to simplify some of my calculation needs from the command line. I don't have the source. It just stopped working after I upgraded to High Sierra and Segmentation fault: 11 is all I get. Any way I can run with debug mode on it so I can see where it fails? |
There is no separate debug mode, but you could run it under the debugger (gdb or lldb). It's hard to understand why the program would display only "Segmentation fault: 11". Go programs install a signal handler that catches signals and reports them. Does this program use cgo at all? Otherwise the only possibility I can think of would be that the signal handler itself is receiving a signal, which obviously shouldn't happen. The debugger might show that. |
I ran it using lldb and got this: If it's a native go executable on Mac OS High Sierra I am assuming it uses cgo. Can you recommend a signal handler to use and I can see if I can get any more info on this. Cheers |
The Go runtime installs its own signal handler, there isn't any meaningful way to install a different signal handler. It would be interesting to find out whether this crash occurs before the Go signal handler is installed, or whether it occurs while executing within the Go signal handler. The Go signal handler should certainly never call |
@ianlancetaylor Hello! I don't have a computer running High Sierra right now, but I did receive two reports of a Go program I help maintain failing with this same symptom on High Sierra: awslabs/amazon-ecr-credential-helper#69 and awslabs/amazon-ecr-credential-helper#70. You might be able to use https://github.com/awslabs/amazon-ecr-credential-helper to help debug. |
@samuelkarp can you provide more details? I don't know what your program does, how to use it, and what environment it needs. I can't help debugging if I can't reproduce the bug. Can you work with your reporters to provide instructions for a reproducible environment that shows the bug? |
I had the same thing happen to me. FWIW, it was tj/robo built from source using |
@rasky From the reports I received, I think it's sufficient to compile it on an older macOS release (or cross-compile from Linux) and then attempt to invoke the program. If you invoke it without arguments or any input to stdin, it should just print out a help message and exit with exit code 1. |
Re-installing Go from package at https://golang.org/dl/ did the trick for me. |
Still an issue for me. No progress on my end. |
Ok,I also meet this question and it was resolved! |
Thanks for the reports, everyone, but we need more information to debug this. It sounds like everyone has been able to get their binaries working by recompiling with a more recent toolchain (e.g., 1.9). That might mean there's nothing we can really do about this, but I'd like to confirm that. Has anyone experienced this crash with a binary that was definitely built with 1.9 (or master)? For anyone who still has a crashing binary around, I'd like to know what Go version it was compiled with. To find out, run |
I'm trying to get goversion installed on Mac but can't seem to find where it is installed after executing your command. Eager to help. |
It will be installed to $GOPATH/bin/goversion (assuming that GOPATH
contains a single path element, otherwise it will be in the first element
of GOPATH/bin)
…On Wed, Dec 6, 2017 at 2:10 PM, Bjorn Harvold ***@***.***> wrote:
I'm trying to get goversion installed on Mac but can't seem to find where
it is installed after executing your command. Eager to help.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#22059 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA5OH3EtIlGd4dj8BOwKnIc7QxBD1ks5s9gWUgaJpZM4PlJGh>
.
|
Thank you for that. The app that is not working for me was compiled with Go v1.6.2. I'm assuming I have to contact the developer of this program to recompile the binary with a newer version of Go? Can we safely say that Go v1.6.2 is not supported on High Sierra? |
Yup, Go 1.6.2 is neither supported on High Sierra, or a supported release,
https://github.com/golang/go/wiki/Go-Release-Cycle#release-maintenance
The developer should upgrade to at least Go 1.8, bit given the pace apple
likes to break backwards compat with their own syscall ABI, i'd recommend
the latest 1.9 relaese.
…On Wed, Dec 6, 2017 at 4:17 PM, Bjorn Harvold ***@***.***> wrote:
Thank you for that. The app that is not working for me was compiled with
Go v1.6.2. I'm assuming I have to contact the developer of this program to
recompile the binary with a newer version of Go? Can we safely say that Go
v1.6.2 is not supported on High Sierra?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#22059 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA79wLeeMwZ4cmC0anesZWOQAd2Eqks5s9iNtgaJpZM4PlJGh>
.
|
Thanks Dave :-) |
Thanks! For reference, the issue about improved forward-compatibility on macOS is #17490. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.9 on command line but don't know what xcode command line tools uses
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Mac OS High Sierra
What did you do?
Trying to execute a native go binary from Terminal
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
Random string output as it did before I upgraded to High Sierra
What did you see instead?
Segmentation fault: 11
The text was updated successfully, but these errors were encountered: