mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: simply user throws, expand runtime throws
This gives explicit names to the possible states of throwing (-1, 0, 1). m.throwing is now one of: throwTypeOff: not throwing, previously == 0 throwTypeUser: user throw, previously == -1 throwTypeRuntime: runtime throw, previously == 1 For runtime throws, we now always include frame metadata and system goroutines regardless of GOTRACEBACK to aid in debugging the runtime. For user throws, we no longer include frame metadata or runtime frames, unless GOTRACEBACK=system or higher. For #51485. Change-Id: If252e2377a0b6385ce7756b937929be4273a56c0 Reviewed-on: https://go-review.googlesource.com/c/go/+/390421 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
29bbca5c2c
commit
4289bd365c
9 changed files with 49 additions and 18 deletions
|
|
@ -4088,7 +4088,6 @@ func newproc1(fn *funcval, callergp *g, callerpc uintptr) *g {
|
|||
_g_ := getg()
|
||||
|
||||
if fn == nil {
|
||||
_g_.m.throwing = -1 // do not dump full stacks
|
||||
fatal("go of nil func value")
|
||||
}
|
||||
acquirem() // disable preemption because it can be holding p in a local var
|
||||
|
|
@ -5045,7 +5044,6 @@ func checkdead() {
|
|||
}
|
||||
}
|
||||
|
||||
getg().m.throwing = -1 // do not dump full stacks
|
||||
unlock(&sched.lock) // unlock so that GODEBUG=scheddetail=1 doesn't hang
|
||||
fatal("all goroutines are asleep - deadlock!")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue