HurricanGame / Hurrican

Freeware jump and shoot game created by Poke53280, based on the Turrican game series by Manfred Trenz
62 stars 22 forks source link

Game crashes when saving after first level #36

Closed Silicomancer closed 1 year ago

Silicomancer commented 1 year ago

I played the game (latest flatpak) on Kubuntu 22.04 using keyboard. When finishing the first level, a list of empty entries for game saving appeared. I pressed the Return key to save the game. The game crashed which means it disappeared immediately without any error message.

This is the end of the game log:

-> Load Level : jungle.map successful ! <-

Loaded song file /app/share/hurrican//data/music/JungleBeats.it
Loaded song file /app/share/hurrican//data/music/boss_robofist.it
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
drfiemost commented 1 year ago

Hard to tell without a backtrace. Even if the save location is read only it should not crash. Can you check the "Using save path" from the log?

Silicomancer commented 1 year ago

Sure, I am glad to help:

--> Using external config path '/home/myusername/.var/app/io.github.hurricangame.hurrican/config/hurrican' <--
--> Using external storage path '/app/share/hurrican/' <--
--> Using save path '/home/myusername/.var/app/io.github.hurricangame.hurrican/data/hurrican' <--

The save path does exist. And it contains only one file named "Hurrican.hsl" (size 480 byte).

Is there a way to get the backtrace?

drfiemost commented 1 year ago

You should run the app through gdb then use the bt command to print a backtrace after the crash, instructions here: https://docs.flatpak.org/en/latest/debugging.html

It would be very useful, I'm not able to reproduce the crash.

Silicomancer commented 1 year ago
flatpak run --command=sh --devel io.github.hurricangame.hurrican
Error: runtime/org.freedesktop.Sdk/x86_64/22.08 is not installed

I guess I need to install that SDK first? Like this?

flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08

drfiemost commented 1 year ago

Yes, it includes gdb among other things. I think you also need to install the hurrican .Debug package if available.

Silicomancer commented 1 year ago

Still something wrong:

Succeeded: flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08

Succeeded: flatpak install flathub io.github.hurricangame.hurrican.Debug

Failed:

flatpak run --command=sh --devel io.github.hurricangame.hurrican.Debug
bwrap: execvp sh: No such file or directory
Silicomancer commented 1 year ago

Anyway starting flatpak without ".Debug" worked. This is what I got:

Loaded song file /app/share/hurrican//data/music/JungleBeats.it
Loaded song file /app/share/hurrican//data/music/boss_robofist.it
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
save games loaded
*** buffer overflow detected ***: terminated

Thread 1 "hurrican" received signal SIGABRT, Aborted.
0x00007ffff754d184 in __pthread_kill_implementation () from /usr/lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff754d184 in __pthread_kill_implementation () from /usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff74fb00e in raise () from /usr/lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff74e47fc in abort () from /usr/lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff7540c1e in __libc_message () from /usr/lib/x86_64-linux-gnu/libc.so.6
#4  0x00007ffff75e3c1a in __fortify_fail () from /usr/lib/x86_64-linux-gnu/libc.so.6
#5  0x00007ffff75e2594 in __chk_fail () from /usr/lib/x86_64-linux-gnu/libc.so.6
#6  0x00007ffff75e1e75 in __strcpy_chk () from /usr/lib/x86_64-linux-gnu/libc.so.6
#7  0x00005555555eb6af in strcpy (__src=<optimized out>, __dest=0x7fffffffd450 "\030\275\261XUU") at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:79
#8  strcpy_s (src=<optimized out>, dst=0x7fffffffd450 "\030\275\261XUU") at /run/build/hurrican/Hurrican/src/SDLPort/SDL_port.cpp:53
#9  MenuClass::DoMenu (this=<optimized out>) at /run/build/hurrican/Hurrican/src/Menu.cpp:2178
#10 0x000055555556e488 in Heartbeat () at /run/build/hurrican/Hurrican/src/Main.cpp:868
#11 main (argc=<optimized out>, argv=<optimized out>) at /run/build/hurrican/Hurrican/src/Main.cpp:414
(gdb) 

Does this help?

drfiemost commented 1 year ago

Yes thanks! I can see the problem now, will hopefully push a fix over the weekend.

BTW the debug package only contains debugging symbols, it's not an executable.

drfiemost commented 1 year ago

Fixed! @Silicomancer thanks for taking the time debugging the issue @thrimbor can you please update the flatpack build?

thrimbor commented 1 year ago

Done.

Silicomancer commented 1 year ago

Works for me now. Thank you!