Opened 10 years ago

Closed 10 years ago

#2678 closed defect (fixed)

pyrogenesis segfaults on load game

Reported by: Patrick Owned by: Itms
Priority: Must Have Milestone: Alpha 17
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Itms)

Currently At revision 15536.

Across several days of pulling down revisions and clean builds I crash every time trying to load a game. Playing and saving seem to work fine, but if I try to go back in and load a game it seg-faults reliably. Here's the backtrace from the crashing thread, I haven't tried to debug it myself since I figure you might already know about it, but if you want me to, I can chase it down.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::_M_insert_unique (
    this=0x0, __v=@0x7fff57211d40: 150)
    at /usr/include/c++/4.8.3/bits/stl_tree.h:1315
1315        _M_get_insert_unique_pos(const key_type& __k)
(gdb) bt
#0  std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::_M_insert_unique (
    this=0x0, __v=@0x7fff57211d40: 150)
    at /usr/include/c++/4.8.3/bits/stl_tree.h:1315
#1  0x00000000004cef1e in insert (__x=@0x7fff57211d40: 150, 
    this=<optimized out>) at /usr/include/c++/4.8.3/bits/stl_set.h:463
#2  AddToTile (ent=150, tile=<optimized out>, this=0x3fa4c00)
    at ../../../source/simulation2/components/CCmpRangeManager.cpp:1441
#3  CCmpRangeManager::ResetDerivedData (this=0x3fa4c00, 
    skipLosState=<optimized out>)
    at ../../../source/simulation2/components/CCmpRangeManager.cpp:684
#4  0x00000000004a385c in CComponentManager::DeserializeState (this=0x3131a78, 
    stream=...)
    at ../../../source/simulation2/system/ComponentManagerSerialization.cpp:333
#5  0x0000000000465ee3 in CSimulation2::DeserializeState (
    this=<optimized out>, stream=...)
    at ../../../source/simulation2/Simulation2.cpp:753
#6  0x000000000056de77 in CGame::LoadInitialState (this=0x3135270)
    at ../../../source/ps/Game.cpp:189
#7  0x000000000056dc15 in MemFunThunk<CGame> (param=0x36efaf0)
    at ../../../source/ps/LoaderThunks.h:60
#8  0x0000000000572508 in LDR_ProgressiveLoad (
    time_budget=time_budget@entry=0.01, 
    description=description@entry=0x7fff572124a0 L"Loading game", 
    max_chars=max_chars@entry=100, 
    progress_percent=progress_percent@entry=0x7fff57212260)
    at ../../../source/ps/Loader.cpp:228
#9  0x0000000000424892 in ProgressiveLoad () at ../../../source/main.cpp:211
#10 Frame () at ../../../source/main.cpp:316
#11 RunGameOrAtlas (argc=argc@entry=1, argv=argv@entry=0x7fff57212788)
    at ../../../source/main.cpp:488
#12 0x0000000000418eb7 in main (argc=1, argv=0x7fff57212788)
    at ../../../source/main.cpp:530

Change History (2)

comment:1 by Itms, 10 years ago

Description: modified (diff)
Milestone: BacklogAlpha 17
Owner: set to Itms

Thanks for reporting this, somebody else got the problem here: http://www.wildfiregames.com/forum/index.php?showtopic=18944 and it is caused by r15508.

I'll correct this ASAP.

comment:2 by Itms, 10 years ago

Resolution: fixed
Status: newclosed

In 15538:

Recompute the number of LoS tiles whenever these tiles are reset (especially when loading serialized data).
Also add a verification about LoS tiles in the tests.

Fixes #2678
Refs #599

Note: See TracTickets for help on using tickets.