diff options
author | Russ Cox <rsc@golang.org> | 2015-10-30 11:03:02 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2015-10-30 18:43:44 +0000 |
commit | bf1de1b141b6354874780401d4525b3b5a1ff6d5 (patch) | |
tree | d1ae2462ea0f5821de431ad5d339e1bc98e1aa0e /src/runtime/extern.go | |
parent | 845878a213e1db930e17a5c3108b215be5edbb20 (diff) | |
download | go-bf1de1b141b6354874780401d4525b3b5a1ff6d5.tar.gz go-bf1de1b141b6354874780401d4525b3b5a1ff6d5.zip |
runtime: introduce GOTRACEBACK=single, now the default
Abandon (but still support) the old numbering system.
GOTRACEBACK=none is old 0
GOTRACEBACK=single is the new behavior
GOTRACEBACK=all is old 1
GOTRACEBACK=system is old 2
GOTRACEBACK=crash is unchanged
See doc comment change in runtime1.go for details.
Filed #13107 to decide whether to change default back to GOTRACEBACK=all for Go 1.6 release.
If you run into programs where printing only the current goroutine omits
needed information, please add details in a comment on that issue.
Fixes #12366.
Change-Id: I82ca8b99b5d86dceb3f7102d38d2659d45dbe0db
Reviewed-on: https://go-review.googlesource.com/16512
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/extern.go')
-rw-r--r-- | src/runtime/extern.go | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/runtime/extern.go b/src/runtime/extern.go index cdb66ba24e..5a5d432f62 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -106,15 +106,20 @@ the limit. The GOTRACEBACK variable controls the amount of output generated when a Go program fails due to an unrecovered panic or an unexpected runtime condition. -By default, a failure prints a stack trace for every extant goroutine, eliding functions -internal to the run-time system, and then exits with exit code 2. -If GOTRACEBACK=0, the per-goroutine stack traces are omitted entirely. -If GOTRACEBACK=1, the default behavior is used. -If GOTRACEBACK=2, the per-goroutine stack traces include run-time functions. -If GOTRACEBACK=crash, the per-goroutine stack traces include run-time functions, -and if possible the program crashes in an operating-specific manner instead of -exiting. For example, on Unix systems, the program raises SIGABRT to trigger a -core dump. +By default, a failure prints a stack trace for the current goroutine, +eliding functions internal to the run-time system, and then exits with exit code 2. +The failure prints stack traces for all goroutines if there is no current goroutine +or the failure is internal to the run-time. +GOTRACEBACK=none omits the goroutine stack traces entirely. +GOTRACEBACK=single (the default) behaves as described above. +GOTRACEBACK=all adds stack traces for all user-created goroutines. +GOTRACEBACK=system is like ``all'' but adds stack frames for run-time functions +and shows goroutines created internally by the run-time. +GOTRACEBACK=crash is like ``system'' but crashes in an operating system-specific +manner instead of exiting. For example, on Unix systems, the crash raises +SIGABRT to trigger a core dump. +For historical reasons, the GOTRACEBACK settings 0, 1, and 2 are synonyms for +none, all, and system, respectively. The GOARCH, GOOS, GOPATH, and GOROOT environment variables complete the set of Go environment variables. They influence the building of Go programs |