]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.5] runtime: fix new stack barrier check
authorRuss Cox <rsc@golang.org>
Fri, 20 Nov 2015 19:02:33 +0000 (14:02 -0500)
committerAustin Clements <austin@google.com>
Fri, 20 Nov 2015 19:55:27 +0000 (19:55 +0000)
During a crash showing goroutine stacks of all threads
(with GOTRACEBACK=crash), it can be that f == nil.

Only happens on Solaris; not sure why.

Change-Id: Iee2c394a0cf19fa0a24f6befbc70776b9e42d25a
Reviewed-on: https://go-review.googlesource.com/17110
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/17122
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/traceback.go

index aed6cbd694f74400526f3b4755f7ff81fe27d2fa..8f27ba4d6609be73827ff21d890cd56361c4320f 100644 (file)
@@ -188,7 +188,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
        }
 
        f := findfunc(frame.pc)
-       if f.entry == stackBarrierPC {
+       if f != nil && f.entry == stackBarrierPC {
                // We got caught in the middle of a stack barrier
                // (presumably by a signal), so stkbar may be
                // inconsistent with the barriers on the stack.