test(agc): shut libc down before agc_shader_helpers returns #6925
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6925"
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 LeandroLP23 on 2026-10-16T18:59:50Z.
What
Fixes #6791. On Windows,
agc_shader_helpersreturned frommainwith the driver's threads still running.ExitProcessends those threads first, then the DLLs' static destructors run atDLL_PROCESS_DETACHand wait forever on what the threads left locked. The test printsshader helper preparation tests passedand then never exits.With debug info (
-O3 -g) andgdb -pon hung processes, the main thread is the only thread left. It waits in one of three places, and a fix for one moves the hang to the next:AsyncLog::Flush(unique_lockon the queue mutex), inlined intoDriver::stopfrom~Drivermain. The mutex sits at offset 8 ofAsyncLog, thelea 0x8(%rax),%rcxin #6791's disassembly~DeviceUseGate(itscondition_variable), from~DriverafterstopreturnsDriver::stop's flush bounded_execute_onexit_tableoflibkernel.prx, in a libstdc++ destructor that waits in winpthreadsDriveralso kept alive at detachSo the cause is the test's exit path, not one lock. The other driver tests (
PipelinedDma,PipelinedDispatch,DepthFastClearSubmit, ...) already callLibcRunShutdown_nid_postfixbefore they return, which stops the driver while its threads are still alive.agc_shader_helpersnow does the same, on success and on failure.#6817 bounds the same test's runtime with a CTest
TIMEOUT; the two don't overlap.Tested
Windows 11 (26300), Radeon 860M (RDNA 3.5,
1002:1114, driver 32.0.13058.8001), WinLibs GCC 15.2.0,ctest -R '^agc_shader_helpers$' --timeout 30, one test perctestprocess:main82ddae75b, Releasemain82ddae75b,-O3 -g-O3 -g(same build)tools/check_conventions.py --base origin/mainpasses;git diff --checkis clean.agc_shader_helperspassing; the failures areconventions_ci_gateandbuild_eligibility(fork-only) andagc_driver_graphics(#6792, fixed by #6789). Windows stops onGpuIndirectArgumentsMisalignedWriterAhead.cpp'salignas(65536)as onmain(#6452); the relinker jobs fail only the two fork-only tests.Not tested: macOS.
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)main's Windows CI)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T20:59:11Z.
I reviewed the shutdown calls against the existing AGC test pattern on current
main. RunningLibcRunShutdown_nid_postfix()on success and best-effort from the exception path matches the neighboring driver tests and addresses the reported DLL-detach deadlock path. The issue records the 60/60 Windows post-fix runs; hosted conventions, eligibility, intake and report checks pass here, while the platform/build jobs are skipped. I have no code change to request from this review.