Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPU Giga block bounds check #16722

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cipherxof
Copy link
Contributor

@cipherxof cipherxof commented Feb 17, 2025

The emulator was crashing when accessing bb.target[0] of an empty vector. This code previously used std::basic_string which probably just returned some garbage value or zero without throwing an exception.

Addresses: #16715 (and probably #16654)

@elad335 elad335 self-requested a review February 17, 2025 06:18
@elad335
Copy link
Contributor

elad335 commented Feb 17, 2025

Please upload a log with this build.
I have a suspicion as to why it happens.
The bug was there, before #16261, was just hidden because string allows to access the element at size().

@elad335
Copy link
Contributor

elad335 commented Feb 17, 2025

Test with #16723 too

@cipherxof
Copy link
Contributor Author

Test with #16723 too

This PR: RPCS3.log
PR 16723: RPCS3.log (still crashes)

@digant73
Copy link
Contributor

digant73 commented Feb 19, 2025

if you are able to compile RPCS3 in DEBUG mode (I use VS 2022 on Win 11), you should get an out of bound error message when booting a game during the PPU compilation. Probably there are other issues not yet fixed caused by PR #16261 or the following PRs. In the past this issue was not present

@cipherxof
Copy link
Contributor Author

cipherxof commented Feb 19, 2025

if you are able to compile RPCS3 in DEBUG mode (I use VS 2022 on Win 11), you should get an out of bound error message when booting a game during the PPU compilation. Probably there are other issues not yet fixed caused by PR #16261 or the following PRs. In the past this issue was not present

I do not get any errors while compiling PPU modules. It probably only triggers under certain circumstances like with giga spu. I can look for potential areas later, although this PR is likely not fixing the root cause as the previous code with basic_string was masking some underlying issue. Still, it probably makes sense to have some bounds checking.

@digant73
Copy link
Contributor

if you are able to compile RPCS3 in DEBUG mode (I use VS 2022 on Win 11), you should get an out of bound error message when booting a game during the PPU compilation. Probably there are other issues not yet fixed caused by PR #16261 or the following PRs. In the past this issue was not present

I do not get any errors while compiling PPU modules. It probably only triggers under certain circumstances like with giga spu. I can look for potential areas later, although this PR is likely not fixing the root cause as the previous code with basic_string was masking some underlying issue. Still, it probably makes sense to have some bounds checking.

I tested on Resistance 3 and got the error. SPU (on CPU tab) set to Mega. As I said the error is reported with RPCS3 compiled in DEBUG mode. In RELEASE mode there is no popup error displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants