feat(libSceDbgThreadSanitizer): add no-op implementations for __tsan_acquire and __tsan_release #6830
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6830"
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 ErenYeager1836 on 2026-10-16T13:35:17Z.
What
Provide safe no-op implementations for
__tsan_acquireand__tsan_releaseinlibSceDbgThreadSanitizer.Currently, these functions call
NotImplemented_nid_no_patch(__func__), which causes fatal aborts if invoked by titles or debug libraries (such as PPSA23226's bundledlibSceJobManager_nosubmission.prx). Because AnyPS5 does not run a race detector andsceKernelIsThreadSanitizerEnabledreturns 0, these functions safely behave as no-ops.__tsan_acquireand__tsan_releaseincore/libs/prx/libSceDbgThreadSanitizer/Export.cppto ignore their address arguments.### Silent stubsindocs/dev/debt/libSceDbgThreadSanitizer.mdand updated the cross-reference indocs/dev/debt/libkernel.md.GuestThreadSanitizer.cpp, and linkedlibSceDbgThreadSanitizeringuest_thread_sanitizer_tests.Tested
Windows 11, unit test suite (
guest_thread_sanitizer_tests). Verified__tsan_acquireand__tsan_releaseexecute cleanly without throwing when called withnullptrand a local object address, and verifiedsceKernelIsThreadSanitizerEnabledreturns 0.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 file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T13:41:26Z.
One Windows test setup issue: the
ENVIRONMENT_MODIFICATIONvalue currently escapes the semicolon between twoPATH=path_list_prepend:...entries (\;). CMake preserves that as a literal escaped semicolon in one list item (cmake -Pconfirms list length 1); CTest expects two list entries, one forlibkerneland one forlibSceDbgThreadSanitizer. Please remove the escape so the property receives both modifications. Otherwise the Windows test may not find the newly linked sanitizer DLL at runtime.Imported from boykopovar/AnyPS5. Originally posted by ErenYeager1836 on 2026-10-16T13:54:16Z.
Good catch, thank you! Updated the test property to unescape the semicolon so CTest receives both directory entries.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T13:54:48Z.
Thanks, I verified the updated CMake property now separates the two PATH modifications. That resolves my Windows test setup concern.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T16:50:47Z.
Review: COMMENTED
First Linux run of this PR.
Machine: Intel i7-8700, Ubuntu 26.04, GCC 15.2, CMake 4.2.3, Release. Head
acac9dfe1merged onmain143f13055.guest_thread_sanitizerpasses.-E "^agc|gpu|vulkan|video_out"): 648/650, the same asmainhere; onlyfile_writer_binaryandfile_writer_textfail, on both.GuestThreadSanitizer.cppand thelibkernel/CMakeLists.txtlink change onmain, withExport.cppfrommain, abort with__tsan_acquire not implemented. So the test covers the change on Linux too.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.