From: Keith Randall Date: Thu, 25 Jun 2020 16:10:23 +0000 (-0700) Subject: runtime: print faulting instruction on a SIGFPE X-Git-Tag: go1.16beta1~1306 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=88c094c96a164aef2134e548d495c4bc14dc4687;p=gostls13.git runtime: print faulting instruction on a SIGFPE Just like SIGILL, it might be useful to see what the instruction that generated the SIGFPE is. Update #39816 Change-Id: I8b2ff692998f0b770289339537dceab96b09d1ee Reviewed-on: https://go-review.googlesource.com/c/go/+/239999 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index dd6d79f8ec..6a11c91fb9 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -616,7 +616,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) { print("signal arrived during cgo execution\n") gp = _g_.m.lockedg.ptr() } - if sig == _SIGILL { + if sig == _SIGILL || sig == _SIGFPE { // It would be nice to know how long the instruction is. // Unfortunately, that's complicated to do in general (mostly for x86 // and s930x, but other archs have non-standard instruction lengths also).