-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runtime: make GODEBUG=dontfreezetheworld=1 safer
GODEBUG=dontfreezetheworld=1 allows goroutines to continue execution during fatal panic. This increases the chance that tracebackothers will encounter running goroutines that it must skip, which is expected and fine. However, it also introduces the risk that a goroutine transitions from stopped to running in the middle of traceback, which is unsafe and may cause traceback crashes. Mitigate this by halting M execution if it naturally enters the scheduler. This ensures that goroutines cannot transition from stopped to running after freezetheworld. We simply deadlock rather than using gcstopm to continue keeping disturbance to scheduler state to a minimum. Change-Id: I9aa8d84abf038ae17142f34f4384e920b1490e81 Reviewed-on: https://go-review.googlesource.com/c/go/+/501255 Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
- Loading branch information
Showing
3 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters