project-navigation
Personal tools

Author Topic: Game crash with error: "Assertion failed!"  (Read 4010 times)

Phantom

  • Guest
Game crash with error: "Assertion failed!"
« on: April 10, 2007, 03:31:29 pm »
Cant find this one in the forum, so here goes nothing (,=backslash):
Quote
Assertion failed!
Program: E:-Spel,UFO,UFOAI-2,ufo.exe
File: ..,..,/src,client,cl_team.c
Line: 584

Expression: cp

For information on how your program can cause an assertion failure, see C++ documentation on asserts

(Press Retry to debug the aplication - JIT must be enabled)
[Abort] [Retry] [Ignore]


I have 4 bases, all renamed.
All research done, particle weapons can not use the ammo is not researched it says.
I just created some fighter planes (1 on two bases).
I was underway to defend Fargo USA.

Retry crashed the game !

Bommer  :shock:

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Game crash with error: "Assertion failed!"
« Reply #1 on: April 10, 2007, 05:26:45 pm »
please open the game console, type "developer 1" and try to reproduce the crash - after that please send the last part of your ufoconsole.log (in application data/UFOAI/.ufoai/base/ufoconsole.log)

thanks

Phantom

  • Guest
Game crash with error: "Assertion failed!"
« Reply #2 on: April 10, 2007, 11:40:35 pm »
Ok wil try to recreate, but console is out of the question as the game errors in to windows and game is dead :cry:

Phantom

  • Guest
Game crash with error: "Assertion failed!"
« Reply #3 on: April 11, 2007, 12:07:52 pm »
I spend about 4 hours trying to recreate this crash...
None happened :( Wel actualy its :lol:

This test was difirent from urlier crash:
- That crash happened after hours of play, from new game, and saved multiple games...
- This retry was from startup of the game on an urlier saved game...

My old log file I backed it up, but was with developer not on 1.
Last entry in there was the war I was playing and game shutdown.
The crash happened not in the war, so its useless, I guess...

My new log file is actualy 5.3 Mbytes in size !
Its filled with missing music, missing map parts, skill errors and more errors that may help smothing out the game ? Wanna have, tell me where to send it :lol:

ps.: Wil compress it with RAR (77Kbytes) and back it up, in case you want it... ;)

bol0

  • Guest
Game crash with error: "Assertion failed!"
« Reply #4 on: April 29, 2007, 12:24:20 pm »
Ay lads! I've got the same error and I'm able to recreate it. Problem is that after "developer 1" ufoconsole.log is not being created. Any ideas why?

Anyway game crushes like that when I reach destination of alien attack. Particular moment is when I press 'enter' and map should be loaded.

teej

  • Guest
Game crash with error: "Assertion failed!"
« Reply #5 on: May 06, 2007, 03:02:37 am »
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: [Select]

...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 ====


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

Code: [Select]
/**
 * @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);
}
}
}
}
}

teej

  • Guest
Game crash with error: "Assertion failed!"
« Reply #6 on: May 06, 2007, 03:17:44 am »
The more verbose developer 1 ufoconsole.

Code: [Select]
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

Offline Zenerka

  • Sergeant
  • *****
  • Posts: 301
    • View Profile
Game crash with error: "Assertion failed!"
« Reply #7 on: May 06, 2007, 03:03:55 pm »
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).