Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash the game under 20 seconds #365

Open
danielah05 opened this issue Jul 7, 2020 · 8 comments
Open

Crash the game under 20 seconds #365

danielah05 opened this issue Jul 7, 2020 · 8 comments

Comments

@danielah05
Copy link
Contributor

Video of the bug: https://streamable.com/6j86na
Tested with newest nightly.
Tested with US, EU and JP.

How this bug works is that when you open "Copy File" as fast as possible when you go into the file select screen, the game does not detect that save data exists. From there if you go into "Check Score" and you select an empty save file, the game selects it. After that if you go into "Erase File" the game still thinks you have selected the save file and the prompt appears asking if you are sure that you want to delete your save file. Selecting "Yes" will make the game crash. My guess is because it's trying to delete something that doesn't exist.

@fgsfdsfgs
Copy link
Collaborator

fgsfdsfgs commented Jul 7, 2020

Sorry, but I can't reproduce that because I either can't manage to hit it in time or the issue lies somewhere else.
Can you try reproducing that under GDB? If you haven't used it before, assuming you're in msys2/windows,

pacman -S mingw-w64-x86_64-gdb
gdb ./build/us_pc/sm64.us.f3dex2e.exe

Then type r and press enter. Once it crashes tab back into GDB, type bt and press enter and paste what it says here.

@danielah05
Copy link
Contributor Author

(gdb) r
Starting program: E:\msys64\home\Daniel\sm64ex\build\us_pc\sm64.us.f3dex2e.exe
[New Thread 5908.0x2a34]
[New Thread 5908.0x2c4c]
[New Thread 5908.0x2708]
[New Thread 5908.0x291c]
[New Thread 5908.0x3138]
[New Thread 5908.0x20a4]
[Thread 5908.0x291c exited with code 0]
[Thread 5908.0x20a4 exited with code 0]
[Thread 5908.0x3138 exited with code 0]
[New Thread 5908.0x24cc]
[New Thread 5908.0x1064]
[New Thread 5908.0x2dd4]
[New Thread 5908.0x87c]
[New Thread 5908.0x66c]
[New Thread 5908.0x3680]
[New Thread 5908.0x13b8]
[New Thread 5908.0x83c]
[New Thread 5908.0x3420]
[New Thread 5908.0x1138]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00000000004a6577 in save_file_do_save ()
(gdb) bt
#0 0x00000000004a6577 in save_file_do_save ()
#1 0x00000000004bc9db in print_erase_menu_prompt ()
#2 0x00000000004bcb7b in erase_menu_display_message ()
#3 0x00000000004bcd32 in print_erase_menu_strings ()
#4 0x00000000004bdaee in geo_file_select_strings_and_menu_cursor ()
#5 0x00000000004a4739 in geo_process_node_and_siblings ()
#6 0x00000000004a4d69 in geo_process_node_and_siblings ()
#7 0x00000000004a5f92 in geo_process_root ()
#8 0x000000000040bbf3 in render_game ()
#9 0x0000000000406493 in level_script_execute ()
#10 0x0000000000446765 in game_loop_one_iteration ()
#11 0x00000000004c22f6 in produce_one_frame ()
#12 0x00000000004c9163 in gfx_sdl_main_loop ()
#13 0x00000000004c260d in main_func ()
#14 0x00000000004c268e in SDL_main ()
#15 0x0000000000516b0a in main_getcmdline ()
#16 0x00000000004013c1 in __tmainCRTStartup ()
at D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:335
#17 0x00000000004014d6 in WinMainCRTStartup ()
at D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:192

@fgsfdsfgs
Copy link
Collaborator

Well, that's something. Can you do a clean rebuild with DEBUG=1 and try it again?

@danielah05
Copy link
Contributor Author

