diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2015-02-07 15:31:18 +0300 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2015-02-11 10:39:48 +0000 |
| commit | 59495e8dfda0cfc1fa527337b2fed8a8099137dc (patch) | |
| tree | d102f214df99efde953da072c29cc9bf86a98026 /src/runtime/mfinal.go | |
| parent | 84e256753744e765e4a31b48e2a641eecd4d01f1 (diff) | |
| download | go-59495e8dfda0cfc1fa527337b2fed8a8099137dc.tar.xz | |
runtime: never show system goroutines in traceback
Fixes #9791
g.issystem flag setup races with other code wherever we set it.
Even if we set both in parent goroutine and in the system goroutine,
it is still possible that some other goroutine crashes
before the flag is set. We could pass issystem flag to newproc1,
but we start all goroutines with go nowadays.
Instead look at g.startpc to distinguish system goroutines (similar to topofstack).
Change-Id: Ia3467968dee27fa07d9fecedd4c2b00928f26645
Reviewed-on: https://go-review.googlesource.com/4113
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/mfinal.go')
| -rw-r--r-- | src/runtime/mfinal.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/runtime/mfinal.go b/src/runtime/mfinal.go index 28afa0dfab..525aa0955a 100644 --- a/src/runtime/mfinal.go +++ b/src/runtime/mfinal.go @@ -102,7 +102,10 @@ func wakefing() *g { return res } -var fingCreate uint32 +var ( + fingCreate uint32 + fingRunning bool +) func createfing() { // start the finalizer goroutine exactly once @@ -126,9 +129,7 @@ func runfinq() { gp := getg() fing = gp fingwait = true - gp.issystem = true goparkunlock(&finlock, "finalizer wait", traceEvGoBlock) - gp.issystem = false continue } unlock(&finlock) @@ -169,7 +170,9 @@ func runfinq() { default: throw("bad kind in runfinq") } + fingRunning = true reflectcall(nil, unsafe.Pointer(f.fn), frame, uint32(framesz), uint32(framesz)) + fingRunning = false // drop finalizer queue references to finalized object f.fn = nil |
