aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2018-01-31 11:55:22 -0500
committerAustin Clements <austin@google.com>2018-01-31 20:57:52 +0000
commit3ff41cdffade9e7b5a78fa56a43351dbd665df7a (patch)
tree5f031561651603c92cfc0aed7ad18b5c36f16e28
parentd929e40e9aed54ef7cd9f8853a34334f4f3c8f8e (diff)
downloadgo-3ff41cdffade9e7b5a78fa56a43351dbd665df7a.tar.gz
go-3ff41cdffade9e7b5a78fa56a43351dbd665df7a.zip
runtime: suppress "unexpected return pc" any time we're in cgo
Currently, gentraceback suppresses the "unexpected return pc" error for sigpanic's caller if the M was running C code. However, there are various situations where a sigpanic is injected into C code that can cause traceback to unwind *past* the sigpanic before realizing that it's in trouble (the traceback beyond the sigpanic will be wrong). Rather than try to fix these issues for Go 1.10, this CL simply disables complaining about unexpected return PCs if we're in cgo regardless of whether or not they're from the sigpanic frame. Go 1.9 never complained about unexpected return PCs when printing, so this is simply a step closer to the old behavior. This should fix the openbsd-386 failures on the dashboard, though this issue could affect any architecture. Fixes #23640. Change-Id: I8c32c1ee86a70d2f280661ed1f8caf82549e324b Reviewed-on: https://go-review.googlesource.com/91136 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r--src/runtime/traceback.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go
index 2261942ab4..747176c278 100644
--- a/src/runtime/traceback.go
+++ b/src/runtime/traceback.go
@@ -287,7 +287,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
// But if callback is set, we're doing a garbage collection and must
// get everything, so crash loudly.
doPrint := printing
- if doPrint && gp.m.incgo && f.entry == sigpanicPC {
+ if doPrint && gp.m.incgo {
// We can inject sigpanic
// calls directly into C code,
// in which case we'll see a C