fix(agc): read RELEASE_MEM's INT_SEL only for RELEASE_MEM packets #2338
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2338"
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-09T15:51:31Z.
What
#1362 reads
INT_SELfrompacket[2]before it checks that the packet is aRELEASE_MEM(opcode0x49).preparePacketMemoryruns for every PM4 packet, so packets shorter than three dwords are read past their end. Release builds don't show it, but it is undefined behaviour, and builds with_GLIBCXX_ASSERTIONSabort on thestd::spanbounds check. GCC 15 turns those assertions on in every unoptimized build, so a Debug build also aborts.This PR reads
packet[2]only forRELEASE_MEM. ForRELEASE_MEMpackets the result is the same as before.Tested
Windows 11, AMD Radeon 860M, MinGW GCC 15.2. Clean build with
-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-D_GLIBCXX_ASSERTIONS:agc_driveragc_driver_pm4maind70b8998std::span::operator[]assertion inDriver::preparePacketMemoryBisecting with that build points to
b25c6cce, the merge commit of #1362: its parentd026063apasses.A normal Release build passes both tests before and after the change. Fork CI (Release, Linux and Windows): green (run).
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)Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-09T17:32:44Z.
Linux run: Linux 7.2 (x86_64), GCC 16.2.1, Release,
-DBUILD_TESTING=ON, #2338 (39c4d55a) tested on currentmain(0fdda7be).tests/agc_driver_pm4_tests: passes cleanly (PM4 catalog, registers, state, memory, conditional execution and submission tests passed).tools/check_conventions.py: passes cleanly.Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-09T19:08:38Z.
Review: COMMENTED
Heads-up: this is an exact duplicate of #1587 (
fix(libSceAgcDriver): read the RELEASE_MEM interrupt select only from RELEASE_MEM packets, krishnaraya4, opened 2026-10-08), which is also open andCLEAN.Both produce the identical blob for
PacketMemory.cpp:so the two make the same change hunk for hunk (
(packet[2] >> 24u) & 7umoved behind anopcode == 0x49guard). Thepr-overlapbot will not flag it: it compares open PRs pairwise by merging their trees and reports only files git flags as conflicting — two PRs making the identical edit to the identical lines merge with no conflict, so it reports nothing.Only one can merge; worth resolving before a second review is spent on the same two lines.
Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-09T19:41:05Z.
Closing as a duplicate of #1587, which makes the same change and was opened first. Thanks @Dextroid17 for catching it; I missed #1587 when checking for overlaps. My test results are posted there.
Pull request closed