libretro / dolphin

Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.
https://dolphin-emu.org/
GNU General Public License v2.0
86 stars 68 forks source link

RetroArch crashes/hangs when dual core is disabled (`CPUThread = False`) #235

Open bslenul opened 3 years ago

bslenul commented 3 years ago

Hey!

Probably a known issue but couldn't find any issue about it, when CPUThread = False is used (which means "Dual Core" option disabled), RetroArch will either crash or hang on load. This is used in some games like the Contra and Castlevania Rebirth games, House of the Dead - Overkill, Sonic Adventure 2 - Battle and probably others.

Crash logs:

4ffaf05 built with Debug config, to generate the crash logs I had to use a RetroArch version built with DrMingGW, which triggers this popup on crash:

image

For Contra and Castlevania, the popup closes almost immediately and the crash logs are created, for House of the Dead and Sonic however I have to click "Retry" or else the crash logs are not created.

^ That's on Windows 10, I tried a few things on my Linux VM but it just hangs so nothing useful with gdb, I tried building RA with DEBUG=1 SANITIZER=address,undefined but still nothing, however I got something when building RA with DEBUG=1 SANITIZER=thread, I have absolutely no idea if it's helpful or not, but here: dolphin_asan_thread.log

bslenul commented 3 years ago

Games with CPUThread = False in their .ini file:

That's 24 games affected by this with our current "Sys" folder, if we were to update it some day it will be almost x2, I've found 46 results in current upstream .ini files.

Mr-Jake commented 3 years ago

I was looking into this and found a similar issue mentioned in the dolphin github. Apparently, the single core crash was reported in 4.0 and fixed in 4.0.1.

https://github.com/dolphin-emu/dolphin/commit/4e43ecb28d4eaea565d3912f277159c84fa463c9

https://github.com/dolphin-emu/dolphin/commit/6209067daa5121e383d173f7272bbf20bc108047

4.0 was a number of years ago, but I don't know if any of that code is in the libretro core. It may just be a coincidence that it is a single core crash and may not even be related to the libretro crash. But it may also be useful to see how Dolphin fixed the single core crash.

dukeblooders commented 3 years ago

Similar issues (for referencing) :

173

107

105

TheRhysWyrill commented 3 years ago

Games with CPUThread = False in their .ini file:

  • Super Hang-On (E5Z.ini)
  • Space Harrier (E62.ini)
  • Shinobi (E63.ini)
  • Golden Axe (E6W.ini)
  • Altered Beast (E6X.ini)
  • The Sims 2 (G4Z.ini)
  • Interactive Multi Game Demo Disc v4 (G96.ini)
  • Goblin Commander: Unleash the Horde (GGC.ini)
  • Second Sight (GIS.ini)
  • Sonic Adventure 2 Battle (GSN.ini)
  • Tony Hawk's Pro Skater 3 (GT3.ini)
  • WTA Tour Tennis (GWT.ini)
  • Harry Potter and The Order of The Phoenix (R5P.ini)
  • Disaster: Day of Crisis (RDZ.ini)
  • Densha de Go! Shinkansen EX Sanyou Shinkansen-hen (RG4.ini)
  • Harry Potter and The Half-Blood Prince (RH6.ini)
  • Wii Play (RHA.ini)
  • House Of The Dead: OVERKILL (RHO.ini)
  • NBA Live 08 (RNB.ini)
  • Wii Sports (RSP.ini)
  • Rapala Fishing Frenzy (RTB.ini)
  • CSI: Fatal Conspiracy (SCI.ini)
  • Castlevania: The Adventure ReBirth (WD9.ini)
  • Contra ReBirth (WKT.ini)

That's 24 games affected by this with our current "Sys" folder, if we were to update it some day it will be almost x2, I've found 46 results in current upstream .ini files.

In addition to the games you've listed there's also these:

Virtual Console:

GameCube:

Wii:

bslenul commented 3 years ago

My list is from the current assets from this repo only, like I said if we were to update the assets the list would grow up even more (I've found 46 results by searching in current standalone).

For example, Dual Core isn't disabled in Baten Kaitos: Eternal Wings and the Lost Ocean in the Libretro repo: https://github.com/libretro/dolphin/blob/master/Data/Sys/GameSettings/GKB.ini but it is in standalone: https://github.com/dolphin-emu/dolphin/blob/master/Data/Sys/GameSettings/GKB.ini

TheRhysWyrill commented 3 years ago

My list is from the current assets from this repo only, like I said if we were to update the assets the list would grow up even more (I've found 46 results by searching in current standalone).

For example, Dual Core isn't disabled in Baten Kaitos: Eternal Wings and the Lost Ocean in the Libretro repo: https://github.com/libretro/dolphin/blob/master/Data/Sys/GameSettings/GKB.ini but it is in standalone: https://github.com/dolphin-emu/dolphin/blob/master/Data/Sys/GameSettings/GKB.ini

Yeah my bad, missed that part, sorry. I just noticed that the list was different from mine but I'm using the GameSettings from standalone, in my list I have found that 48 games use the CPUThread line.

Tippek commented 3 years ago

Main problem is https://github.com/libretro/dolphin/blob/master/Source/Core/DolphinLibretro/Main.cpp#L255 This function only for Dual Core mode and I guess it's not designed works for Single Core mode. Need to change this thing.

ps I did some debug tests to confirm it