mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: add GODEBUG=dontfreezetheworld=1
This GODEBUG flag disables the freezetheworld call during fatal panic. freezetheworld asks the scheduler to stop running goroutines on all Ms. This is normally useful, as it ensures we can collect a traceback from every goroutine. However, it can be frustrating when debugging the scheduler itself, as it significantly changes the scheduler state from when the panic started. Setting this flag has some disadvantages. Most notably, running goroutines will not traceback in the standard output (though they may be included in the final SIGQUIT loop). Additionally, we may missing concurrently created goroutines when looping over allgs (CL 270861 made this safe, but still racy). The final state of all goroutines will also be further removed from the time of panic, as they continued to run for a while. One unfortunate part of this flag is the final SIGQUIT loop in the runtime leaves every thread in the signal handler at exit. This is a bit frustrating in gdb, which doesn't understand how to step beyond sigtramp. The data is still there, but you must manually walk. Change-Id: Ie6bd3ac521fcababea668196b60cf225a0be1a00 Reviewed-on: https://go-review.googlesource.com/c/go/+/478975 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
fba8566cda
commit
5f882d8266
3 changed files with 14 additions and 0 deletions
|
|
@ -1242,6 +1242,9 @@ func startpanic_m() bool {
|
|||
if debug.schedtrace > 0 || debug.scheddetail > 0 {
|
||||
schedtrace(true)
|
||||
}
|
||||
if debug.dontfreezetheworld > 0 {
|
||||
return true
|
||||
}
|
||||
freezetheworld()
|
||||
return true
|
||||
case 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue