View Issue Details

IDProjectCategoryView StatusLast Update
0000946Spring engineGeneralpublic2008-06-18 01:57
ReporterKDR_11k Assigned ToKloot  
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version0.76b1+svn 
Summary0000946: SVN R5983: crash in AddDeathDependence following attack order from AirCAI
DescriptionWe were playing THIS, fighting it out and the game suddently crashed. In THIS all units are gunships except for drones (fighters) which are spawned by some units and given an attack order via Lua. We've played another game (using debug builds to do adddr2line on the infolog) and got the same crash. Lurker is currently debugging it and it seems to have been caused by a bad unit pointer being given to a drone's attack order.
Additional InformationMod and map: http://kdr_11k.from-hell.net/THIS%20WIP4.zip

The infolog is from the buildserv build of rev 5983. No replay file seems to exist (the only one with the mod version ends almost immediately).
TagsNo tags attached.
Attached Files
Kopie von infolog.txt (Attachment missing)
Checked infolog.txt for Errors

Activities

lurker

2008-06-03 12:39

reporter   ~0002316

This is a pretty simple bug. CCommandAI::SlowUpdate() automatically executes WAIT, SELFD, STOP, ATTACK, and DGUN. The issue is attack, and dgun, which also calls attack.
CMobileCAI::ExecuteAttack() has a simple check if the target is valid:
if (uh->units[unitID] != 0 && uh->units[unitID] != owner) {
    ...
} else {
    StopMove();
    FinishCommand();
    return;
}

CCommandAI::ExecuteAttack() lacks this check, as does CAirCAI::ExecuteAttack()

Also, some lua script in THIS needs to check a target against -1.

lurker

2008-06-03 12:42

reporter   ~0002317

Oh, actually, that check only works if given an empty unit, and still fails on any random number not in the range, so they all need a bounds check from 0 to MAX_UNITS.

Kloot

2008-06-18 01:57

developer   ~0002340

Fixed the ExecuteAttack()'s, but they're not the only ones vulnerable (the Lua versions of GiveOrder don't do much sanity checking). Rejecting bad parameters at the gates would be a better idea.

Issue History

Date Modified Username Field Change
2008-06-03 11:51 KDR_11k New Issue
2008-06-03 11:52 KDR_11k File Added: Kopie von infolog.txt
2008-06-03 12:39 lurker Note Added: 0002316
2008-06-03 12:42 lurker Note Added: 0002317
2008-06-18 01:57 Kloot Note Added: 0002340
2008-06-18 01:57 Kloot Status new => resolved
2008-06-18 01:57 Kloot Resolution open => fixed
2008-06-18 01:57 Kloot Assigned To => Kloot