Skip to content

Windows: fix and re-enable 2 tests - #52

Open
slipher wants to merge 4 commits into
masterfrom
slipher/win-tests
Open

Windows: fix and re-enable 2 tests#52
slipher wants to merge 4 commits into
masterfrom
slipher/win-tests

Conversation

@slipher

@slipher slipher commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fix and enable run_patch_ntdll_test and run_debug_stub_test. Also update the crash handler to use the new __fastfail method of instantly exiting the process introduced in Windows 8.

slipher added 4 commits July 27, 2026 22:11
It needed a Python 3 migration to signed process exit code.
For some reason functions in the printf family were crashing when called
from the crash handler in run_patch_ntdll_test. Avoid this by switching
them to (f)puts instead of (f)printf, and re-enable the test. Also
modify the handler to do an infinite loop (thus timing out the test) if
unexpected extra crashes happen.
Use int 0x29 aka __fastfail (introduced in Windows 8) to implement
NaCl_exception_dispatcher_exit_fast.
Fixes run_patch_ntdll_test on MinGW.

MinGW GCC 16 decided to be clever and optimize out `*(int*)0 = 0`.
It does this even if I add `volatile`. So change the target address to
4 instead of 0 so the special null pointer optimization can't be
applied. Also do this for the other 14 places where a hard-coded null
pointer is dereferenced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant