Windows: guest _Exit hangs in FlipQueue's destructor because ExitProcess still runs module detach routines #2579
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-10T06:50:31Z.
On Windows a guest
_Exitor_exitcan hang instead of ending the process. Homebrew UI Lab (PPSA99050) calls_Exit(EXIT_FAILURE)from ps5-opengl's retirement fail-stop and then stays alive. gdb on the hung process shows one thread instd::_Sp_counted_ptr_inplace<FlipQueue>::_M_dispose(libSceVideoOut.prx), thenstd::thread::join, thenWaitForMultipleObjects.Cause
On Windows
std::_Exitends inExitProcess. That still runs every module'sDLL_PROCESS_DETACHand its TLS and FLS callbacks, after the other threads have been terminated.FlipQueue's destructor then joins a thread that is already gone and waits forever. POSIX_exitruns no atexit handlers, stream flushes or module destructors.Fix
AlxcBTW:fix/windows-immediate-exit(2feef9e7, onmainc963432d). Full CI, with the change merged intomainc72d5ce1, passes on Linux, macOS and Windows. I can't open it as a PR while intake is limited, so it's here if a collaborator wants to cherry-pick it._Exit(libc) and_exit(libkernel) now end the process throughLibcTerminate_nid_no_patch. That callsTerminateProcesson Windows andstd::_Exiteverywhere else.Tested
Windows 11, WinLibs GCC 15.2.0 r7.
guest_immediate_exitnow also registers an FLS callback that would end the process with 4. It exits with 4 without the change and with 0 with it.ctest -R "kill|exit|process|shutdown|atexit|libc|kernel": 19/19.submission retirement failed. With it, the process exits with 1 (EXIT_FAILURE).AI-assisted: yes (Claude Code).