2019-12-07 04:35 EST


View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002535FSSCPsoundpublic2011-11-05 03:08
Reporterm_m 
Assigned ToEchelon9 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.6.13 
Target VersionFixed in Version3.6.14 
Summary0002535: Game crashes in player select menu
DescriptionThe game crashes when the game switches to state GS_STATE_INITIAL_PLAYER_SELECT (see stacktrace below) as it tries to index the Sounds vector with an invalid index when it tries to play a looping sound (see sound.cpp, line 801).
This can be fixed by setting the game_snd id to -1 in its constructor so the vector doesn't get indexed, patch is attached.
Additional InformationStacktrace as generateded by Visual Studio:
> fs2_open_3_6_13d_INF_SSE2.exe!snd_play_looping(game_snd * gs=0x0c23f060, float pan=0.00000000, int start_loop=-1, int stop_loop=-1, float vol_scale=1.0000000, int scriptingUpdateVolume=1) Line 801 + 0x17 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!main_hall_start_ambient() Line 1482 + 0x34 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!player_select_init() Line 230 C++
     fs2_open_3_6_13d_INF_SSE2.exe!game_enter_state(int old_state=0, int new_state=37) Line 6378 C++
     fs2_open_3_6_13d_INF_SSE2.exe!gameseq_set_state(int new_state=37, int override=0) Line 282 + 0x18 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!game_process_event(int current_state=0, int event=49) Line 5438 + 0x9 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!gameseq_process_events() Line 397 + 0x19 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!game_main(char * cmdline=0x00303452) Line 7084 + 0x5 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * hPrev=0x00000000, char * szCmdLine=0x00303452, int nCmdShow=1) Line 7153 + 0x9 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!__tmainCRTStartup() Line 275 + 0x2c bytes C
     fs2_open_3_6_13d_INF_SSE2.exe!WinMainCRTStartup() Line 189 C
     kernel32.dll!7588ed6c()
     [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
     ntdll.dll!777537f5()
     ntdll.dll!777537c8()
TagsNo tags attached.
Attached Files
  • patch file icon sound.h.patch (393 bytes) 2011-11-04 09:28 -
    Index: code/sound/sound.h
    ===================================================================
    --- code/sound/sound.h	(revision 7943)
    +++ code/sound/sound.h	(working copy)
    @@ -46,7 +46,7 @@
     
     	game_snd( )
     		: sig ( 0 ), default_volume( 0 ),
    -		  preload( 0 ), id( 0 ), id_sig( 0 ), flags( 0 )
    +		  preload( 0 ), id( -1 ), id_sig( 0 ), flags( 0 )
     	{
     		filename[ 0 ] = NULL;
     		min = 0;
    
    patch file icon sound.h.patch (393 bytes) 2011-11-04 09:28 +
  • patch file icon gameSndStruct.svn.patch (1,718 bytes) 2011-11-04 13:40 -
    Index: code/sound/sound.h
    ===================================================================
    --- code/sound/sound.h
    +++ code/sound/sound.h
    @@ -33,24 +33,32 @@
     #define AAV_VOICE		1
     #define AAV_EFFECTS		2
     
    +/**
    + * Game level sound entities
    + */
     typedef struct game_snd
     {
    -	int	sig;						// index number of sound in as specified in sounds.tbl
    -	char	filename[MAX_FILENAME_LEN];
    -	float	default_volume;		// range: 0.0 -> 1.0
    -	int	min, max;				// min: distance at which sound will stop getting louder  max: distance at which sound is inaudible
    -	int	preload;					// preload sound (ie read from disk before mission starts)
    -	int	id;						// index into Sounds[], where sound data is stored
    -	int	id_sig;					// signature of Sounds[] element
    +	int	sig;						//!< index number of sound in as specified in sounds.tbl
    +	char filename[MAX_FILENAME_LEN];
    +	float default_volume;			//!<range: 0.0 -> 1.0
    +	int	min;						//!<distance at which sound will stop getting louder
    +	int max;						//!<distance at which sound is inaudible
    +	int	preload;					//!< preload sound (ie read from disk before mission starts)
    +	int	id;							//!< index into Sounds[], where sound data is stored
    +	int	id_sig;						//!< signature of Sounds[] element
     	int	flags;
     
     	game_snd( )
    -		: sig ( 0 ), default_volume( 0 ),
    -		  preload( 0 ), id( 0 ), id_sig( 0 ), flags( 0 )
    +		: sig ( -1 ),
    +		  default_volume( 0 ),
    +		  min( 0 ),
    +		  max( 0 ),
    +		  preload( 0 ),
    +		  id( -1 ),
    +		  id_sig( -1 ),
    +		  flags( 0 )
     	{
    -		filename[ 0 ] = NULL;
    -		min = 0;
    -		max = 0;
    +		filename[0] = 0;
     	}
     } game_snd;
     
    @@ -172,4 +180,4 @@ int sound_env_supported();
     // adjust-audio-volume
     void snd_aav_init();
     
    -#endif
    \ No newline at end of file
    +#endif
    
    patch file icon gameSndStruct.svn.patch (1,718 bytes) 2011-11-04 13:40 +

-Relationships
+Relationships

-Notes

~0012925

Eli2 (developer)

I had this change in a separate commit here on disk.
:/ i hope this fixes all problems.

~0012928

Echelon9 (developer)

Thanks both.
Fixed in http://svn.icculus.org/fs2open?view=rev&revision=7945
+Notes

-Issue History
Date Modified Username Field Change
2011-11-04 09:28 m_m New Issue
2011-11-04 09:28 m_m File Added: sound.h.patch
2011-11-04 13:40 Eli2 File Added: gameSndStruct.svn.patch
2011-11-04 13:41 Eli2 Note Added: 0012925
2011-11-05 03:08 Echelon9 Status new => assigned
2011-11-05 03:08 Echelon9 Assigned To => Echelon9
2011-11-05 03:08 Echelon9 Note Added: 0012928
2011-11-05 03:08 Echelon9 Status assigned => resolved
2011-11-05 03:08 Echelon9 Fixed in Version => 3.6.14
2011-11-05 03:08 Echelon9 Resolution open => fixed
+Issue History