dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

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

Open bslenul opened this issue 3 years ago • 7 comments

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:

  • Contra and Castlevania Rebirth: CV-Contra.log
  • House of the Dead - Overkill and Sonic Adventure 2 - Battle: HotD-S2.log

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 avatar Sep 27 '21 13:09 bslenul

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.

bslenul avatar Sep 30 '21 22:09 bslenul

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.

Mr-Jake avatar Oct 20 '21 00:10 Mr-Jake

Similar issues (for referencing) :

#173 #107 #105

dukeblooders avatar Oct 20 '21 15:10 dukeblooders

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:

  • Panel de Pon - JBO.ini
  • Pitfall: The Mayan Adventure - MCV.ini
  • Pulseman - MBA.ini
  • Revenge of Shinobi - MCY.ini

GameCube:

  • Baten Kaitos: Eternal Wings and the Lost Ocean - GKB.ini
  • Bratz: Forever Diamondz - GVD.ini
  • Bratz: Rock Angelz - GR6.ini
  • Scooby-Doo! Night of 100 Frights - GIH.ini
  • SpongeBob SquarePants: Battle for Bikini Bottom - GQP.ini
  • The Incredibles - GIC.ini
  • The Incredibles: Rise of the Underminer - GIQ.ini
  • The SpongeBob SquarePants Movie - GGV.ini

Wii:

  • Bratz: The Movie - RB9.ini
  • Brunswick Pro Bowling - RBP.ini
  • Dance! It's Your Stage - S2D.ini
  • Hasbro Family Game Night 2 - R6X.ini
  • METAL SLUG Anthology - RML.ini
  • NBA Live 08 - RNB.ini
  • National Geographic Challenge - SNQ.ini
  • SNK Arcade Classics Volume 1 - RNC.ini
  • The Biggest Loser: Challenge - ST6.ini
  • The Garfield Show: Threat Of The Space Lasagna - SG7.ini
  • The King of Fighters Collection: The Orochi Saga - RKF.ini
  • The Sky Crawlers - RQR.ini
  • Wii Fit Plus and Wii Fit Plus Channel - RFP.ini

TheRhysWyrill avatar Nov 18 '21 13:11 TheRhysWyrill

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

bslenul avatar Nov 18 '21 14:11 bslenul

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.

TheRhysWyrill avatar Nov 18 '21 14:11 TheRhysWyrill

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

Tippek avatar Nov 20 '21 11:11 Tippek