RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.33k stars 1.91k forks source link

[Regression] Pull Request #15618 locks up RPCS3 when running Motorstorm Apocalypse #15754

Closed 5kft closed 3 months ago

5kft commented 3 months ago

Quick summary

Pull request https://github.com/RPCS3/rpcs3/pull/15618 causes RPCS3 to lock up Motorstorm Apocalypse upon start of one of the race levels.

Details

This sounds similar to the issue reported here: https://github.com/RPCS3/rpcs3/issues/15645. In all builds prior to this change being introduced into RPCS3, Motorstorm Apocalypse works great. Now, all subsequent builds (including the latest v0.0.32-16648) completely lock up RPCS3 at the start of the level, necessitating that the RPCS3 process be killed from Task Manager.

The log file showing the hang is attached below. Every time I've tested this, there is a series of "{Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it XXXXµs already!" messages that are generated, until I manually kill the RPCS3 process:

·W 0:01:22.561732 {PPU[0x100000d] Thread (fios scheduler 4) [liblv2: 0x015e5ae0]} PPU: '_sys_lwcond_queue_wait' aborted (14.774661s)
·! 0:01:22.598683 {PPU[0x100000d] Thread (fios scheduler 4) [liblv2: 0x015e5ae0]} PERF: PPU thread perf stats are not available.
·! 0:01:22.598967 {PPU[0x100000d] Thread (fios scheduler 4) [liblv2: 0x015e5ae4]} PERF: PPU thread perf stats are not available.
·! 0:01:22.599546 {PPU[0x100000a] Thread (fios mediathread 5) [liblv2: 0x015e5ae0]} PERF: PPU thread perf stats are not available.
·! 0:01:22.599831 {PPU[0x100000a] Thread (fios mediathread 5) [liblv2: 0x015e5ae4]} PERF: PPU thread perf stats are not available.
·E 0:01:22.600106 {PPU[0x100000a] fios mediathread 5} SYS: Stat: 'sys_fs_opendir' failed with 0x80010006 : CELL_ENOENT, “/dev_hdd0/game/NPUA80661/USRDIR/data/trophiesandrewards” [x5]
·W 0:01:22.561780 {PPU[0x100001c] Thread (MultistreamSpursHdlr1) [libsre: 0x0165b50c]} PPU: 'sys_event_queue_receive' aborted (59.477763s)
·! 0:01:22.600640 {PPU[0x100001c] Thread (MultistreamSpursHdlr1) [libsre: 0x0165b50c]} PERF: PPU thread perf stats are not available.
·! 0:01:22.600927 {PPU[0x100001c] Thread (MultistreamSpursHdlr1) [libsre: 0x0165b510]} PERF: PPU thread perf stats are not available.
·! 0:01:22.576188 {PPU[0x1000000] main_thread} SIG: Thread time: 20.562500s (122.449533Gc); Faults: 1828 [rsx:1828, spu:0]; [soft:0 hard:0]; Switches:[vol:0 unvol:0]; Wait:[41.176s, spur:34]
·E 0:01:22.615878 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 46671.770µs already!
·E 0:01:22.654419 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 85212.780µs already!
·E 0:01:22.730998 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 161792.108µs already!
·E 0:01:22.885648 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 316443.910µs already!
·E 0:01:23.199450 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 630248.200µs already!
·E 0:01:23.815204 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 1246008.350µs already!
·E 0:01:25.058090 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 2488905.650µs already!
·E 0:01:27.535596 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 4966435.290µs already!
·E 0:01:32.520951 {Emulation Join Thread} SIG: Thread [rsx::thread] is too sleepy. Waiting for it 9951837.140µs already!

Build with regression

v0.0.32-16521-e9492831

Attach two log files

RPCS3-16519-works.zip

RPCS3-16521-hangs.zip

Attach capture files for visual issues

No response

System configuration

No response

Other details

No response

5kft commented 3 months ago

Hi @elad335 , @Megamouse - I went ahead and made a local build of RPCS3 to try to help narrow down this issue. The particular modification that causes the lockup is only the one made in rsx:reports::ZCULL_control, method write. If I revert this single modification, the lockup no longer happens and the game works fine:

image

The similar change made in RSXThread.cpp works fine - it's only the RSXZCULL.cpp change that causes the freeze.

From what I've seen in trying a number of games, this freeze problem only shows with Motorstorm Apocalypse. Given this, if the new logic here in RPCS3 is correct, might it make sense to make the disabling of this new logic a "Debug" option in RPCS3, or provide some other means by which this could be disabled/reverted for cases like this? It seems like this could be useful for the few games where this freeze problem occurs. Thoughts?

5kft commented 3 months ago

For the sake of completeness, here's the log of the run of my local RPCS3 build with the above reverted change, where I exited the emulator following where Motorstorm Apocalypse would normally lock up:

RPCS3-log-RSXZCULL-reverted-works.zip

elad335 commented 3 months ago

You can make a pull request if you'd like, iirc the original purpose of the pr was not met.

5kft commented 3 months ago

I just submitted a pull request to allow for working around this; I haven't looked into to how to modify the GUI configuration for this yet.

5kft commented 3 months ago

Fixed with https://github.com/RPCS3/rpcs3/commit/6ddb21ab958d6fb399f75340f6e48f13ec9df3b4.