Golden Sun (GBA) Crashing
-
@MJLHThomassen that one loads correctly but no inputs work (appears it's frozen?). i tried the sram option on/off. very strange. might be worth logging it as an issue here: https://github.com/libretro/mgba/issues
-
I have posted an issue:
https://github.com/libretro/mgba/issues/47
Its still strange that ive seen similar behavior on other emulators aswell. It is hard to reproduce as loading up another emulator and getting to a point in the game where the crashes happen (they dont happen in the intro) takes about an hour because the intro of the game is so long.
-
This post is deleted! -
@dankcushions I have an update on this. As the person in the issue suggested, i tried running this trough gdb, however, no crash occurred.
It only seems to occur if i launch trough EmulationStation. There is a log file (/dev/shm/runcommand.log, it is shown in the screen that is shown after you select the game in EmulationStation but before RetroArch launches, i dont know if this is an EmulationStation feature or a RetroPie only feature).Anyway, that log file shows the following:
Parameters: 0 _SYS_ gba /home/pi/RetroPie/roms/gba/Golden Sun.gba Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /dev/shm/retroarch.cfg /opt/retropie/supplementary/runcommand/runcommand.sh: line 854: 1434 Segmentation fault /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /dev/shm/retroarch.cfg
the appendconfig file only contains:
video_refresh_rate = 60
I'm going to investigate further...
-
@MJLHThomassen said in Golden Sun (GBA) Crashing:
Parameters: 0 SYS gba /home/pi/RetroPie/roms/gba/Golden Sun.gba
Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /dev/shm/retroarch.cfg
interesting! when you ran through GDB, did you run it with the same arguments? ie, in that log file it shows the command line it uses to launch the game:
/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /dev/shm/retroarch.cfg
i think if you want to use this command in the commandline, you will need to replace
--appendconfig /dev/shm/retroarch.cfg
with--appendconfig /opt/retropie/configs/all/retroarch.cfg
so, if you run via gdb, a direct comparison would be something like:
gdb --args /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /opt/retropie/configs/all/retroarch.cfg
with the same arguments i would expect the same results from both, but at least if that happens now you know the issue is caused by a cfg setting.
-
@dankcushions When I ran trough GDB i did not append the command. I ran with the command listed in the configs/gba/emulators.cfg file which is:
"/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-gpsp/gpsp_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg %ROM%"
Ill try to run it with the appendcommand aswell, see if the crash is reproducable then, thanks for the tip!
-
Update, I've tested running the commands several different ways now. All commands below are run from the command line. The /dev/shm/retroarch.cfg file exists and still contains just the one line:
video_refresh_rate = 60
/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /dev/shm/retroarch.cfg
- RetroArch loads
- I Press Select+L on my gamepad to load the (pre-bugged) state
- I "walk with my character"
- RetroArch crashes with
Segmentation Fault
(whenver i see those i cringe since they are usually impossible to debug :P)
/opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba"
- RetroArch loads
- I Press Select+L on my gamepad to load the (pre-bugged) state
- I "walk with my character"
- RetroArch crashes with
Segmentation Fault
gdb -ex=run --args /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba" --appendconfig /dev/shm/retroarch.cfg
- RetroArch loads
- I Press Select+L on my gamepad to load the (pre-bugged) state
- I "walk with my character"
- The game just plays, no crashes, everything is fine
gdb -ex=run --args /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mgba/mgba_libretro.so --config /opt/retropie/configs/gba/retroarch.cfg "/home/pi/RetroPie/roms/gba/Golden Sun.gba"
- RetroArch loads
- I Press Select+L on my gamepad to load the (pre-bugged) state
- I "walk with my character"
- The game just plays, no crashes, everything is fine
Ergo, whatever it is that GDB does, its causing the game to work haha, awesome impossible debug scenario. Also, the --appendconfig does not seem to make a difference.
-
the worst kind of bug! it could possibly be some sort of race condition http://stackoverflow.com/questions/4628521/segfault-only-when-not-using-debugger has some things to try. might be worth rebuilding retroarch and the gba emulator from source in case anything has been fixed recently.
-
@dankcushions
I've been able to get a coredump and backtrace. For more information see here: https://github.com/libretro/mgba/issues/47Thanks for your help so far!
(BTW, my temp fix/hack is to add "gdb -ex=run --args " in front of the emulator line in my emulators.cfg file haha)
-
Sorry for breaking into this topic without anything useful to say, but I was wondering if you had found a solution for this yet. I am having the exact same problem on my Pi 3B. I tried your "temp fix" by adding "gdb -ex=run --args " in front of the emulator line and it did prevent the crashes from happening. The only problem it adds is that I can't get back to the RetroPie menu by pressing start+select. It just gives me the 'Launching Golden Sun (lr-mgba) ...' screen again and that's it. Doesn't respond to anything but a ctrl+c.
Thanks in advance...
-
Yes, I've also fixed that, forgot to post it. Thats because by default gdb keeps running when you close the program its debugging.
You need to change -ex=run into --eval-command=run --eval-command=quitSo your config file argument becomes: gdb --eval-command=run --eval-command=quit --args <everything that was there originally here>
(also see post here: http://stackoverflow.com/questions/8657648/how-to-have-gdb-exit-if-program-succeeds-break-if-program-crashes)
Keep in mind this is still a hack/workaround, the problem should be fixed in the emulator.
-
Thanks a lot! You are right, this is indeed a workaround and not a solution. But I am glad that I am able to play it again (hoping there's no more hidden crashes later in the game!)
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.