Repository navigation
test(agc): shut libc down before agc_shader_helpers returns - #6925
Merged
oneandonlydean merged 1 commit intoOct 17, 2026
Merged
Conversation
On Windows, agc_shader_helpers returned from main with the driver's threads still running. ExitProcess ends them first, then the DLLs' static destructors run and wait on what those threads left locked: the async log's queue mutex in Driver::stop, DeviceUseGate's condition variable in ~Driver, and condition variables in libkernel's statics. The test hung after printing its result in about one ctest run of three on a Radeon 860M (boykopovar#6791). Like the other driver tests, it now runs LibcRunShutdown_nid_postfix before returning, which stops the driver while its threads are alive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
I reviewed the shutdown calls against the existing AGC test pattern on current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(Linux GCC13.3: agc_driver_graphics reports VOP2 for an all-zero vertex request #6792, fixed by test(agc): keep the vertex terminate case's code in static storage #6789). Windows stops onGpuIndirectArgumentsMisalignedWriterAhead.cpp'salignas(65536)as onmain(test(agc): align the indirect arguments block at run time #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)