-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: re-enable GOTRACEBACK=crash on macOS #59446
Comments
I agree |
The comment seems reasonably explanatory. At the time that the comment was written, dumping core on an amd64 running macOS generated a truly gigantic file. Doing that would serve nobody well. Perhaps macOS has changed since then. |
That is to say: somebody with a Mac should check whether the comment is still true. Thanks. |
Yes, the source code comment is quite clear. My point (which I didn't make crystal clear) is that the documentation of
I verified that on macOS 13.2 (Ventura) on Apple Silicon (specifically an Apple M1 Max server) it is not a problem to generate core dumps from a Go binary. The core dump is a reasonable size (comparable to any I generate from a program written in C). Note that I had to follow the directions I found at https://developer.apple.com/forums/thread/694233. Specifically, how to self-sign a Go binary so that the OS would generate a core dump from it. It appears the code signing requirements goes back to macOS 12 (Monterey), if not farther back. I'll check whether it is still an issue on my older MacBook Pro (which I think is running macOS 12 and using the amd64 architecture). The question then becomes what to do if it isn't an issue on that relatively new macOS release but is still a problem on older macOS releases supported by Go? My vote is to remove the restriction since core dumps are disabled by default and anyone enabling core dumps should know what they are doing. It may still be a good idea to add a "dragons be here" warning to the https://pkg.go.dev/runtime text. |
I verified that on macOS 11.7;5 (BigSur), on an amd64 architecture, if I elide the GOOS darwin check in the |
Thanks for checking. Sent https://go.dev/cl/483015 to remove that oddity. |
Change https://go.dev/cl/483015 mentions this issue: |
Previously we did not permit them as Go programs generated enormous core dumps on macOS. However, according to an investigation in #59446, they are OK now. For #59446 Change-Id: I1d7a3f500a6bc525aa6de8dfa8a1d8dbb15feadc Reviewed-on: https://go-review.googlesource.com/c/go/+/483015 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
A recent discussion on the go-nuts mailing list had myself, and Robert Engels, confused why we didn't get core dumps when a process written in Go died from a signal such as SIGSEGV on our macOS platforms. The reason core dumps don't happen on macOS (at least on amd64) can be found in src/runtime/signal_unix.go:
This should be documented. It is also unclear why the GOARCH restriction exists. Presumably the same issue affects macOS on arm64 (aka, Apple Silicon). However, I have not verified that since it requires creating a code-signed Go binary and I didn't have the necessary desire to jump through those hoops.
The text was updated successfully, but these errors were encountered: