]> Cypherpunks repositories - gostls13.git/commit
runtime: use VEH, not SEH, for windows/386 exception handling
authorRuss Cox <rsc@golang.org>
Tue, 25 Mar 2014 01:22:16 +0000 (21:22 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 25 Mar 2014 01:22:16 +0000 (21:22 -0400)
commit3750904a7efc36aa4f604497b53a9dc1ea67492b
tree35ee5656b00d9f5a5d0ee04e8b4ea9e65be402d1
parent3b27343c14fdfeaa19b20b26ce660aafa814d01d
runtime: use VEH, not SEH, for windows/386 exception handling

Structured Exception Handling (SEH) was the first way to handle
exceptions (memory faults, divides by zero) on Windows.
The S might as well stand for "stack-based": the implementation
interprets stack addresses in a few different ways, and it gets
subtly confused by Go's management of stacks. It's also something
that requires active maintenance during cgo switches, and we've
had bugs in that maintenance in the past.

We have recently come to believe that SEH cannot work with
Go's stack usage. See http://golang.org/issue/7325 for details.

Vectored Exception Handling (VEH) is more like a Unix signal
handler: you set it once for the whole process and forget about it.

This CL drops all the SEH code and replaces it with VEH code.
Many special cases and 7 #ifdefs disappear.

VEH was introduced in Windows XP, so Go on windows/386 will
now require Windows XP or later. The previous requirement was
Windows 2000 or later. Windows 2000 immediately preceded
Windows XP, so Windows 2000 is the only affected version.
Microsoft stopped supporting Windows 2000 in 2010.
See http://golang.org/s/win2000-golang-nuts for details.

Fixes #7325.

LGTM=alex.brainman, r
R=golang-codereviews, alex.brainman, stephen.gutekanst, dave
CC=golang-codereviews, iant, r
https://golang.org/cl/74790043
src/pkg/runtime/asm_386.s
src/pkg/runtime/cgocall.c
src/pkg/runtime/export_test.go
src/pkg/runtime/os_windows.c
src/pkg/runtime/os_windows_386.c
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h
src/pkg/runtime/runtime1.goc
src/pkg/runtime/sys_windows_386.s
src/pkg/runtime/syscall_windows_test.go