Testing: implement subprocess isolation on Windows

current_executable_path uses GetModuleFileNameW, and
run_isolated_subprocess mirrors the POSIX semantics with CreateProcessW:
redirected stdout/stderr pipes drained without deadlock, a suspended start
so job-object CPU/address-space limits are in force before the child runs,
deadline termination, bounded capture with truncation, and crash mapping
from NTSTATUS exit codes (CRT abort reports SIGABRT).

The resource-limit assertion stays POSIX-only because Wine does not
enforce job-object memory limits.
This commit is contained in:
faumaray committed 2026-12-06 16:41:56 +03:00
1 parent 9e94d8e484
commit 7cddcf15ea
3 files changed
+351 -11

No files matched your search

+6 -4
View File
@@ -109,7 +109,7 @@ recognized and configured like Linux; musl-specific behaviour (subprocess
| Language | C++26, reflection `yes` |
| Runtime | Wine 11.0 (`wine64`), no native Windows runner available |
| Modules | all modules under `src/` (`VOID_WINDOWS_MODULES` in `cmake/Targets.cmake`) |
| Observed | configure, compile, `cmake --install`, consume (`TargetProfile.exe` linked); each module's suite is verified under Wine before it is allowlisted. Full allowlisted set in one Debug shared binary (MinGW-w64 GCC 16.2.0) under Wine 11: **2003 tests, 1987 passed, 16 skipped, 0 failed** |
| Observed | configure, compile, `cmake --install`, consume (`TargetProfile.exe` linked); each module's suite is verified under Wine before it is allowlisted. Full allowlisted set in one Debug shared binary (MinGW-w64 GCC 16.2.0) under Wine 11: **2003 tests, 1988 passed, 15 skipped, 0 failed** |
Notes from the runtime run:
@@ -157,9 +157,11 @@ Notes from the runtime run:
`inline thread_local` hook stack with a function-local `thread_local`
accessor (MinGW emitted duplicate TLS init functions).
- Test code is portable: POSIX-only descriptor assertions are guarded, the
Log hardening test closes its `ifstream` before removing the file, and the
subprocess-isolation test skips when `current_executable_path()` is not
implemented (Windows has no subprocess isolation yet).
Log hardening test closes its `ifstream` before removing the file, and
subprocess isolation is implemented on Windows (CreateProcess with
redirected pipes, a job object for CPU/address-space limits, and
termination on deadline). Job-object memory limits are not enforced by
Wine, so that one assertion stays POSIX-only.
- MinGW test builds use `-Wa,-mbig-obj` (added automatically for GNU targets):
the Fsm hardening test TU exceeds the COFF section limit with the default
object format.