Technical support > Feature Requests

Game crash with error: "Assertion failed!"

<< < (2/2)

teej:
I am also suffering from this crash.  2.1.1.  It was the most recent Win32 from sourceforge on May 4th 2007.  Version confesses "2.1.1 x86 May 1 2007 Win32 DEBUG"

I can produce it regularly, and can also avoid it regularly by calling back my original dropship and deploying another.

Looks like the line number in cl_team differs now to 613.

Part of my ufoconsole.log follows.


--- Code: ---
...added nations subsystem (check b)
Shared Client/Server Info loaded
====== UFO Initialized ======

Loading savegame
...version: 1
...game version: 2.1.1
Global data loaded - size (null)u bytes
...techs: 131
...buildings: 18
...ranks: 8
...nations: 8

Load 'slot0'
...subsystem 'base' - loaded 22988 bytes
Initializing aircraft and aircraft-items ...
...aircraft and aircraft-items inited
Activate stage ufos_are_coming
...subsystem 'campaign' - loaded 241 bytes
...subsystem 'hospital' - loaded 2 bytes
...subsystem 'market' - loaded 2176 bytes
...subsystem 'research' - loaded 6288 bytes
...subsystem 'employee' - loaded 31617 bytes
...subsystem 'aliencont' - loaded 0 bytes
...subsystem 'production' - loaded 61 bytes
...subsystem 'aircraft' - loaded 1 bytes
...subsystem 'messagesystem' - loaded 28458 bytes
...subsystem 'stats' - loaded 28 bytes
...subsystem 'nations' - loaded 32 bytes
File 'slot0' loaded.
Changing to Singleplayer
==== InitGame ====
------- Server Initialization -------
Created AI player (team 0)
Created AI player (team 7)
-------------------------------------
Map: pdi08n
                                     
pics
                                     
civilians/male/body02
                                     
civilians/male/head02
                                     
aliens/taman/body01
                                     
aliens/taman/head01
                                     
aliens/ortnok/body01
                                     
aliens/ortnok/head02
                                     
aliens/ortnokmedium/body01
                                     
aliens/ortnokmedium/head02
                                     
images
Unnamed has joined team 0
Unnamed has taken control over team 1.
Starting the game...
(player 0) It's team 1's round
==== ShutdownGame ====

--- End code ---


here you can see the offending procedure from cl_team.c, lines 588 - 625.
assert(cp); is the implicated failure.


--- Code: ---/**
 * @brief
 * @sa CL_AddWeaponAmmo
 */
extern void CL_ReloadAndRemoveCarried (equipDef_t * ed)
{
character_t *cp;
invList_t *ic, *next;
int p, container;

assert(baseCurrent);
assert((baseCurrent->aircraftCurrent >= 0) && (baseCurrent->aircraftCurrent < baseCurrent->numAircraftInBase));

/* Iterate through in container order (right hand, left hand, belt, */
/* holster, backpack) at the top level, i.e. each squad member reloads */
/* her right hand, then each reloads his left hand, etc. The effect */
/* of this is that when things are tight, everyone has the opportunity */
/* to get their preferred weapon(s) loaded before anyone is allowed */
/* to keep her spares in the backpack or on the floor. We don't want */
/* the first person in the squad filling their backpack with spare ammo */
/* leaving others with unloaded guns in their hands... */
Com_DPrintf("teamNum in aircraft %i: %i\n", baseCurrent->aircraftCurrent, baseCurrent->teamNum[baseCurrent->aircraftCurrent] );
for (container = 0; container < csi.numIDs; container++) {
for (p = 0; p < baseCurrent->teamNum[baseCurrent->aircraftCurrent]; p++) {
cp = baseCurrent->curTeam[p];
assert(cp);
for (ic = cp->inv->c[container]; ic; ic = next) {
next = ic->next;
if (ed->num[ic->item.t] > 0) {
ic->item = CL_AddWeaponAmmo(ed, ic->item);
} else {
/* drop ammo used for reloading and sold carried weapons */
Com_RemoveFromInventory(cp->inv, container, ic->x, ic->y);
}
}
}
}
}
--- End code ---

teej:
The more verbose developer 1 ufoconsole.


--- Code: ---ExecuteString: '+select 178 173464453'
ExecuteString: 'game_go'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_SetMissionCvars:
..numAliens: 4
..numCivilians: 2
..alienTeam: 'alien'
..civTeam: 'oriental'
..alienEquip: 'stage3_workers_explosive'
..music: 'PsymongO5'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '0'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '1'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '2'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '3'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '4'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '5'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '6'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '7'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '8'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '9'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '10'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '11'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '12'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '13'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '14'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '15'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '16'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '17'
CL_AircraftGetFromIdx: aircraft idx: 5 - base idx: 2 (Charlie - Estonia)
CL_IsInAircraftTeam:not found idx '18'
teamNum in aircraft 1: 8
--- End code ---

Zenerka:
In current trunk the offending function, that is CL_ReloadAndRemoveCarried(), is rewritten to the more sane way, that is no more baseCurrent usage there (and this is the real source of the problem, because the pointers of baseCurrent and current team are sometimes not synced).
Unfortunately there was not enough time to test it properly and merge to 2.1.1, so we have to  live with that assert from time to time.
Also such problem can be avoided by sending only one dropship to desired mission at one time directly from the base (without save/load in the middle).

Navigation

[0] Message Index

[*] Previous page

Go to full version