]> Cypherpunks repositories - gostls13.git/commit
runtime: allow arm64 SEH to be called if illegal instruction
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 5 Aug 2021 11:37:29 +0000 (13:37 +0200)
committerRuss Cox <rsc@golang.org>
Fri, 6 Aug 2021 16:51:12 +0000 (16:51 +0000)
commit70546f6404c5927a9868a80ccbf4c6c2beaea671
tree709fb18175ed95b22463231697640e3c4a997b84
parentfd45e267c2f6ce7c6a88842e3ad94d3469223e42
runtime: allow arm64 SEH to be called if illegal instruction

DLLs built with recent Microsoft toolchains for ARM64 test for ARMv8.1
atomics by potentially calling an illegal instruction, and then trapping
the exception to disable use of them by way of a structured exception
handler. However, vectored exception handlers are always called before
structured exception handlers. When LoadLibrary-ing DLLs that do this
probing during initialization, our lastcontinuehandler winds up being
called, and then crashing, but actually it should give execution back to
the library to handle the exception and fix up the state. So special
case this for arm64 with illegal instructions, and hope that we're not
masking other things in external DLLs that might more fatally trigger an
illegal instruction exception.

Updates #47576.

Change-Id: I341ab99cd8d513ae999b75596749d49779072022
Reviewed-on: https://go-review.googlesource.com/c/go/+/340070
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/signal_windows.go