Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: include panic/throw logs in core dumps #16893
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).
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?