scp-fs2open / scp-fs2open/fs2open.github.com

Getting random Assert: "Player_start_shipnum != -1"

Open
#5,728 1 comment 0 reactions 0 assignees View on GitHub
bug general modding
Dominant language
C++
Stars
487
Forks
184
PR merge metrics
PR metrics pending

Description

In BtA2, on mission load this assert is triggered, seemingly randomly. It most often seems to happen when the mission is loaded and then quit, aborted, or crashed in some way. I've spent many hours over the course of a few weeks trying to figure out how we can get here without the player ship having been created and can't seem to track it down. It's *probably* something to do with SCPUI's loadout handler script but without more data, I'm not sure what to fix or change.

I'm guessing it might be related to whatever FSO does to speed up subsequent mission loads of the same mission because I can switch to different mission and come back and the assert is gone. Also playing a release build, obviously works, but then coming back with a debug after that clears out whatever was going on because the assert won't trigger then either.

Here's the relevant stack trace.

> Assert: "Player_start_shipnum != -1"
> File: missionparse.cpp
> Line: 6212
>
> ntdll.dll! NtWaitForSingleObject + 20 bytes
> KERNELBASE.dll! WaitForSingleObjectEx + 142 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! dump_stacktrace + 283 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! os::dialogs::AssertMessage + 839 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! post_process_mission + 311 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! parse_mission + 3272 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! parse_main + 521 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! mission_load + 502 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_start_mission + 238 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_enter_state + 1704 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! gameseq_set_state + 302 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_process_event + 233 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_main + 991 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! SDL_main + 343 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! main_getcmdline + 245 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! invoke_main + 50 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! __scrt_common_main_seh + 302 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! __scrt_common_main + 14 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! WinMainCRTStartup + 14 bytes
> KERNEL32.DLL! BaseThreadInitThunk + 29 bytes
> ntdll.dll! RtlUserThreadStart + 40 bytes
>
> [ This info is in the clipboard so you can paste it somewhere now ]
>
>
> Use Debug to break into Debugger, Exit will close the application.
>
> ntdll.dll! NtWaitForSingleObject + 20 bytes
> KERNELBASE.dll! WaitForSingleObjectEx + 142 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! dump_stacktrace + 283 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! os::dialogs::Error + 116 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! os::dialogs::AssertMessage + 1244 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! post_process_mission + 311 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! parse_mission + 3272 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! parse_main + 521 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! mission_load + 502 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_start_mission + 238 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_enter_state + 1704 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! gameseq_set_state + 302 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_process_event + 233 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! game_main + 991 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! SDL_main + 343 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! main_getcmdline + 245 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! invoke_main + 50 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! __scrt_common_main_seh + 302 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! __scrt_common_main + 14 bytes
> fs2_open_23_3_0_x64_AVX2-FASTDBG.exe! WinMainCRTStartup + 14 bytes
> KERNEL32.DLL! BaseThreadInitThunk + 29 bytes
> ntdll.dll! RtlUserThreadStart + 40 bytes
>

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.