]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: support SetUnhandledExceptionFilter on Windows
authorqmuntal <quimmuntal@gmail.com>
Mon, 4 Sep 2023 15:30:08 +0000 (17:30 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Thu, 5 Oct 2023 08:26:52 +0000 (08:26 +0000)
commitbc15070085ec417d4254f8a4eda62b42de88fb37
treee0678a8d064fc84b978510f7ccc2f52ebb80f51b
parent36ecff0893e8f30c2ff659acf8c62401f4dcebf7
runtime: support SetUnhandledExceptionFilter on Windows

The Windows unhandled exception mechanism fails to call the callback
set in SetUnhandledExceptionFilter if the stack can't be correctly
unwound.

Some cgo glue code was not properly chaining the frame pointer, making
the stack unwind to fail in case of an exception inside a cgo call.
This CL fix that and adds a test case to avoid regressions.

Fixes #50951

Change-Id: Ic782b5257fe90b05e3def8dbf0bb8d4ed37a190b
Reviewed-on: https://go-review.googlesource.com/c/go/+/525475
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
15 files changed:
src/cmd/internal/obj/x86/seh.go
src/cmd/link/internal/ld/seh.go
src/runtime/asm_amd64.s
src/runtime/cgo/asm_amd64.s
src/runtime/defs_windows.go
src/runtime/defs_windows_386.go
src/runtime/defs_windows_amd64.go
src/runtime/defs_windows_arm.go
src/runtime/defs_windows_arm64.go
src/runtime/os_windows.go
src/runtime/signal_windows.go
src/runtime/signal_windows_test.go
src/runtime/stubs_amd64.go
src/runtime/sys_windows_amd64.s
src/runtime/testdata/testwinlib/main.c