-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: include panic/throw logs in core dumps #16893
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
Seems fine to me. Anyone want to take a stab at implementing it? |
I've made an attempt at this which I'll mail momentarily. I can't say it's a good solution, but it's at least a starting point for discussion. |
CL https://golang.org/cl/32013 mentions this issue. |
When a Go program crashes with GOTRACEBACK=crash, the OS creates a core dump. Include the text-formatted output of some of the cause of that crash in the core dump. Output printed by the runtime before crashing is maintained in a circular buffer to allow access to messages that may be printed immediately before calling runtime.throw. The stack traces printed by the runtime as it crashes are not stored. The information required to recreate them should be included in the core file. Updates #16893 There are no tests covering the generation of core dumps; this change has not added any. This adds (reentrant) locking to runtime.gwrite, which may have an undesired performance impact. Change-Id: Ia2463be3c12429354d290bdec5f3c8d565d1a2c3 Reviewed-on: https://go-review.googlesource.com/32013 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
What else is there to do this for this issue now that https://golang.org/cl/32013 has been committed? |
Core dumps will now include text-formatted runtime messages from immediately before a crash; they don't include any text-formatted messages on the crashes themselves. We discussed in the CL how that could be recreated from the runtime package's datastructures in the core dump. If that can become a requirement of the work for #16410, then this issue is ready to be closed since there won't be any more runtime changes required. Where should that request be tracked? Thanks @ianlancetaylor |
Closing in favor of #16410. Thanks. |
When a Go program crashes with GOTRACEBACK=crash, the OS creates a core dump. I'd like that core dump to include the human-readable "panic" or "fatal error" messages and stack traces—or at least the first N kB of them.
This could be done by writing the first ~64kB of errors and stack traces to a pre-allocated global slice in the runtime package in addition to writing to stderr.
No user code would be involved, so this is distinct from e.g. #16340. I'm particularly interested in being able to reliably collect not only "panic" crashes (from runtime.gopanic), but also "fatal error" crashes (from runtime.throw).
There are more tools being built around core dumps (#16410), so it would be good to collect all information relevant to crashes in that one place (#16410 (comment))
Alternatives include:
The text was updated successfully, but these errors were encountered: