Repository navigation
xcl run: write final report on NtTerminateProcess under Wine (#1461) - #1484
mahfuzinam0045-spec wants to merge 1 commit into
Conversation
…#1461) Under Wine, an executable's TLS callbacks never receive `DLL_PROCESS_DETACH` (reason 0) when the process terminates. Because XCL writes its final `report.json` in `loader::on_tls_event` on `DLL_PROCESS_DETACH`, `report.json` was left in its initial pre-run state under Wine / Proton (affecting Linux and macOS runs, and causing `e2e.rs:164` to observe an empty `called_stubs`). Call `report::write_final(None)` inside `hk_nt_terminate_process` when running under Wine (`util::under_wine()`), before logging and flushing. Native Windows continues to rely on TLS `DLL_PROCESS_DETACH`, keeping Windows behaviour unchanged. Fixes xcl-dev#1461.
|
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on One more than the baseline; the final report written on Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it. |
Hardware test report — commit
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Two contributors checked independently and found that this PR makes the same change as #1479 (for #1461): #1607, group D8. They suggest keeping #1479. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps. This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Closing this as a duplicate: #1479 makes the same change and was opened first (under Wine the final report is written when the process terminates). It stays open and is the one that will be reviewed and merged. This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #1479 does not, or #1479 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #1479. Thank you for the work. AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's. |
Under Wine, an executable's TLS callbacks never receive
DLL_PROCESS_DETACH(reason 0) when the process exits. Because XCL writes its finalreport.jsoninsideloader::on_tls_eventupon receivingDLL_PROCESS_DETACH,report.jsonwas left in its initial pre-run state under Wine / Proton (lackingcalled_stubs, subsystem counters, and final exit status), as reported in #1461.In
hk_nt_terminate_process, invokereport::write_final(None)before logging and flushing when running under Wine (util::under_wine()). On native Windows, the hook continues to rely on standard TLS detach notifications, keeping native Windows execution paths unaffected.Fixes #1461.
What is in it
crates/xcl/src/eh.rs: inhk_nt_terminate_process, delegate toon_nt_terminate, invokingreport::write_final(None)whenutil::under_wine()is true.crates/xcl/src/eh.rs: add unit testnt_terminate_writes_report_under_wineverifying thatwrite_finalis invoked under Wine and skipped on native Windows.Tested
cargo test -p xcl --lib eh::tests: 7 passed, 0 failed.cargo test -p xcl --lib: 708 passed, 0 failed, 21 ignored.cargo test -p xcl --test console_dlls_e2e --test e2e: 16 passed, 0 failed.Regression run
eh::hk_nt_terminate_process. Awaiting maintainer review /test-onlywaiver or community Wine smoke run.Not tested
under_wine()is verified by unit assertions).AI use
eh.rs, wrote the unit tests, and drafted this PR.