]> Cypherpunks repositories - gostls13.git/commit
runtime: include pre-panic/throw logs in core dumps
authorRhys Hiltner <rhys@justin.tv>
Tue, 25 Oct 2016 18:56:29 +0000 (11:56 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 11 Nov 2016 21:29:53 +0000 (21:29 +0000)
commite0aedfb496f414e1a869d27175b4dfcc6baef407
treed34ac33c7025c6f1004237bce14c8fa0d78d8a3a
parent10d2efd0b0e3f4f92f9470435f63211cbeb82008
runtime: include pre-panic/throw logs in core dumps

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>
src/runtime/print.go