fix(libc): accept guest thread atexit dso on Windows #5155
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5155"
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 kallmek3nny on 2026-10-13T13:04:02Z.
What
Normalize the DSO argument passed through
__cxa_thread_atexit_impl_nid_postfixtonullptron Windows before calling MinGW's host__cxa_thread_atexitimplementation.Guest modules pass guest-side DSO handles. MinGW's TLS atexit runtime only accepts its host DSO handle (or null), so forwarding a guest DSO can assert in
tls_atexit.c. Linux behavior is unchanged and still forwards the real DSO.The existing callback regression previously forced
directDso = nullptron Windows, which hid this mismatch. The test now passes a real non-null module handle on every platform so the Windows path exercises guest/foreign DSO normalization.This is distinct from open #5065 / #5090: those add the missing
BKSCW2bCACA/__cxa_thread_atexitexport. This PR fixes the existing callback bridge's Windows DSO behavior and can be merged independently; the export PR benefits from it once landed.Related: #5055.
Tested
CxxAbiSupport.cppandGuestThreadCallbackAbi.cppchange, 3 additions / 3 deletions.Checklist
main; fresh duplicate search covered #5055,__cxa_thread_atexit_impl_nid_postfix,BKSCW2bCACA,libc, both affected files, and Windows/DSO title keywords. #5065/#5090 export the symbol but do not implement this behavior.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T13:14:42Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/src/CxxAbiSupport.cppL74-83Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-13T21:08:35Z.
Checked on Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, full build (AI-assisted: Claude Code).
This looks superseded by #5065 (merged as
9c383e329, "ignore the guest DSO of thread atexit on Windows in the shared bridge"). Currentmainalready setsdso = nullptrunder_WIN32at the top of__cxa_thread_atexit_impl_nid_postfix, andGuestThreadCallbackAbi.cppalready passesdirectDso = moduleon every platform.main(0aa4cb1c2) without this PR:guest_thread_callback_abipasses with the non-null DSO.923fcab8c) merged ontomainmerges cleanly but adds a second identical#ifdef _WIN32 dso = nullptr; #endifblock after the context allocation.guest_thread_callback_abipasses 20/20, with no change in behaviour.Unless something else is still missing here, this one can probably be closed.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:33:15Z.
Closing: the Windows guest DSO handling and the test change are on main since #5065.
Reopen if something here is still missing on current main.
Pull request closed