mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[GH-ISSUE #321] Crash in Shader::Gcn::CFG::EmitBlocks(), out of bounds list access #49
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @xezrunner on GitHub (Jul 24, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/321
github.com/shadps4-emu/shadPS4@1d6a42c39a/src/shader_recompiler/frontend/control_flow_graph.cpp (L105-L108)On line 107, the
end_indexfor accessinginst_listgoes beyond (/is equal) to the size ofinst_listduring the startup procedure of Amplitude as it's attempting to start a scene in the engine (Forge Engine game, could be the same case for Rock Band 4, Fuser and other Harmonix titles on the PS4).It appears to be processing label 61 out of 63 total. The code mentions the last label being special, but I'm not sure how or why that would be the case.
I wasn't able to work around this or figure out how to troubleshoot this further.
@Sailanarmo commented on GitHub (Aug 15, 2024):
This entire for block has a bug in it. The reason is because you call for
std::next. Once you’ve reached the end of your containerstd::nextisn’t going to be able to grab anything other than junk.If the last spot in the container is special, either copy all the elements - 1 and iterate over that or keep a count that if the index is the size - 1 to return. I’m currently on mobile or I would suggest a better fix. If I have time tonight I’ll hop on and make a suggestion.
@xezrunner commented on GitHub (Aug 17, 2024):
Currently, Amplitude no longer crashes at this point, but it could also be something else having been broken earlier in the boot process.
I'll leave this issue open then, in case this is something that requires attention regardless of game boot status.
@xezrunner commented on GitHub (Aug 20, 2024):
The root issue causing this should be fixed with https://github.com/shadps4-emu/shadPS4/pull/497, definitely for Amplitude (2016)
CUSA02480.Leaving this open in case the above comment related to the for loop having a bug in it still applies.
@Hermiten commented on GitHub (Oct 4, 2024):
Can I have an update on this one ? Is it still revelant ?
@xezrunner commented on GitHub (Oct 4, 2024):
I believe this isn't relevant anymore. The root issue was fixed elsewhere, this part of the function now behaves fine.
The
forloop issue mentioned above is probably an intentional choice, as I have noticed during debugging that many iterators use a special "end" element that denotes the end of iteration.I could be wrong though. @Sailanarmo do you have any additional input on it?
@Sailanarmo commented on GitHub (Oct 4, 2024):
@xezrunner I would go ahead and close this.