Repository navigation
fix(libc): skip guest exit handlers on host window close - #5843
Conversation
|
I have a separate follow-up for #5931 covering explicit guest |
|
Thanks @MarcZX100, that ordering fits the intended scope of #5843. The dependency order would be #5236 → #5843 → your follow-up. Please keep AI-assisted: yes. — Codex |
|
Windows check with the title from #5931. With this PR (e0748f3) on The run was stacked with #5978, so the merge resolution is in #5978 (comment). Keep AI-assisted. |
|
Thanks @ahmad3a4 for validating the combined tree. The merge resolution is correct: once @MarcZX100, one remaining coverage gap in #5978: AI-assisted: yes. — Codex |
e0748f3 to
beaf86d
Compare
beaf86d to
eb8146b
Compare
|
Windows/NVIDIA check with VLC (PPSA85300 v0.4, catalog release).
Neither build prints a stop line. Every log ends at Verdict: on NVIDIA, closing the VLC window now exits 0 instead of aborting, with no test regressions. AI-assisted: yes (Claude Code) |
|
A Linux run with the title from #5931: Syobon Action (PPSA47402, catalog 01.001.000), Ubuntu 24.04, GCC 13.3, Release,
AI-assisted: yes |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Checked on the PR merged onto current main: build and scoped ctest green (119/119, no skips). |
|
I added the missing coverage to #5978 and rebased that PR onto current The test source syntax check and conventions check pass. I have not rerun the runtime CTest on this host; the earlier attempt stopped at the host CPU-feature guard before entering the test body. Hosted checks are starting on the rebased head. |
What
Closing the native VLC v0.4 (PPSA85300) window aborts the process, as reported in the #5791 validation.
SDL_QUITcallsLibcRequestExit_nid_postfix, whose detached thread currently runs the guest finalizers. VLC still has a joinable C++ thread object; its destructor callsterminate()and thenabort().The asynchronous host exit request now uses
LibcExitWithoutHandlers_nid_no_patchfrom #5236. It runs the registered runtime shutdown callbacks, flushes the host streams and terminates without guest or host exit handlers. The newguest_requested_exitmode reuses the existing exit fixture: shutdown must complete, another guest thread must stay parked during shutdown, both kinds of exit handler must remain uncalled, and a second request with status 7 must leave the first request's status 0 intact. Its parent checks the child's actual exit code.#5236 is merged into
main. This PR now contains only the host-window-close change and its regression (three files). #5978 remains a separate dependent follow-up for explicit guestexit()and return from main.Tested
Rebase validation on Windows 11 Pro build 26300, WinLibs GCC 15.2.0, Ninja Release: head
eb8146b73, based onmain0ae1deb85. #5236 is merged into this base.patched_libraries.python tools/check_conventions.py --base origin/main,git diff --checkandpython tools/check_main_sync.py --base origin/mainpassed; clean merge, 0 behind at publication.git range-diffconfirms that the host-window-close patch is unchanged. ProductionProcess.cppis byte-identical to the original title-tested PR head. The PR now has one commit and three changed files; the merged prerequisite is no longer carried as a separate commit.No new title run or Linux run was performed for this rebase. The original title validation below was performed before the rebase:
Windows 11 Pro build 26300, WinLibs GCC 15.2.0, Ninja Release. Original head
e0748f372, based onmain5a6ad0ed3plus #5236:Guest shutdown completedfollowed byGuest exit handler ran; CTest fails in 0.17 s. That PR alone does not fix host window closure.--windows --registry --windows-diagnostics --windows-fixed-base 0x400000, including its own libc module. Executable ELF SHA-256:eec51934aa2debed99152c3996f39a41be25e17d9ca14de01cee2d17b62d8e3f. All 132 installed runtime files were checked against the build by SHA-256.main550764236, a visible 20 s run ends with0xc0000409afterCloseMainWindow()returns true. GDB reachesLibcExit->CxaFinalize; the guest destructor at0x2261f30calls termination when its first word is nonzero, andabort_nid_postfixis reached from0x22c49af. The adjacent functions carrythread::join failedandthread::detach failed, and the destructor matches libc++'s thread destructor.Process.cppis byte-identical on that baseline and final base5a6ad0ed3.APS5_NO_DRAW_SRT_ENTRIES=1both close normally with exit code 0, without a timeout or forced kill. The latter displays the complete welcome screen and 16 language buttons. Disabling that cache isolates shutdown from the rendering bug fixed by fix(agc): validate mesh index descriptors on cached draws #5791; this PR changes no rendering code. Media playback and a local Linux run were not tested.python tools/check_conventions.py --base origin/main,git diff --checkandpython tools/check_main_sync.py --base origin/mainpassed; clean merge, 0 behind.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt.mdfiles or images added to the repository (evidence recorded in this PR)