#2010: SEGFAULT in newnet
-----------------------+----------------------------------------------------
 Reporter:  Safety0ff  |              Owner:                  
     Type:  bug        |             Status:  new             
 Priority:  blocker    |          Milestone:  3.0             
Component:  other      |            Version:  unspecified     
 Keywords:             |   Operating_system:  All/Non-Specific
Blockedby:             |           Blocking:                  
-----------------------+----------------------------------------------------
 How to replicate:[[BR]]
 -Start a skirmish game with map "concrete" ( with or without AI, though AI
 helps,) and set it to start without bases.[[BR]]
 -Crash

 droidStartBuild assumes that if
 {{{
 psDroid->psTarget == NULL) &&
                 (psDroid->order == DORDER_BUILD ||
                  psDroid->order == DORDER_LINEBUILD)
 }}}
 then the pointer is valid.
 So when this happens ( I added in a CHECK_STRUCTURE to make it assert at
 the logical location.)
 {{{
                 psStruct = (STRUCTURE *)psDroid->psTarget;
                 CHECK_STRUCTURE(psStruct);
                 if (!droidNextToStruct(psDroid, (BASE_OBJECT *)psStruct))
                 {
                         /* Nope - stop building */
                         debug( LOG_NEVER, "not next to structure" );
                 }
 }}}
 So it sounds more like a bug "that happens in newnet that could potentialy
 happen elsewhere" rather that "a bug in newnet".

 Anyways, currently the droid my debugger has:
 {{{
 Action: Move to build
 Order: daction_none
 target: null
 target stats: res. lab
 }}}

 And apparently actionUpdateDroid can easily fall through to starting a
 help build, which in this case it leads to dereferencing a null pointer.

-- 
Ticket URL: <http://developer.wz2100.net/ticket/2010>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to