hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.34k stars 2.18k forks source link

Gods Eater Burst (ULUS10563): Game crashes on startup if both Fast Memory and Multithreaded are enabled since v0.9.1-120-g3d0ad08 #3718

Closed solarmystic closed 10 years ago

solarmystic commented 11 years ago

Frankly, I'm not quite sure whether this is a legitimate issue, since both options mentioned in the title are experimental/unstable and still not quite ready for primetime yet; i.e. not options you'd recommend users enable across the board for all games.

To reiterate, enabling both Fast Memory (FastMem) and Multithreaded (MT) simultaneously will crash the game and the emulator after booting with a 100% success rate.

Git bisect traced the issue back to this commit v0.9.1-116-g4d9eb24 https://github.com/hrydgard/ppsspp/commit/4d9eb24f29ec85966c881a73f553221e946466cb which was merged into master from v0.9.1-120-g3d0ad08 https://github.com/hrydgard/ppsspp/commit/3d0ad08dd2f0ffb7b84b25a2feb2848695c88e91 onwards

Last unaffected revision is the one right before the commit got merged into master, v0.9.1-118-g99c1ab3 https://github.com/hrydgard/ppsspp/commit/99c1ab38d7cee56c1edd3900fcb4eeece5b50e4c

Problem reproduction:-

  1. Load any freshly downloaded/compiled PPSSPP revision from v0.9.1-120-g3d0ad08 onwards.
  2. Enable both Fast Memory and Multhreaded options in the system settings, default settings for others.
  3. Boot up Gods Eater Burst (ULUS10563)
  4. Game will immediately crash and take down the emulator with it, producing a Windows Error Report.

capture1

Stack trace from an affected debug build using MSVC 2010 (only Disassembly available):-

capture

Note:- It broke at the exact same point in both the release and debug builds' stacktrace.

Logfile from the first affected debug build until it crashes:- https://gist.github.com/solarmystic/6508692

Since the stack trace pointed to the Disassembly, it meant that the crash was most likely happening in JIT, so I disabled Dynarec (JIT) and tried to reproduce the issue again with both MT and FastMem enabled. Interestingly enough, the game did not crash in Interpreter Mode.

Caveats:-

  1. Happens on both 32 and 64 bit builds.
  2. Requires BOTH aforementioned options (FastMem and MT) to be enabled together. Having only one (either MT or FastMem individually) enabled without the other will NOT cause the crash.
  3. Requires JIT. Does not happen in Interpreter Mode even with both MT and Fastmem enabled.

Temporary solutions:-

  1. As alluded to earlier on in the issue report, just choose ONE optimization (Multithreaded or Fast Memory) for this game and it will not crash. I suspect that is what the majority of our users are doing at the moment anyway, since this has been going on for quite sometime (600+ revisions) and we've not heard a single issue report for this game in the ppsspp forums or on github until today.
  2. (Highly unrecommended if you're a Project Diva 2nd fan, and likely to be a roadblock on that point.) Reverting https://github.com/hrydgard/ppsspp/commit/4d9eb24f29ec85966c881a73f553221e946466cb by uncommenting that return line (now at line 610 in the GPUcommon.cpp file) also fixes the issue and allows you to have both Multithreaded and Fast Memory enabled again without crashing.
  3. (Don't bother) Disable JIT and the game will run with FastMem and Multithreaded enabled without crashing. Enjoy the slow as molasses gameplay.

Tested on a Core 2 Duo T9550 @ 2.8GHz, ATI Mobility Radeon 4670 and Windows 7 SP1 x64 machine.

unknownbrackets commented 11 years ago

Interesting. Adding back the return fixes a BREAK and invalid memory access. Hmm. I wonder what the right thing is.

-[Unknown]

thedax commented 10 years ago

This doesn't seem to be happening anymore on newer 0.9.5 builds, unless it's an ATI only thing.

Ritori commented 10 years ago

Yup it still happen if i tick both multithread and fastmemory and this happen on God Eater 2 too.

thedax commented 10 years ago

IIRC your laptop has an ATI/AMD GPU, right? So I guess that explains why I'm not seeing the crash.

Ritori commented 10 years ago

Yup you're right :D

solarmystic commented 10 years ago

Actually, I've just retested this again using the latest 64bit build from Orphis, v0.9.5-916-gf3a0193, and I can't reproduce this crash anymore; I can enable both FastMem and MT together now in Gods Eater Burst (the first game) without any crashes.

But it seems like @Ritori's still getting it, so I assume that the issue must still exist in some form.

@Ritori, can you retest Gods Eater Burst (the first game) again? Just to be sure.

dbz400 commented 10 years ago

AMD crashes but Nvidia not ? I'll test it out as well tonight.

Ritori commented 10 years ago

@solarmystic yup it still happen for me, i download latest 64bit version v0.9.5-925-g6277a95. Edit: ohh wait after i delete my old ppsspp.ini and start the game with both multithread and fast memory crash don't happen :D I think this can be close now.

unknownbrackets commented 10 years ago

Hmm, I wonder if some other setting impacts it?

-[Unknown]

solarmystic commented 10 years ago

@Ritori

Thanks for the report, I'll be closing this then.

Ritori commented 10 years ago

@unknownbrackets about other setting you said... I try to experiment some setting again and it crash.

The setting that crash this Game :- Fast Memory, Multithread, Timer hack, Texture coord speedhack all on = Crash

if one these setting off crash don't occur :) Someone can confirm it?

hrydgard commented 10 years ago

Timer hack is extremely dangerous and I think we should probably hide it.

Ritori commented 10 years ago

Okay i try experiment more setting look liked crash don't occur if i Off Prevent FPS from exceeding 60 with above post setting On. Edit :- I try experiment some other setting again look liked it randomly crash with randomly setting On and Off..