TASEmulators / TASEmulators/BizHawk

[🐧] Starting games with Mono 6.14 crashes after playing for some seconds

Open
#4,803 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Core: melonDS Repro: Affects 2.10 Repro: Affects 2.11.1 Reproducible bug
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Summary

On Linux, installing the latest available mono version (6.14, Fedora 44 defaults to 6.14 and downgrading is very very annoying) and running the latest versions of BizHawk, having a games running (tested on NDS games only) freeze both the game and BizHawk, hanging with some CPU usage, with absolutely no log.
I tested two different roms that crashed BizHawk the exact same way, using Fedora 44. A friend on Windows was able to run the same roms using BizHawk 2.11.1 without any issue.
I asked an another friend on NixOS to get BizHawk 2.11.1, get mono, and use the same ROM : it crashed the same way.
After some investigation we found out that building using nix-build from source prevents that problem, and the mono version used for the build is 6.12 instead of 6.14. Using distrobox with a fedora 43 (that uses mono 6.12 also fixes the issue)

nix-build way to fix (fedora)

dnf install nix
git clone https://github.com/TASEmulators/BizHawk
cd BizHawk
nix-build -A emuhawk-latest-bin
nix-store -qR ./result | grep -i mono # just to make sure the mono version is 6.12.x
./result/bin/emuhawk-monort-2.11.1

distrobox way to fix (fedora)

dnf install distrobox
distrobox create --name bizhawk-mono612 --image fedora:43
distrobox enter bizhawk-mono612
sudo dnf install mono-complete
mono --version # just to make sure it's 6.12.x
./BizHawk-2.11.1-linux-x64/EmuHawkMono.sh # from the given release

I tried also to play with Mono arguments, and from what I observed those two flags delays for a big the moment of the crash (it might take a minute or two instead of some seconds)

MONO_GC_PARAMS=nursery-size=64m,minor=simple MONO_THREADS_SUSPEND=preemptive

So there might be something going on with the garbage collector/mono threads?

Repro
  1. Be on Fedora 44 or any distro that pulls mono 6.14
  2. Use any NDS rom (I haven't tried if games other than DS ones hangs the same way)
  3. Start the rom, play for 2 to 45s ish and BizHawk will freeze, no logs.
Output

Unfortunately none.

Host env.
  • BizHawk 2.11.1; Fedora 44, Mono 6.14
  • BizHawk 2.10; Fedora 44, Mono 6.14
  • BizHawk 2.11.1; NixOS, Mono 6.14
Visual repro

A video that shows the issue on the TASVideos.org discord server

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

Start by reproducing the freeze with BizHawk 2.11.1 on Fedora 44 using Mono 6.14, then compare it with the nix-build or Fedora 43 setup using Mono 6.12 described in the issue. Check the Mono-related runtime and build configuration involved in launching EmuHawkMono.sh, and use the NDS reproduction steps to validate any change. Done means NDS games no longer freeze BizHawk under Mono 6.14.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.