libretro/mupen64plus-libretro-nx

Mach port leakage with ParaLLel on 2.5-Vulkan macOS core

acordier16 opened this issue · 2 comments

Hi,

I've noticed a Mach port leakage when using the Mupen64Plus-Next macOS core (2.5-Vulkan 90dae29), which ends up crashing the core and RetroArch. The OS has to send a SIGTERM because of the process hitting the per-process Mach port limit. This only happens with ParaLLel plugin (not with GLide)

I'm using MacOS Ventura 13.4. RetroArch logs do not show anything useful, as it is macOS that kills RetroArch.

Here's an excerpt of the MacOS "Console" log for the failure. This is coherent with what I observe in the "Activity Monitor", with a steadily increasing Mach ports usage, which results in a crash after a couple hours of play (for reference, the game is Zelda OOT NTSC v1.1).

"exception" : {"codes":"0x000000000004aaaa, 0x0000000000000000","rawCodes":[305834,0],"type":"EXC_RESOURCE","signal":"SIGKILL"},
  "termination" : {"flags":2,"code":14123288431434181290,"namespace":"PORT_SPACE","indicator":"(Limit 305834 ports) Exceeded system-wide per-process Port Limit"}

Useful links on Mach port leakages:

Looks like the problem was coming from MoltenVK! I did download the last release (1.3.250) from https://github.com/KhronosGroup/MoltenVK/releases/ and replaced it within the RetroArch.app folder, and all is good now, I guess this was linked with a memory leak that they mention in the changelog.

NB: it probably means that MoltenVK should be updated in RetroArch for macOS @m4xw, though this is probably not the right repository to ask this