2025-07-22 10:15 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003585Spring engineGeneralpublic2013-03-20 00:53
Reporterabma 
Assigned ToKloot 
PrioritynormalSeveritycrashReproducibilitysometimes
StatusresolvedResolutionfixed 
Product Version93.2.1+git 
Target Version94.1Fixed in Version 
Summary0003585: spring mostly crashes at exit when in a two ai game ai 0 is destroyed first
Description...
Steps To Reproduce[f=0036000] User exited
[f=0036039] Error: Tried to mark AI 0 dead, but is already dead
[f=0036039] Error: Tried to mark AI 1 dead, but is already dead
[f=0036039] Red_UI_Framework>> last processed widget was "Red Minimap"
[f=0036039] Red_Drawing>> last processed widget was "Red Minimap"

Program received signal SIGSEGV, Segmentation fault.
0x00000000009a6db2 in CEngineOutHandler::UnitDestroyed (this=0x1ffca80, destroyed=..., attacker=0x0)
    at rts/ExternalAI/EngineOutHandler.cpp:382
382 const int t = ai->second->GetTeamId();
(gdb) bt
#0 0x00000000009a6db2 in CEngineOutHandler::UnitDestroyed (this=0x1ffca80, destroyed=..., attacker=warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

0x0)
    at rts/ExternalAI/EngineOutHandler.cpp:382
#1 0x000000000088c133 in KillUnit (showDeathSequence=true, attacker=warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

0x0, reclaimed=true,
    selfDestruct=false, this=0xce41100) at rts/Sim/Units/Unit.cpp:1951
#2 CUnit::KillUnit (this=0xce41100, selfDestruct=<optimized out>, reclaimed=<optimized out>, attacker=warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)


0x0, showDeathSequence=<optimized out>) at rts/Sim/Units/Unit.cpp:1942
0000003 0x00000000008b2a94 in CFactory::~CFactory (this=0xc4aee00, __in_chrg=<optimized out>)
    at rts/Sim/Units/UnitTypes/Factory.cpp:65
0000004 0x00000000008b2b29 in CFactory::~CFactory (this=0xc4aee00, __in_chrg=<optimized out>)
    at rts/Sim/Units/UnitTypes/Factory.cpp:68
0000005 0x00000000008a5e7d in CUnitHandler::~CUnitHandler (this=0x5d0c600, __in_chrg=<optimized out>)
    at rts/Sim/Units/UnitHandler.cpp:117
#6 0x0000000000460d56 in SafeDelete<CUnitHandler*> (a=<optimized out>) at rts/System/Util.h:158
#7 CGame::~CGame (this=0x1bf9080, __in_chrg=<optimized out>) at rts/Game/Game.cpp:404
#8 0x0000000000461209 in CGame::~CGame (this=0x1bf9080, __in_chrg=<optimized out>)
    at rts/Game/Game.cpp:444
#9 0x000000000093365b in SafeDelete<CGame*> (a=<optimized out>) at rts/System/Util.h:158
0000010 SpringApp::Shutdown () at rts/System/SpringApp.cpp:1058
#11 0x0000000000934656 in SpringApp::Run (this=0x7fffffffe1f0, argc=2, argv=0x7fffffffe528)
    at rts/System/SpringApp.cpp:1043
0000012 0x000000000090e803 in Run (argc=argc@entry=2, argv=argv@entry=0x7fffffffe528)
    at rts/System/Main.cpp:66
0000013 0x000000000090eda7 in main (argc=2, argv=0x7fffffffe528) at rts/System/Main.cpp:151
(gdb)
Additional Informationrun game with to ai's, for example aai at high speed.

quit


-> sometimes crash
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0010079

abma (administrator)

an other one:

Program received signal SIGSEGV, Segmentation fault.
0x00000000009a6db2 in CEngineOutHandler::UnitDestroyed (this=0x1ffca80, destroyed=..., attacker=0x0) at rts/ExternalAI/EngineOutHandler.cpp:382
382 const int t = ai->second->GetTeamId();
(gdb) bt
#0 0x00000000009a6db2 in CEngineOutHandler::UnitDestroyed (this=0x1ffca80, destroyed=..., attacker=warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

0x0) at rts/ExternalAI/EngineOutHandler.cpp:382
#1 0x000000000088c133 in KillUnit (showDeathSequence=true, attacker=warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

