aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_windows_386.s
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-05-04 16:00:08 +0000
committerMichael Knyszek <mknyszek@google.com>2021-05-04 21:16:16 +0000
commitcd28ca3a4e130c88dd8f2d198050620b11d22ce4 (patch)
tree70d6285fac6d5b7eb32b01fc294554819cb6c3af /src/runtime/sys_windows_386.s
parentd19e5493bd764e26a0662c06c858033a24eaa415 (diff)
downloadgo-cd28ca3a4e130c88dd8f2d198050620b11d22ce4.tar.gz
go-cd28ca3a4e130c88dd8f2d198050620b11d22ce4.zip
runtime: abort when receiving a signal on a non-Go thread on Windows
Currently if a signal lands on a non-Go thread that's handled by the Go handler, Go will emit a message. However, unlike everywhere else in the runtime, Go will not abort the process after, and the signal handler will try to continue executing. This leads to cascading failures and possibly even memory corruption. For #45638. Change-Id: I546f4e82f339d555bed295528d819ac883b92bc6 Reviewed-on: https://go-review.googlesource.com/c/go/+/316809 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/sys_windows_386.s')
-rw-r--r--src/runtime/sys_windows_386.s4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/sys_windows_386.s b/src/runtime/sys_windows_386.s
index 64b12859ae..0b3933502a 100644
--- a/src/runtime/sys_windows_386.s
+++ b/src/runtime/sys_windows_386.s
@@ -58,7 +58,9 @@ TEXT runtime·badsignal2(SB),NOSPLIT,$24
MOVL DX, 12(SP)
MOVL $0, 16(SP) // overlapped
CALL *runtime·_WriteFile(SB)
- MOVL BP, SI
+
+ // Does not return.
+ CALL runtime·abort(SB)
RET
// faster get/set last error