bugGlobulation 2 - Bugs: bug #23773, Segfault, NULL building in...

 
 

bug #23773: Segfault, NULL building in NewNicowar::compute_defense_flag_positioning at src/AINicowar.cpp:2237

Submitted by:  cyp
Submitted on:  Sat 05 Jul 2008 08:01:21 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Bradley Arsenault <genixpro>Open/Closed: Closed
Release: 0.9.3 (Beta 3)Operating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 06 Jan 2009 03:05:40 AM UTC, comment #1:

http://hg.globulation2.org/glob2-new/rev/276f27831998
should have fixed that.

although i wonder why
+if(echo.get_building_register().is_building_found(*i))
+{
+ Building* b = echo.get_building_register().get_building(*i);

is used instead of the cheaper
+Building* b = echo.get_building_register().get_building(*i);
+if(b!=null) {

Leo Wandersleb <giszmo>
Project Member
Sat 05 Jul 2008 08:01:21 AM UTC, original submission:

Core was generated by `src/glob2'.
Program terminated with signal 11, Segmentation fault.
#0 0x000000000045406e in NewNicowar::compute_defense_flag_positioning (this=0x17a7e10, echo=@0xc892f0) at src/AINicowar.cpp:2237
2237 int nx = (b->posX + px + w)%w;
(gdb) p b
$1 = (class Building *) 0x0
(gdb) bt
#0 0x000000000045406e in NewNicowar::compute_defense_flag_positioning (this=0x17a7e10, echo=@0xc892f0) at src/AINicowar.cpp:2237
#1 0x0000000000462fba in NewNicowar::tick (this=0x17a7e10, echo=@0xc892f0) at src/AINicowar.cpp:406
#2 0x00000000004319f4 in AIEcho::Echo::getOrder (this=0xc892f0) at src/AIEcho.cpp:4952
#3 0x000000000041857c in AI::getOrder (this=0xbe86f0, paused=false) at src/AI.cpp:108
#4 0x00000000004ae6c8 in Engine::run (this=0x7fff42585dd0) at src/Engine.cpp:319
#5 0x000000000050889e in Glob2::run (this=0x7fff4259006f, argc=1, argv=0x7fff42590158) at src/Glob2.cpp:270
#6 0x0000000000508b7d in main (argc=1, argv=0x7fff42590158) at src/Glob2.cpp:352

cyp

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by giszmo (Posted a comment)
  • -unavailable- added by cyp (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Jan 2009 03:05:40 AM UTCgiszmoStatusNone=>Fixed
      Assigned toNone=>genixpro
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1