Skip to content

Commit 88c094c

Browse files
committed
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 golang#39816 Change-Id: I8b2ff692998f0b770289339537dceab96b09d1ee Reviewed-on: https://go-review.googlesource.com/c/go/+/239999 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent ba97be4 commit 88c094c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/signal_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
616616
print("signal arrived during cgo execution\n")
617617
gp = _g_.m.lockedg.ptr()
618618
}
619-
if sig == _SIGILL {
619+
if sig == _SIGILL || sig == _SIGFPE {
620620
// It would be nice to know how long the instruction is.
621621
// Unfortunately, that's complicated to do in general (mostly for x86
622622
// and s930x, but other archs have non-standard instruction lengths also).

0 commit comments

Comments
 (0)