test(agc): keep shader memory test tables inside one guest page #472
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/472"
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 adriadam10 on 2026-10-03T16:50:31Z.
What
Under AddressSanitizer
agc_shader_memorystops with a stack-buffer-overflow inGuestMemory::Read.ShaderMemory::pagereads guest memory a whole 4 KiB page at a time, which is right for guest memory, but the test hands it host stack arrays and separate statics as guest buffers, so the page read covers neighbouring objects and their redzones. After the first report ASan finds the same thing in two more places (a global-buffer-overflow inverifyTwoLaneUniformValues, a stack-buffer-underflow inmain).The guest-visible tables of those three tests now live in one page-aligned static struct each (
alignas(4096)), so every page the reader touches belongs to a single object. The values and checks are unchanged; only where the tables live.Tested
agc_shader_memorypasses in the Release build and under AddressSanitizer (-fsanitize=address, RelWithDebInfo, defaultASAN_OPTIONSapart fromdetect_leaks=0). Onmainit fails under ASan with the report above.agc_*tests already pass under ASan;agc_driver_pixel_helper_lanesfails on this machine with and without ASan, unrelated.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)