2022-08-07 23:27 EDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002983FSSCPgameplaypublic2014-08-29 23:21
Assigned Tokarajorma 
Product Version3.7.1 
Target Version3.7.2Fixed in Version3.7.1 
Summary0002983: 'g' key to play last mission is broken
DescriptionNormally pressing "g" in the mainhall restarts the last mission played, skipping the briefing and going straight into the gameplay.

Now FSO crashes when "g" is pressed.
Steps To ReproduceStart FSO with a debug exec
Start a mission & exit straight away
Exit FSO (mandatory, if you just go back to the main hall there is no crash)
Restart FSO
Press "g" & FSO crashes
Additional InformationIssue was introduced by r10159.

$ git bisect good
ad1bef534422ea5dedfab5cf4bf96aeb8981384b is the first bad commit
commit ad1bef534422ea5dedfab5cf4bf96aeb8981384b
Author: Goober5000 <Goober5000@387891d4-d844-0410-90c0-e4c51a9137d3>
Date: Mon Nov 25 05:52:50 2013 +0000

    some things don't need to be re-inited every time you pause the game
    git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10159 387891d4-d844-0410-90c0-e4c51a9137d3

Looks like a null pointer dereference here:

Program received signal SIGSEGV, Segmentation fault.
0x00000000005540ff in hud_init_ballistic_index () at hud/hudtarget.cpp:1027
warning: Source file is more recent than executable.
(gdb) bt
# 0 0x00000000005540ff in hud_init_ballistic_index () at hud/hudtarget.cpp:1027
# 1 0x0000000000525218 in set_current_hud () at hud/hudparse.cpp:637
# 2 0x00000000004176f1 in game_enter_state (old_state=1, new_state=2) at freespace2/freespace.cpp:6083
# 3 0x00000000004bec5c in gameseq_set_state (new_state=2, override=1) at gamesequence/gamesequence.cpp:284
# 4 0x000000000041648d in game_process_event (current_state=1, event=2) at freespace2/freespace.cpp:5164
# 5 0x00000000004bf140 in gameseq_process_events () at gamesequence/gamesequence.cpp:399
# 6 0x0000000000418cd2 in game_main (cmdline=0x21e8360 "") at freespace2/freespace.cpp:7061
# 7 0x0000000000418ed2 in main (argc=1, argv=0x7fffffffe2b8) at freespace2/freespace.cpp:7195
(gdb) print Player_ship
$1 = (ship *) 0x0

1021? void hud_init_ballistic_index()
1022? {
1023? int i;
1025? // decide whether to realign HUD for ballistic primaries
1026? ballistic_hud_index = 0;
1027?> for (i = 0; i < Player_ship->weapons.num_primary_banks; i++)
TagsNo tags attached.
Attached Files




m_m (developer)

I can't reproduce this crash on Windows, maybe it was fixed by a recent commit or this is an isolated issue of linux.


niffiwan (developer)

Last edited: 2013-12-21 05:00

View 2 revisions

thanks for the info, I double checked the steps to reproduce using r10253 and the problem still occurs for me. This did let me clarify that I have to exit FSO for it to manifest, if I just go back to the mainhall without exiting it doesn't occur.

(kinda makes sense, presumably that pointer is set correctly the 1st time a mission loads normally)

edit: and it took a while, but just checked on my Windows slowtop and I was able to reproduce the problem using the latest nightly.


m_m (developer)

Ok, restarting the game now also triggers this for me.
It looks like mission_load() is not called before we enter the gameplay state.


m_m (developer)

Moving the lines added in revision r10159 down after the game_start_mission() call fixes this issue although there are still severe issues with being the the gameplay state when the loading a mission especially with scripting. We should probably introduce a new mission load state so fix all these issues.


niffiwan (developer)

I think you may have fixed this in r10471?


karajorma (administrator)

I committed a change which prevents the game from crashing and (at least in the case of Diaspora) allows the g key to work. I'm not 100% certain it doesn't add issues itself.


karajorma (administrator)

Is this still causing anyone issues after I fixed it?


niffiwan (developer)

It's worked OK for me for a few trivial test missions.


MageKing17 (developer)

Now that 'g' actually does something again (r11027), I can confirm that this issue appears to be resolved.

-Issue History
Date Modified Username Field Change
2013-12-20 23:09 niffiwan New Issue
2013-12-20 23:18 niffiwan Additional Information Updated View Revisions
2013-12-21 03:10 m_m Note Added: 0015524
2013-12-21 04:26 niffiwan Steps to Reproduce Updated View Revisions
2013-12-21 04:28 niffiwan Note Added: 0015525
2013-12-21 05:00 niffiwan Note Edited: 0015525 View Revisions
2013-12-21 05:25 m_m Note Added: 0015526
2013-12-21 06:43 m_m Note Added: 0015527
2014-03-14 00:42 niffiwan Assigned To => karajorma
2014-03-14 00:42 niffiwan Status new => assigned
2014-03-14 00:42 niffiwan Note Added: 0015657
2014-03-14 00:49 karajorma Note Added: 0015658
2014-03-15 23:44 karajorma Note Added: 0015662
2014-03-16 06:43 niffiwan Note Added: 0015663
2014-08-23 23:51 MageKing17 Note Added: 0016251
2014-08-29 23:21 karajorma Status assigned => resolved
2014-08-29 23:21 karajorma Fixed in Version => 3.7.1
2014-08-29 23:21 karajorma Resolution open => fixed
+Issue History