libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.76k stars 1.77k forks source link

Can't launch content on certain cores if rewind is on. #8525

Open PKGaspi opened 5 years ago

PKGaspi commented 5 years ago

Description

Certain cores (tested with Dolphin and PPSSPP) crash on content startup if rewind is activated on RetroArchs configuration. I understand that those cores may not be compatible with the rewind feature, but making the user change the configuration every time they launch is it in my opinion not the correct solution. Not even a specific error is shown to the user, just a straight crash.

Expected behavior

Launch the core regardless of the configuration with rewind turned off for this session.

Actual behavior

The content doesn't launch and RetroArch closes.

Steps to reproduce the bug

  1. Open RetroArch.
  2. Toggle rewind functionality on in the config.
  3. Load the core (only tested with Dolphin and PPSSPP, might be more with the issue)
  4. Load content for the core.
  5. RetroArch closes.

Bisect Results

[Try to bisect and tell us when this started happening]

Version/Commit

Environment information

orbea commented 5 years ago

Its crashing here too on Linux, but I haven't gotten around to trying to figure out why. Its likely a core issue, but getting a backtrace with debugging symbols for both the core and RetroArch will be helpful.

Its a known issue with ppsspp-libretro at least that the save state implementation is buggy and tends to crash. This could be the same issue or related to this.

https://github.com/hrydgard/ppsspp/issues/11429

i30817 commented 5 years ago

I believe there are several problems with savestates early on emulator boot for many cores.

I remember reading about (but not the issue numbers) of problems with loading states on boot (from the option to restore the last savestate automatically) and netplay problems, so it's not surprising that rewind also has problems.

Maybe because some cores depend on the bios being fully initialized or something weird like that.

edit: your link dev hypothesis about concurrent savestate and JIT execution in retroarch scares me. A risk of trying to externalize savestates and other features is definitely the cores mutexes doing nothing to protect what they should.