libretro / libretro/RetroArch

RA/SwanStation opens handles and doesn't close them when RunAhead is active

Open
#15,729 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

With Internal Run-Ahead active handles to .mcd Memory Card files are opened but never closed.

Expected behavior

close opened handles

Actual behavior

Handles to .mcd files are opened and never closed.
It seems to be based on how the game handles memory card loading. In Parasite Eve it opens those handles on every key press.

After a while the limit is reached (on macOS the default is 256) and nothing can be saved anymore, this includes RetroAchivements.

Steps to reproduce the bug
  • In SwanStation Advanced core settings set Internal RunAhead to 2 frames.
  • Restart RetroArch
  • Play Parasite Eve (somehow this game triggers it more than other games)

run something like lsof -p "$(pgrep RetroArch)" -r 2 to see the open handles growing on each key press.

Version/Commit
  • RetroArch: 1.15 stable
  • RetroArch: 1.16 stable
  • SwanStation latest
    It happens with the native AppleSilicon version and with the x86 version running through Rosetta.
Environment information
  • OS: macOS 13.6
  • MacBook Air M1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce on macOS with Internal Run-Ahead set to 2 frames, using the Parasite Eve steps and the lsof command to confirm that .mcd handles grow per key press. Trace the SwanStation memory-card loading path under RetroArch's Run-Ahead flow; done means opened handles are closed and repeated input no longer exhausts the process limit or prevents saves.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.