Spring in Linux Hangs
Moderator: Moderators
-
- Posts: 272
- Joined: 30 May 2006, 17:06
Spring in Linux Hangs
It hangs by not updating the display and not using cpu time. If i alt-tab i cant kill the process, even as root. It has ocurred in the last 3 versions of spring (when i started using it in linux) and i hoped it was just me or it would go away. However i've reinstalled another partition to run it as clean as possible and it still hangs.
Finally by talking to other linux users i found they have the same problem and at this point im posting here for the devs.
Finally by talking to other linux users i found they have the same problem and at this point im posting here for the devs.
-
- Posts: 272
- Joined: 30 May 2006, 17:06
-
- Posts: 272
- Joined: 30 May 2006, 17:06
Compile spring with debugging enabled and run it in a debugger (gdb). When it hangs, alt+tab to the terminal running the debugger and give us a stacktrace of the location where it hangs.
I don't think there's anything easier you can do... as I myself have never seen this bug (and I play spring only on Linux).
I don't think there's anything easier you can do... as I myself have never seen this bug (and I play spring only on Linux).
-
- Posts: 272
- Joined: 30 May 2006, 17:06
I compile my spring following this howto:
http://spring.clan-sy.com/phpbb/viewtopic.php?t=8247
I compile it with the command "scons". What command should i use to compile it with debug support?
How do i start spring in gdb? I'll make a script.txt for some AI fights with the lobby.
When it hangs, what should i do on the terminal window to get the required information?
Thanks.
http://spring.clan-sy.com/phpbb/viewtopic.php?t=8247
I compile it with the command "scons". What command should i use to compile it with debug support?
How do i start spring in gdb? I'll make a script.txt for some AI fights with the lobby.
When it hangs, what should i do on the terminal window to get the required information?
Thanks.
-
- Posts: 272
- Joined: 30 May 2006, 17:06
Instead of
use
(or 2 or 3, I do not know exactly what is involved with each debug level... probably 1 would be enough though)
To start with gdb use:
and then from the promt
When it is blocked use control-c in the gdb console and type then "bt". You should see a stack trace (a list of functions...)
Code: Select all
scons configure
Code: Select all
scons configure debug=1
To start with gdb use:
Code: Select all
gdb spring
Code: Select all
run script.txt
Just use debug=3 (or debug=yes for that matter). It will give you a *very* big executable (approx. 110M), but you can at least be sure that all debugging info is in it
Oh, and if you use it for online play, I recommend you keep optimization enabled too. Because it is by default disabled if you enable debugging use this:
Oh, and if you use it for online play, I recommend you keep optimization enabled too. Because it is by default disabled if you enable debugging use this:
Code: Select all
scons configure debug=yes optimize=yes
-
- Posts: 272
- Joined: 30 May 2006, 17:06
I had it setup with just the first instructions, with debug 1. I got this:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1241966896 (LWP 6078)]
0xb77c2226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb77c2226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
#1 0xb77c2a44 in free () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7972fc1 in operator delete () from /usr/lib/libstdc++.so.6
#3 0x082ed161 in UnitDef_GetBuildOption ()
#4 0x082ed339 in UnitDef_GetBuildOption ()
#5 0x082f774a in UnitDef_GetBuildOption ()
#6 0x082e099b in UnitDef_GetBuildOption ()
#7 0x0830b307 in UnitDef_GetBuildOption ()
#8 0x082bfef6 in UnitDef_GetBuildOption ()
#9 0x08171984 in UnitDef_GetBuildOption ()
#10 0x081823de in UnitDef_GetBuildOption ()
#11 0x081841d5 in UnitDef_GetBuildOption ()
#12 0x080e8a3f in UnitDef_GetBuildOption ()
#13 0x080ec8d5 in UnitDef_GetBuildOption ()
#14 0x080ecc0a in UnitDef_GetBuildOption ()
#15 0x080ecd22 in UnitDef_GetBuildOption ()
#16 0xb77718cc in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#17 0x08056af1 in _start ()
(gdb)
Is it useful? I'm gonna keep the gdb console open a bit in case you reply with more queries.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1241966896 (LWP 6078)]
0xb77c2226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb77c2226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
#1 0xb77c2a44 in free () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7972fc1 in operator delete () from /usr/lib/libstdc++.so.6
#3 0x082ed161 in UnitDef_GetBuildOption ()
#4 0x082ed339 in UnitDef_GetBuildOption ()
#5 0x082f774a in UnitDef_GetBuildOption ()
#6 0x082e099b in UnitDef_GetBuildOption ()
#7 0x0830b307 in UnitDef_GetBuildOption ()
#8 0x082bfef6 in UnitDef_GetBuildOption ()
#9 0x08171984 in UnitDef_GetBuildOption ()
#10 0x081823de in UnitDef_GetBuildOption ()
#11 0x081841d5 in UnitDef_GetBuildOption ()
#12 0x080e8a3f in UnitDef_GetBuildOption ()
#13 0x080ec8d5 in UnitDef_GetBuildOption ()
#14 0x080ecc0a in UnitDef_GetBuildOption ()
#15 0x080ecd22 in UnitDef_GetBuildOption ()
#16 0xb77718cc in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#17 0x08056af1 in _start ()
(gdb)
Is it useful? I'm gonna keep the gdb console open a bit in case you reply with more queries.
-
- Posts: 272
- Joined: 30 May 2006, 17:06
-
- Posts: 1
- Joined: 08 Apr 2007, 09:52
I would just like to add to the record that I too am encountering this bug(?). I can however kill spring with sigkill (-9). I run Gentoo AMD64 (yes, 64bit install) and it mainly happens when I play a map which I haven't played before and often after about 15-20 min of gameplay. I will make a debug build and see if there comes anything intresting out of it.
-
- Posts: 272
- Joined: 30 May 2006, 17:06
This was speccing a InstaGib game, 1v1 on Comet Catcher
(gdb) run script.txt
Starting program: /usr/games/_spring script.txt
[Thread debugging using libthread_db enabled]
[New Thread -1241872688 (LWP 6124)]
warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00000094
[New Thread -1242567776 (LWP 6139)]
[New Thread -1268323424 (LWP 6140)]
Using LUAUI_DIRNAME = LuaUI/
Loaded widget: ChatterBox <snd_chatterbox.lua>
Loaded widget: CommanderEnds <gui_comm_ends.lua>
Loaded widget: Clock <gui_clock.lua>
Loaded widget: FactoryGuard <unit_factory_guard.lua>
Loaded widget: MetalMakers <unit_metal_maker.lua>
Loaded widget: Tooltip <gui_tooltip.lua>
Loaded widget: Stockpiler <unit_stockpile.lua>
Loaded widget: FPS <gui_fps.lua>
Loaded widget: ImmobileBuilder <unit_immobile_buider.lua>
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1241872688 (LWP 6124)]
0x082e934f in CUnit::KillUnit (this=0x8c9a6f8, selfDestruct=false,
reclaimed=false, attacker=0xb26de28) at rts/Sim/Units/Unit.cpp:1296
1296 args.push_back((int)(recentDamage/maxHealth*100));
(gdb) bt
#0 0x082e934f in CUnit::KillUnit (this=0x8c9a6f8, selfDestruct=false,
reclaimed=false, attacker=0xb26de28) at rts/Sim/Units/Unit.cpp:1296
#1 0x082e86e2 in CUnit::DoDamage (this=0x8c9a6f8, damages=@0xbfdfd8e0,
attacker=0xb26de28, impulse=@0xbfdfd910) at rts/Sim/Units/Unit.cpp:633
#2 0x081643d9 in CGameHelper::Explosion (this=0x8a63cb0, pos=@0xbfdfd9c0,
damages=@0x8d848f0, radius=24, edgeEffectiveness=0,
explosionSpeed=97784.6484, owner=0xb26de28, damageGround=true, gfxMod=1,
ignoreOwner=false, explosionGraphics=0x8ec7bc0, hit=0x8c9a6f8,
impactDir=@0xbfdfd9b4) at rts/Game/GameHelper.cpp:119
#3 0x0827845c in CWeaponProjectile::Collision (this=0xb25af88, unit=0x8c9a6f8)
at rts/Sim/Projectiles/WeaponProjectile.cpp:120
#4 0x082790f7 in CMissileProjectile::Collision (this=0xb25af88,
unit=0x8c9a6f8) at rts/Sim/Projectiles/MissileProjectile.cpp:109
#5 0x0825ebb2 in CProjectileHandler::CheckUnitCol (this=0x8824858)
at rts/Sim/Projectiles/ProjectileHandler.cpp:518
#6 0x0817a4ac in CGame::SimFrame (this=0x8950570) at rts/Game/Game.cpp:1896
#7 0x0818af8e in CGame::ClientReadNet (this=0x8950570)
at rts/Game/Game.cpp:2304
#8 0x0818cdb1 in CGame::Update (this=0x8950570) at rts/Game/Game.cpp:1470
#9 0x080ea02f in SpringApp::Update (this=0xbfdfe584)
at rts/System/Main.cpp:812
#10 0x080eddd5 in SpringApp::Run (this=0xbfdfe584, argc=2, argv=0xbfdfe674)
at rts/System/Main.cpp:990
#11 0x080ee10a in Run (argc=2, argv=0xbfdfe674) at rts/System/Main.cpp:1047
#12 0x080ee222 in main (argc=Cannot access memory at address 0x1
) at rts/System/Main.cpp:1087
(gdb) run script.txt
Starting program: /usr/games/_spring script.txt
[Thread debugging using libthread_db enabled]
[New Thread -1241872688 (LWP 6124)]
warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00000094
[New Thread -1242567776 (LWP 6139)]
[New Thread -1268323424 (LWP 6140)]
Using LUAUI_DIRNAME = LuaUI/
Loaded widget: ChatterBox <snd_chatterbox.lua>
Loaded widget: CommanderEnds <gui_comm_ends.lua>
Loaded widget: Clock <gui_clock.lua>
Loaded widget: FactoryGuard <unit_factory_guard.lua>
Loaded widget: MetalMakers <unit_metal_maker.lua>
Loaded widget: Tooltip <gui_tooltip.lua>
Loaded widget: Stockpiler <unit_stockpile.lua>
Loaded widget: FPS <gui_fps.lua>
Loaded widget: ImmobileBuilder <unit_immobile_buider.lua>
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1241872688 (LWP 6124)]
0x082e934f in CUnit::KillUnit (this=0x8c9a6f8, selfDestruct=false,
reclaimed=false, attacker=0xb26de28) at rts/Sim/Units/Unit.cpp:1296
1296 args.push_back((int)(recentDamage/maxHealth*100));
(gdb) bt
#0 0x082e934f in CUnit::KillUnit (this=0x8c9a6f8, selfDestruct=false,
reclaimed=false, attacker=0xb26de28) at rts/Sim/Units/Unit.cpp:1296
#1 0x082e86e2 in CUnit::DoDamage (this=0x8c9a6f8, damages=@0xbfdfd8e0,
attacker=0xb26de28, impulse=@0xbfdfd910) at rts/Sim/Units/Unit.cpp:633
#2 0x081643d9 in CGameHelper::Explosion (this=0x8a63cb0, pos=@0xbfdfd9c0,
damages=@0x8d848f0, radius=24, edgeEffectiveness=0,
explosionSpeed=97784.6484, owner=0xb26de28, damageGround=true, gfxMod=1,
ignoreOwner=false, explosionGraphics=0x8ec7bc0, hit=0x8c9a6f8,
impactDir=@0xbfdfd9b4) at rts/Game/GameHelper.cpp:119
#3 0x0827845c in CWeaponProjectile::Collision (this=0xb25af88, unit=0x8c9a6f8)
at rts/Sim/Projectiles/WeaponProjectile.cpp:120
#4 0x082790f7 in CMissileProjectile::Collision (this=0xb25af88,
unit=0x8c9a6f8) at rts/Sim/Projectiles/MissileProjectile.cpp:109
#5 0x0825ebb2 in CProjectileHandler::CheckUnitCol (this=0x8824858)
at rts/Sim/Projectiles/ProjectileHandler.cpp:518
#6 0x0817a4ac in CGame::SimFrame (this=0x8950570) at rts/Game/Game.cpp:1896
#7 0x0818af8e in CGame::ClientReadNet (this=0x8950570)
at rts/Game/Game.cpp:2304
#8 0x0818cdb1 in CGame::Update (this=0x8950570) at rts/Game/Game.cpp:1470
#9 0x080ea02f in SpringApp::Update (this=0xbfdfe584)
at rts/System/Main.cpp:812
#10 0x080eddd5 in SpringApp::Run (this=0xbfdfe584, argc=2, argv=0xbfdfe674)
at rts/System/Main.cpp:990
#11 0x080ee10a in Run (argc=2, argv=0xbfdfe674) at rts/System/Main.cpp:1047
#12 0x080ee222 in main (argc=Cannot access memory at address 0x1
) at rts/System/Main.cpp:1087
-
- Posts: 272
- Joined: 30 May 2006, 17:06
Speccing BA4.7, 6v6 on SSBv2
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1241999664 (LWP 6258)]
0xb77ba226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb77ba226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
#1 0xb77baa44 in free () from /lib/tls/i686/cmov/libc.so.6
#2 0xb796afc1 in operator delete () from /usr/lib/libstdc++.so.6
#3 0x082ee883 in ~CCommandAI (this=0xb746490)
at /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/ext/new_allocator.h:94
#4 0x08300825 in ~CFactoryCAI (this=0xb746490)
at rts/Sim/Units/CommandAI/FactoryCAI.cpp:96
#5 0x082e989b in ~CUnit (this=0xcbd4380) at rts/Sim/Units/Unit.cpp:213
#6 0x08314717 in ~CFactory (this=0xcbd4380)
at rts/Sim/Units/UnitTypes/Factory.cpp:54
#7 0x082c8df6 in CUnitHandler::Update (this=0x9e87fa8)
at rts/Sim/Units/UnitHandler.cpp:206
#8 0x0817a493 in CGame::SimFrame (this=0x89c31d0) at rts/Game/Game.cpp:1893
#9 0x0818af8e in CGame::ClientReadNet (this=0x89c31d0)
at rts/Game/Game.cpp:2304
#10 0x0818cdb1 in CGame::Update (this=0x89c31d0) at rts/Game/Game.cpp:1470
#11 0x080ea02f in SpringApp::Update (this=0xbfebee44)
at rts/System/Main.cpp:812
#12 0x080eddd5 in SpringApp::Run (this=0xbfebee44, argc=2, argv=0xbfebef34)
at rts/System/Main.cpp:990
#13 0x080ee10a in Run (argc=2, argv=0xbfebef34) at rts/System/Main.cpp:1047
#14 0x080ee222 in main (argc=Cannot access memory at address 0x1
) at rts/System/Main.cpp:1087
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1241999664 (LWP 6258)]
0xb77ba226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb77ba226 in mallopt () from /lib/tls/i686/cmov/libc.so.6
#1 0xb77baa44 in free () from /lib/tls/i686/cmov/libc.so.6
#2 0xb796afc1 in operator delete () from /usr/lib/libstdc++.so.6
#3 0x082ee883 in ~CCommandAI (this=0xb746490)
at /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/ext/new_allocator.h:94
#4 0x08300825 in ~CFactoryCAI (this=0xb746490)
at rts/Sim/Units/CommandAI/FactoryCAI.cpp:96
#5 0x082e989b in ~CUnit (this=0xcbd4380) at rts/Sim/Units/Unit.cpp:213
#6 0x08314717 in ~CFactory (this=0xcbd4380)
at rts/Sim/Units/UnitTypes/Factory.cpp:54
#7 0x082c8df6 in CUnitHandler::Update (this=0x9e87fa8)
at rts/Sim/Units/UnitHandler.cpp:206
#8 0x0817a493 in CGame::SimFrame (this=0x89c31d0) at rts/Game/Game.cpp:1893
#9 0x0818af8e in CGame::ClientReadNet (this=0x89c31d0)
at rts/Game/Game.cpp:2304
#10 0x0818cdb1 in CGame::Update (this=0x89c31d0) at rts/Game/Game.cpp:1470
#11 0x080ea02f in SpringApp::Update (this=0xbfebee44)
at rts/System/Main.cpp:812
#12 0x080eddd5 in SpringApp::Run (this=0xbfebee44, argc=2, argv=0xbfebef34)
at rts/System/Main.cpp:990
#13 0x080ee10a in Run (argc=2, argv=0xbfebef34) at rts/System/Main.cpp:1047
#14 0x080ee222 in main (argc=Cannot access memory at address 0x1
) at rts/System/Main.cpp:1087
-
- Posts: 272
- Joined: 30 May 2006, 17:06
Tobi told me these stack traces are useless because they refer to math exceptions that only happen in debug mode. As such, he suggested 2 modifications to the source code to allow the search for the linux hang bug to not be stopped by these preventable math hangs.
These are the changes:
[1:40:01 AM] <Tobi> what i modified is I commented out the line with feraiseexcept (search for it) in Game.cpp
[1:40:45 AM] <Tobi> hmm and i see i also modified it to give back excess cpu% to the OS
[1:42:01 AM] <Tobi> did that by inserting else {SDL_Delay(1);} at line 1506
[1:42:41 AM] <Tobi> just after a if (!gu->active) block
These are the changes:
[1:40:01 AM] <Tobi> what i modified is I commented out the line with feraiseexcept (search for it) in Game.cpp
[1:40:45 AM] <Tobi> hmm and i see i also modified it to give back excess cpu% to the OS
[1:42:01 AM] <Tobi> did that by inserting else {SDL_Delay(1);} at line 1506
[1:42:41 AM] <Tobi> just after a if (!gu->active) block