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

Metal Gear Solid 4 - VirtualProtect failed #16443

Open
Auresalia opened this issue Dec 21, 2024 · 14 comments
Open

Metal Gear Solid 4 - VirtualProtect failed #16443

Auresalia opened this issue Dec 21, 2024 · 14 comments
Assignees
Labels

Comments

@Auresalia
Copy link

Quick summary

Upon exiting the pause menu, the game will almost always freeze, requiring RPCS3 to be forcefully terminated via the Task Manager. The log shows the following error:

F 0:01:20.328470 {RSX [0x0025884]} SIG: Thread terminated due to fatal error: VirtualProtect failed (0000000368107000, 0x1000, addr=0x368107000, error=Attempt to access invalid address. (0x1e7))
(in file D:\a\1\s\rpcs3\util\vm_native.cpp:418[:25], in function void __cdecl utils::memory_protect(void *,unsigned __int64,enum utils::protection)) (error=0x1e7)

Details

Once the pause menu animation finishes, the game will freeze, occasionally still playing audio. The framerate counter still updates as well.

I've tried various combinations of settings, but nothing that I've seen online has worked-- at most, some things like changing max VRAM limits or increasing Driver Wake-Up Delay allow the pause menu exit to function normally for a few times, before the same error begins happening all over again. I've also tried using both the latest PS3 firmware, as well as the one that shipped with the game (4.11). I've attached a log file of the error happening.

Attach a log file

RPCS3_MGS4.log

Attach capture files for visual issues

No response

System configuration

CPU: AMD Ryzen 9 7950X
RAM: 64.0 GB
GPU: NVIDIA RTX 3090
GPU Driver Version: 566.36
RPCS3 Version: 0.0.34-17228-beb35650

Other details

No response

@Zonrotan
Copy link

Can confirm I'm having the exact same issue.
Issue appeared after updating RPCS3, nothing else changed.
Last time i can confirm it worked was about 30 days ago.

@FlexBy420
Copy link
Contributor

If it is a regression you need to post both logs from a last working build and the one that broke it

@Auresalia
Copy link
Author

For me, this is not something that was working in a previous build. I originally encountered this issue on a build that was almost two years old, and it persisted after updating to the last two releases. If someone can provide a log of a working build, or at least the release number so I can test on my own machine, that would be appreciated.

@Zonrotan
Copy link

If it is a regression you need to post both logs from a last working build and the one that broke it

Just tested with a ~2 week build, worked great.
See attached logs.
v0.0.34-17173_RPCS3.log
v0.0.34-17229_RPCS3.log

For me, this is not something that was working in a previous build. I originally encountered this issue on a build that was almost two years old, and it persisted after updating to the last two releases. If someone can provide a log of a working build, or at least the release number so I can test on my own machine, that would be appreciated.

Try 17173.

@kd-11
Copy link
Contributor

kd-11 commented Dec 22, 2024

@Zonrotan
The only addition to core behavior has been an RSX optimization patch. There is an option in advanced tab to disable the speedup, try disabling "asynchronous host memory manager". Check if that fixes the crash for you with current rpcs3 master.

@Zonrotan
Copy link

@Zonrotan The only addition to core behavior has been an RSX optimization patch. There is an option in advanced tab to disable the speedup, try disabling "asynchronous host memory manager". Check if that fixes the crash for you with current rpcs3 master.

Quick tests point to this being the issue! Checking "Disable Asynchronous Memory Manager" seems to have fixed the issue when playing on the latest build. Thank you kd!
image

@kd-11
Copy link
Contributor

kd-11 commented Dec 22, 2024

Thanks for checking. I'll check why it's sensitive to that optimization.

@kd-11 kd-11 self-assigned this Dec 22, 2024
@kd-11 kd-11 added the Bug label Dec 22, 2024
@Satan86
Copy link

Satan86 commented Dec 22, 2024

Hello. I would like to inform that Gran Turismo 5 is also affected by this crash. I am unable to test right now, but I got this log from a user on the RPCS3 Discord, others have already reported it as well.
RPCS3-1.log

@kd-11
Copy link
Contributor

kd-11 commented Dec 22, 2024

@Satan86 And the crash goes away when checking the option, right? Let's get confirmation of that as well.

@JellySnek
Copy link

JellySnek commented Dec 22, 2024

@Satan86 And the crash goes away when checking the option, right? Let's get confirmation of that as well.

Confirmed. After entering a race in arcade mode, not even completing the race, watching replay for a little bit, then trying to return to the menu, the game crashes. Disabling Async Memory Manager, allows me to exit the race to menu. Tested two exact scenarios, same map, same time of day, same car, same amount driven before exiting. The only difference was async memory manager being enabled or disabled.

Also above scenario allows you to reproduce this issue 100% of the time. I've tested this three times before figuring out it was Async Memory Manager, in all cases, the game crashed upon exiting the race when Async Memory Manager was enabled. Only seeing this topic allowed me to see what was the issue.

The game crashes with:
·F 0:06:24.009095 {RSX [0x0010080]} SIG: Thread terminated due to fatal error: VirtualProtect failed (000000034273a000, 0x1000, addr=0x34273a000, error=Próbowano uzyskać dostęp do nieprawidłowego adresu. (0x1e7)) (in file D:\a\1\s\rpcs3\util\vm_native.cpp:418[:25], in function void __cdecl utils::memory_protect(void *,unsigned __int64,enum utils::protection)) (error=0x1e7)

RPCS3.log

Slightly unrelated but it seems like running GT5 on 1280x1080p and resolution scaling higher than 100% seems to improve performance significantly than running 1280x720 and upscaling it.

@BronyUraj
Copy link

After the RPCS3 update, MGS4 stopped working. The emulator crashes on launch. Enabling the Disable Async Memory Manager option didn't help. The Canary patch was also applied, but it doesn't appear in the log.

RPCS3.log

CPU: AMD Ryzen 7 7700X
GPU: NVIDIA GeForce RTX 4080 (566.36)

@BronyUraj
Copy link

Downgrading build to 17229 helps! Game's working now.

@Auresalia
Copy link
Author

Confirmed that disabling Asynchronous Memory Manager resolved the issue for me-- I guess that I didn't think to try that setting while I was experimenting.

@Lumanator
Copy link

Ridge Racer 7 also suffered a similar regression. For me, the Bandai Namco logo appeared before it crashed to desktop.

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

No branches or pull requests

8 participants