BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

BizHawk Crashes after selecting a core like DOSBox

Open getCursorsExe opened this issue 3 years ago • 4 comments

Summary

If we try to select a libretro core like latest version of DOSBox Libretro Core, then BizHawk will crash right after we select it. If that was supposed to be as intended, then why the heck is the point of adding libretro feature!?

Repro

  1. Select "Open Advanced" in File
  2. Load latest version of DOSBox Libretro core
  3. BizHawk Crashes after we select it. Interstingly, this bypasses BizHawk crash handler, causing no error messages to appear.

If this is as intended, then BizHawk is supposed to crash after we launch a game, not before! What is even causing this and why!?

Host env.

BizHawk 2.6.2 Win10 BizHawk 2.4.2 Win10

getCursorsExe avatar Jun 11 '21 11:06 getCursorsExe

Used Visual Studio 2019 to check what is going on, and I then see, that BizHawk is "trying to access and read or write protected memory" (System.AccessViolationException). Excuse me, WHY BIZHAWK IS EVEN DOING THIS!?

image

getCursorsExe avatar Jun 15 '21 10:06 getCursorsExe

From the stacktrace, the problem seems to be with these unsafe operations. https://github.com/TASEmulators/BizHawk/blob/40c53e0c1f1238cf02089ffc8509ab43eba31229/src/BizHawk.Emulation.Cores/Libretro/LibretroApi.cs#L58-L62 The pointer returned by DllInit is either outside valid memory, or points to something that's not laid out as expected (CommStruct, line 174) causing that read to continue past the end of valid memory.

YoshiRulz avatar Jun 15 '21 19:06 YoshiRulz

This crash seems to happen in 32-bit cores, but also some 64-bit ones.

getCursorsExe avatar Jun 25 '21 09:06 getCursorsExe

Does this still occur in 2.9 dev?

CasualPokePlayer avatar May 26 '22 22:05 CasualPokePlayer

No.

getCursorsExe avatar Oct 26 '22 13:10 getCursorsExe

This indicates a regression from 2.5. Versions below it do not crash.

getCursorsExe avatar Nov 02 '22 19:11 getCursorsExe