]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: support GOTRACEBACK=wer on Windows
authorqmuntal <quimmuntal@gmail.com>
Thu, 9 Mar 2023 13:55:31 +0000 (14:55 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Mon, 10 Apr 2023 18:52:58 +0000 (18:52 +0000)
commit65ea4c5021d44395db8728eea16eb8f7fc7420eb
treeaf729f4aed221fc5d7515141fd1c8cab28056654
parent5e93a2c2042484ee7a941e967294a5248ab6a593
runtime: support GOTRACEBACK=wer on Windows

GOTRACEBACK=wer is a new traceback level that acts as "crash" and
also enables WER. The same effect can be achieved using
debug.SetTraceback("wer").

The Go runtime currently crashes using exit(2), which bypasses WER
even if it is enabled. To best way to trigger WER is calling
RaiseFailFastException [1] instead, which internally launches the
WER machinery.

This CL also changes how GOTRACEBACK=crash crashes, so both "wer" and
"crash" crash using RaiseFailFastException, which simplifies the
implementation and resolves a longstanding TODO.

Fixes #57441
Fixes #20498

[1] https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-raisefailfastexception

Change-Id: I45669d619fbbd2f6413ce5e5f08425ed1d9aeb64
Reviewed-on: https://go-review.googlesource.com/c/go/+/474915
Reviewed-by: Davis Goodin <dagood@microsoft.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
src/runtime/defs_windows.go
src/runtime/export_windows_test.go
src/runtime/extern.go
src/runtime/nonwindows_stub.go [moved from src/runtime/relax_stub.go with 82% similarity]
src/runtime/os_windows.go
src/runtime/runtime1.go
src/runtime/signal_windows.go
src/runtime/syscall_windows_test.go