View Issue Details

IDProjectCategoryView StatusLast Update
0000502FSSCPFRED graphicspublic2005-08-08 02:22
ReporterFractux Assigned Totaylor  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
PlatformPCOSFedora CoreOS Version4
Summary0000502: ship-vanish SEXP causing CTD
DescriptionIn Transcend mission: TransE2M2.fs2 "Sudden Silence"

After the event asplode -> ship-vanish occurs, a CTD happens when the remaining ship (the Generation - a deimos class) is set to depart.

The game crahes and the error given is:

ASSERTION FAILED: "shipp->objnum != -1" at mission/missionparse.cpp:5824
/usr/local/bin/fs2: line 7: 8303 Aborted
 
Steps To ReproduceFS2_open: tested using WMC's linux build and latest CVS build.
Additional InformationIn testing this, I found that if I changed the ship-vanish SEXP in the mission to self-destruct, there was no problem, hence why I think the ship-vanish SEXP is the cause.
TagsNo tags attached.

Activities

Fractux

2005-08-07 02:09

reporter   ~0002940

This doesn't show up in the simple view, so I'll add it again here.

I was testing using WMC's linux build and the latest CVS build.

2005-08-07 03:37

 

TransE2M2.fs2 (44,597 bytes)

taylor

2005-08-07 08:12

administrator   ~0002942

We just need to make sure that when a ship vanishes it's wing gets cleaned up properly. The current/original code didn't handle vanished ships that are part of a wing (partial list) which is why this is happening.

I'm not going to have time to properly test this until later tomorrow so here is a diff for you to try. If it works and doesn't appear to cause any problems with other missions then let me know and I'll go ahead and commit it.

2005-08-07 08:13

 

vanish_wing.diff (874 bytes)   
Index: code/ship/ship.cpp
===================================================================
RCS file: /home/fs2source/cvsroot/fs2_open/code/ship/ship.cpp,v
retrieving revision 2.217
diff -u -r2.217 ship.cpp
--- code/ship/ship.cpp	30 Jul 2005 22:34:42 -0000	2.217
+++ code/ship/ship.cpp	7 Aug 2005 09:04:51 -0000
@@ -5271,6 +5271,15 @@
 			hud_set_wingman_status_departed(sp->wing_status_wing_index, sp->wing_status_wing_pos);
 		}
 
+		// if ship belongs to a wing -- increment the total number of ships in the wing vanished
+		if ( sp->wingnum != -1 ) {
+			wing *wingp;
+
+			wingp = &Wings[sp->wingnum];
+			// don't increment as a destroyed ship since that would make it logged
+			ship_wing_cleanup( objp->instance, wingp );
+		}
+
 		ai_ship_destroy(objp->instance, SEF_DEPARTED);		// should still do AI cleanup after ship has departed
 		ship_clear_decals(sp);
 	}
vanish_wing.diff (874 bytes)   

2005-08-07 18:01

 

ship_vanish_test.fs2 (6,597 bytes)

Fractux

2005-08-07 18:10

reporter   ~0002946

I applied the diff and recompiled.

In my tests the problem was fixed, and the two missions i tested no longer crashed.

I tested with the Trans mission and With the quick test I set up.

Looks to be resolved.

Cheers Taylor :)

taylor

2005-08-07 23:58

administrator   ~0002949

Good to hear. I want to run it by Goober before commit just to make sure he can't think of a better way to do the same thing. It should hit CVS in the next day or so.

Goober5000

2005-08-08 01:54

administrator   ~0002951

I just looked over the diff and I can't find anything wrong with it. I went through the FS2 code and compared the ship_vanish, ship_destroy, and ship_depart code (plus the mission log code) and it looks like this will work. :)

taylor

2005-08-08 02:19

administrator   ~0002952

Ok. I'll go ahead and commit it. It is just a copy-paste from ship_destroy except that it doesn't register as a destroyed ship to avoid logging it. It just seemed a little hackish though and I wasn't sure if we just needed a special case to better handle vanished ships (such as a SF2_VANISHED flag). I never did see anywhere else that this might be a problem so a flag may not ever be needed.

taylor

2005-08-08 02:22

administrator   ~0002953

Fixered.

Issue History

Date Modified Username Field Change
2005-08-07 02:06 Fractux New Issue
2005-08-07 02:09 Fractux Note Added: 0002940
2005-08-07 03:37 Fractux File Added: TransE2M2.fs2
2005-08-07 08:12 taylor Note Added: 0002942
2005-08-07 08:13 taylor File Added: vanish_wing.diff
2005-08-07 08:13 taylor Status new => assigned
2005-08-07 08:13 taylor Assigned To => taylor
2005-08-07 18:01 Fractux File Added: ship_vanish_test.fs2
2005-08-07 18:10 Fractux Note Added: 0002946
2005-08-07 23:58 taylor Note Added: 0002949
2005-08-08 01:54 Goober5000 Note Added: 0002951
2005-08-08 02:19 taylor Note Added: 0002952
2005-08-08 02:22 taylor Status assigned => resolved
2005-08-08 02:22 taylor Resolution open => fixed
2005-08-08 02:22 taylor Note Added: 0002953