(gdb) r
Starting program: E:\msys64\home\Daniel\sm64ex\build\us_pc\sm64.us.f3dex2e.exe
[New Thread 8676.0x214]
[New Thread 8676.0x2504]
[New Thread 8676.0x2a74]
[New Thread 8676.0xbb0]
[New Thread 8676.0x2780]
[New Thread 8676.0x34a0]
[Thread 8676.0xbb0 exited with code 0]
[Thread 8676.0x2780 exited with code 0]
[Thread 8676.0x34a0 exited with code 0]
[New Thread 8676.0x30d4]
[New Thread 8676.0x254c]
[New Thread 8676.0x29c0]
[New Thread 8676.0x588]
[New Thread 8676.0x3680]
[New Thread 8676.0xfc0]
[New Thread 8676.0x9c0]
[New Thread 8676.0x37e0]
[New Thread 8676.0x355c]
[New Thread 8676.0x2d90]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff9cf4c47a0 in msvcrt!memmove () from C:\Windows\System32\msvcrt.dll
(gdb) bt
#0 0x00007ff9cf4c47a0 in msvcrt!memmove ()
from C:\Windows\System32\msvcrt.dll
#1 0x00000000004d9ea1 in write_eeprom_savefile (file=4294967295, slot=0,
num=2) at src/game/save_file.c:153
#2 0x00000000004da758 in save_file_do_save (fileIndex=-1)
at src/game/save_file.c:364
#3 0x00000000004da7e2 in save_file_erase (fileIndex=-1)
at src/game/save_file.c:377
#4 0x00000000004f957b in print_erase_menu_prompt (x=90, y=190)
at src/menu/file_select.c:2191
#5 0x00000000004f98e1 in erase_menu_display_message (messageID=1 '\001')
at src/menu/file_select.c:2267
#6 0x00000000004f9a6a in print_erase_menu_strings ()
at src/menu/file_select.c:2353
#7 0x00000000004faac7 in print_file_select_strings ()
at src/menu/file_select.c:2735
#8 0x00000000004faba9 in geo_file_select_strings_and_menu_cursor (
callContext=1, node=0x1cbe848 <pool+43688>, mtx=0x1376920 )
at src/menu/file_select.c:2774
#9 0x00000000004d7c75 in geo_process_generated_list (
node=0x1cbe848 <pool+43688>) at src/game/rendering_graph_node.c:480
#10 0x00000000004d973e in geo_process_node_and_siblings (
firstNode=0x1cbe848 <pool+43688>) at src/game/rendering_graph_node.c:1010
#11 0x00000000004d6e1d in geo_process_master_list (
node=0x1cbe7a0 <pool+43520>) at src/game/rendering_graph_node.c:210
#12 0x00000000004d965c in geo_process_node_and_siblings (
firstNode=0x1cbe518 <pool+42872>) at src/game/rendering_graph_node.c:967
#13 0x00000000004d99e8 in geo_process_root (node=0x1cbe478 <pool+42712>,
b=0x0, c=0x0, clearColor=0) at src/game/rendering_graph_node.c:1069
#14 0x0000000000410d98 in render_game () at src/game/area.c:373
#15 0x0000000000408c6f in level_script_execute (
cmd=0x10c75c0 <level_main_menu_entry_1+448>)
at src/engine/level_script.c:873
#16 0x0000000000458998 in game_loop_one_iteration ()
at src/game/game_init.c:603
#17 0x00000000004ff73b in produce_one_frame () at src/pc/pc_main.c:94
#18 0x00000000005094e4 in gfx_sdl_main_loop (
run_one_game_iter=0x4ff5d4 <produce_one_frame>)
at src/pc/gfx/gfx_sdl2.c:246
#19 0x00000000004ffabb in main_func () at src/pc/pc_main.c:257
#20 0x00000000004ffae0 in SDL_main (argc=1, argv=0x2e343d0)
at src/pc/pc_main.c:267
#21 0x000000000056175a in main_getcmdline ()
#22 0x00000000004013c1 in __tmainCRTStartup ()
at D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:335
#23 0x00000000004014d6 in WinMainCRTStartup ()
at D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:192

@fgsfdsfgs
Copy link
Collaborator

fgsfdsfgs commented Jul 7, 2020

fileIndex=-1

Oh boy, how the fuck did that happen.

@fgsfdsfgs
Copy link
Collaborator

Can you check what happens with the latest nightly commit?

@danielah05
Copy link
Contributor Author

So sorry! I didn't see your comment until now.
Tested with the newest commit and the crash still seems to appear.
Without Debug: https://pastebin.com/Y1abfz66
With Debug: https://pastebin.com/9bHzENQ1

@fgsfdsfgs
Copy link
Collaborator

Yeah that's about what I expected. At least it shouldn't affect the save now.

djoslin0 pushed a commit to djoslin0/sm64ex-coop that referenced this issue Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants