Golden Sun (GBA) Crashing
-
@MJLHThomassen said in Golden Sun (GBA) Crashing:
I'm starting to think its a bad ROM file.
It's a good idea to eliminate the rom itself as the cause as an early troubleshooting measure. Try locating one from a different source and see how it behaves.
-
I now tried several different ROM's, but they all have the same problem. Incidently, they also all have the same MD5 hash:
1c dd 7f 33 c9 a2 70 61 20 1e 1d 1c e0 29 a7 00
I now have a lr-mgba .state file which, if you load it, loads up the character in the world map with the "select" menu on. If you press B to exit the menu, then press B again and press down on the D-Pad to start "running down", it crashes immediately (if you dont press B to start running it works). You can download this state file here:
http://www.mediafire.com/file/12xe27558qr1k8w/Golden_Sun.state
I don't really know what else i can do to see whats going wrong here.
-
@MJLHThomassen said in Golden Sun (GBA) Crashing:
I now tried several different ROM's, but they all have the same problem. Incidently, they also all have the same MD5 hash:
1c dd 7f 33 c9 a2 70 61 20 1e 1d 1c e0 29 a7 00
I now have a lr-mgba .state file which, if you load it, loads up the character in the world map with the "select" menu on. If you press B to exit the menu, then press B again and press down on the D-Pad to start "running down", it crashes immediately (if you dont press B to start running it works). You can download this state file here:
http://www.mediafire.com/file/12xe27558qr1k8w/Golden_Sun.state
I don't really know what else i can do to see whats going wrong here.
i just uploaded this state to my pi3 and couldn't get it to load. it says 'Loaded state from slot 0' but the game just resets... i have the same hash and i just updated lr-mgba to the latest binary. not sure what could be going wrong. if i save another state it loads properly.
(all i was going to do is to run it via gdb to get a backtrace)
-
Thats strange. Obviously, it loads for me. I do have the "do not override saveram" option enabled, dont know if that has anything to do with it. I'm also on the latest version of mgba (i updated all the packages via the Retropie Setup tool).
I have another save state for you. For me this one crashes if i just walk around a bit on the world map:
http://www.mediafire.com/file/a08tn5w97w0el8g/Golden_Sun.state1Also, this is my saveram file:
http://www.mediafire.com/file/fgt8n13r4gu10u1/Golden_Sun.srmI have both files in the same directory as the rom file and RetroArch configured to load and save to and from the content dir for both saveram and states.
-
@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.