Repository navigation
fix(agc): own resolved dispatch state through thread exit - #3661
oneandonlydean merged 1 commit into
Conversation
The resolved-dispatch map was a nontrivial thread_local object. MinGW can run its destructor after emutls frees the backing storage, causing an access violation when a queue worker exits. Use the existing ThreadOwned helper to destroy the heap-owned map through its pthread key while keeping a trivial TLS pointer. Reject FATAL output in both draw-cache test modes so a background shutdown failure cannot pass only because the process returns zero.
|
The fix is the right shape, and I checked whether it is complete rather than partial — it is. The interesting part is not the map itself but that the same file holds five more The The ordering question is settled by this repo's own #590, not open. That PR describes exactly this hazard: with MinGW GCC, Written with AI assistance. |
|
Independent Windows validation of unchanged head Release, GCC 15.2/MinGW, Ryzen 9 9950X3D, RTX 5080; bundled dependencies, SPIRV-Tools OFF. Fresh full build,
The three extra peer failures reported I did not independently reproduce or capture a stack for the specific TLS callback access violation. Linux and game startup were not run for this validation. The focused tests and output guard pass, with the full-suite failures and causal limitation above. |
|
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.
|
What
A queue worker can access freed TLS storage while destroying its resolved-dispatch map on Windows. I traced a shutdown access violation from a draw-cache test to that map's destructor in MinGW's TLS callback. The test still returned zero and CTest reported a pass.
The map now uses the existing
ThreadOwnedhelper: a trivial TLS pointer refers to a heap-owned map destroyed by its pthread-key callback. This applies the ownership rule from #590 to the map introduced by #1864. Dispatch lookup and clearing stay unchanged.Both draw-cache test modes now fail on
FATAL:output, including a background crash followed by exit zero. #3528's shader-ABI shutdown handling and #1202's draw-pipeline work leave this map unchanged.The observed failure is intermittent; no deterministic RED is claimed. The separate stackless heap-corruption failure is not proven to have the same cause, and finite passing runs do not prove universal absence of the fault.
Tested
maina11c8f7. Windows 11/NVIDIA and Linux/llvmpipe: Release-DBUILD_TESTING=ON, builds, libs and registration pass.guest_kernel_sys,windows_exceptions,guest_filesystem,agc_driver_emulated_color_compare. All match exact main1e8fff68, whose core matchesa11c8f7f.agc_driver_emulated_color_comparematches1e8fff68;agc_driver_depth_compare_copyfails unchanged write-watch admission.agc_driver_image_plane_address_on_line_implicit_lodandguest_kernel_stack_protectonly have historical0f863c10signature matches, not exact-current-main controls.agc_write_tracking(exit 1).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)