Alexandre Julliard pushed to branch master at wine / wine
Commits: 94447cee by William Horvath at 2025-08-18T13:10:21+02:00 ntdll: Check for invalid gs_base in the 64-bit segv_handler.
Adapted from check_invalid_gs in signal_i386.c. PE-side code can manipulate %gs and cause the next call to NtCurrentTeb to segfault, as the gs_base may be cleared with writes to %gs on x86_64 [1].
This would cause a recursive exception loop, as any PE-side code in the exception handling chain after the segv_handler would run into the same problem. So, catch this early, and manually repair the thread's gs_base with the pthread TEB from the Unix side.
The 32-bit game "Alice: Madness Returns" is one example of this problem occurring in the real world, when running under WoW64. However, this is currently handled in Windows under both WoW64 and native 64-bit, so we should handle both architectures as well.
[1]: https://bugs.winehq.org/show_bug.cgi?id=51152
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57444
- - - - - d628a532 by William Horvath at 2025-08-18T13:10:21+02:00 ntdll/tests: Re-enable a previously crashing test.
See https://bugs.winehq.org/show_bug.cgi?id=51152 for the bug that led to commit 4e4847dd71a3c682356559a51705ccec93b2490e. We can re-enable the %gs case now, as that no longer causes a crash.
- - - - -
2 changed files:
- dlls/ntdll/tests/exception.c - dlls/ntdll/unix/signal_x86_64.c
View it on GitLab: https://gitlab.winehq.org/wine/wine/-/compare/e5f591f311812d821f7cf9a27fc4de...