fix(agc): release the current address space with the image mirrors #1071
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1071"
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-07T08:35:52Z.
What
Closing a title on Windows crashes after #849: its
ClearImageMirrorsdrops the mirror map before the device is destroyed, but the current address space inSpaces()(GuestBufferMemory.cpp) still holds shared references to the same mirrors. They live on until the cache's function-local static is destroyed fromlibSceAgcDriver.prx's DLL detach, and their pooled buffers are then freed through Vulkan after the Vulkan driver has been unloaded:Stack, symbolized against the build's
libSceAgcDriver.prx:Buffer::~Buffer()(fromBuffer::release())BufferPool::~BufferPool()_Sp_counted_ptr_inplace<ImageMirror>::_M_dispose()_Sp_counted_ptr_inplace<GuestBufferMemory::AddressSpace>::_M_dispose()__tcf_...Spaces()::cache(static destructor)_CRT_INIT,DllMainCRTStartupClearImageMirrorsnow also releases the current address space, so its mirrors are freed in the device teardown with the rest, while the device exists. The next use rebuilds the address space, as after the existing waiter drop.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release with
BUILD_TESTING=ON, AMD Radeon 860M (RDNA 3.5, driver 32.0.13058.8001),main219a1cf8.DOOM Shareware homebrew PPSA99666 01.001.000 (lowbit/ps5-doom v1.1.0, the build in #690), converted with
--windows, closed with the window's close button:mainctest: 382/383 passed; the failure is #825, which also fails on unmodifiedmainon this GPU.GuestBufferMemory.cpp(#290, #426, #639, #943, #1046, #1051) conflicts with this change; #639 callsSpaces()without changing it.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T05:50:24Z.
Checked the diff:
Spaces().currentis released insideClearImageMirrors, after the mirror map swap and while the device still exists, same pattern as the waiter drop atGuestBufferMemory.cpp:973. Build and full ctest on top of currentmainpass (415/415), Linux and Windows CI green. The Windows teardown crash itself is taken from the PR's before/after table; merging.