]> Cypherpunks repositories - gostls13.git/commit
runtime: fix abort handling on Windows
authorAustin Clements <austin@google.com>
Fri, 6 Jul 2018 13:50:05 +0000 (09:50 -0400)
committerAustin Clements <austin@google.com>
Sat, 7 Jul 2018 14:44:07 +0000 (14:44 +0000)
commit7001ac53946bb05c88a0e7d7c3c64dfb1cca1fca
tree56fd0945d8bae4bf95aa8dd93e3140058a06996a
parentf5d4863130dff38f7126df6ed6f0303a4809aa04
runtime: fix abort handling on Windows

On Windows, the IP recorded in the breakpoint exception caused by
runtime.abort is actually one byte after the INT3, unlike on UNIX
OSes. Account for this in isgoexception.

It turns out TestAbort was "passing" on Windows anyway because abort
still caused a fatal panic, just not the one we were expecting. This
CL tightens this test to check that the runtime specifically reports a
breakpoint exception.

Fixing this is related to #21382, since we use runtime.abort in
reporting g0 stack overflows, and it's important that we detect this
and not try to handle it.

Change-Id: I66120944d138eb80f839346b157a3759c1019e34
Reviewed-on: https://go-review.googlesource.com/122515
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/runtime/crash_test.go
src/runtime/signal_windows.go