0x0, reclaimed=true, selfDestruct=false, this=0x9516300) at rts/Sim/Units/Unit.cpp:1951
#2 CUnit::KillUnit (this=0x9516300, selfDestruct=<optimized out>, reclaimed=<optimized out>, attacker=warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

0x0, showDeathSequence=<optimized out>)
    at rts/Sim/Units/Unit.cpp:1942
0000003 0x00000000008b2a94 in CFactory::~CFactory (this=0xc409500, __in_chrg=<optimized out>) at rts/Sim/Units/UnitTypes/Factory.cpp:65
0000004 0x00000000008b2b29 in CFactory::~CFactory (this=0xc409500, __in_chrg=<optimized out>) at rts/Sim/Units/UnitTypes/Factory.cpp:68
0000005 0x00000000008a5e7d in CUnitHandler::~CUnitHandler (this=0x5c2c600, __in_chrg=<optimized out>) at rts/Sim/Units/UnitHandler.cpp:117
#6 0x0000000000460d56 in SafeDelete<CUnitHandler*> (a=<optimized out>) at rts/System/Util.h:158
#7 CGame::~CGame (this=0x1bf9080, __in_chrg=<optimized out>) at rts/Game/Game.cpp:404
#8 0x0000000000461209 in CGame::~CGame (this=0x1bf9080, __in_chrg=<optimized out>) at rts/Game/Game.cpp:444
#9 0x000000000093365b in SafeDelete<CGame*> (a=<optimized out>) at rts/System/Util.h:158
0000010 SpringApp::Shutdown () at rts/System/SpringApp.cpp:1058
#11 0x0000000000934656 in SpringApp::Run (this=0x7fffffffe1f0, argc=2, argv=0x7fffffffe528) at rts/System/SpringApp.cpp:1043
0000012 0x000000000090e803 in Run (argc=argc@entry=2, argv=argv@entry=0x7fffffffe528) at rts/System/Main.cpp:66
0000013 0x000000000090eda7 in main (argc=2, argv=0x7fffffffe528) at rts/System/Main.cpp:151

~0010080

abma (administrator)

Last edited: 2013-03-16 03:26

View 4 revisions

shouldn't CFactory have a KillFactory() ?

imo the destructor shouldn't call KillUnit(), it should just free mem / referenced mem.

https://github.com/spring/spring/blob/develop/rts/Sim/Units/UnitTypes/Factory.cpp#L65

i guess thats why spring is so slow at exit if that is used in more places...

~0010081

Kloot (developer)

Last edited: 2013-03-16 03:56

View 2 revisions

That makes no sense.

A factory can be destroyed at any point in the game. When one does the unit it is building (if any) needs to be killed. Whether this happens in the dtor or some other place doesn't matter.

In any case this looks like an order-of-deinitialization problem, EngineOutHandler might be destroyed before UnitHandler.

~0010082

abma (administrator)

i just wanted to avoid to call curBuild->KillUnit...

~0010128

Kloot (developer)

does https://github.com/spring/spring/commit/3b7b798be9f727d95c4f90a3a91d4b2fb4deaa87 fix it?

~0010129

abma (administrator)

yes, thanks! :)
+Notes

-Issue History
Date Modified Username Field Change
2013-03-16 03:19 abma New Issue
2013-03-16 03:20 abma Note Added: 0010079
2013-03-16 03:23 abma Note Added: 0010080
2013-03-16 03:25 abma Note Edited: 0010080 View Revisions
2013-03-16 03:26 abma Note Edited: 0010080 View Revisions
2013-03-16 03:26 abma Note Edited: 0010080 View Revisions
2013-03-16 03:55 Kloot Note Added: 0010081
2013-03-16 03:56 Kloot Note Edited: 0010081 View Revisions
2013-03-16 04:22 abma Note Added: 0010082
2013-03-19 23:26 abma Target Version => 94.1
2013-03-19 23:26 abma Category Spring MT => General
2013-03-20 00:38 Kloot Note Added: 0010128
2013-03-20 00:53 abma Note Added: 0010129
2013-03-20 00:53 abma Status new => resolved
2013-03-20 00:53 abma Resolution open => fixed
2013-03-20 00:53 abma Assigned To => Kloot
+Issue History