Author Topic: [fixed] v3.5.2: Segfault while reloading last games' settings  (Read 765 times)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
I think I reported this or a similar bug before, so this may already be fixed for the next release. I'm reporting this in case it is not....

When I started hosting an Internet game lobby (with network slots), then hit the 'reload last game settings' button, MegaGlest segfaulted.

Error message and backtrace:

Code: [Select]
v3.5.2-GNUC: 40401 [64bit]-May 26 2011 09:59:59, SVN: [Rev: 2305], [STREFLOP]
megaglest: /home/softcoder/Code/megaglest/trunk/source/glest_game/facilities/components.cpp:318: void Glest::Game::GraphicListBox::setSelectedItemIndex(int, bool): Assertion `index>=0 && index<items.size()' failed.
Aborted (core dumped)

Core was generated by `./megaglest'.
Program terminated with signal 6, Aborted.
#0  0x00007fc26685fd05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64    ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
    in ../nptl/sysdeps/unix/sysv/linux/raise.c
#0  0x00007fc26685fd05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007fc266863ab6 in abort () at abort.c:92
#2  0x00007fc2668587c5 in __assert_fail (assertion=0xa99260 "v >= 0 && v < 4", file=<value optimized out>, line=155, function=<value optimized out>) at assert.c:81
#3  0x00000000005e89a7 in Glest::Game::CardinalDir::assertDirValid (v=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/game/game_constants.h:155
#4  0x000000000075d79b in Glest::Game::NetworkCommand::preprocessNetworkCommand (this=0x7fc23944702c, world=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/network/network_types.cpp:79
#5  0x00000000005e5642 in Glest::Game::Commander::giveNetworkCommand (this=0x7fc24178b1c0, networkCommand=0x7fc23944702c) at /home/softcoder/Code/megaglest/trunk/source/glest_game/game/commander.cpp:567
#6  0x00000000005e5d1f in Glest::Game::Commander::updateNetwork (this=0x7fc24178b1c0, game=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/game/commander.cpp:513
#7  0x00000000005d6ab9 in Glest::Game::Game::update (this=0x7fc241789f80) at /home/softcoder/Code/megaglest/trunk/source/glest_game/game/game.cpp:872
#8  0x000000000065a269 in Glest::Game::Program::loopWorker (this=0x14908d0) at /home/softcoder/Code/megaglest/trunk/source/glest_game/main/program.cpp:305
#9  0x0000000000654625 in Glest::Game::glestMain (argc=<value optimized out>, argv=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp:2995
#10 0x0000000000655c14 in Glest::Game::glestMainWrapper (argc=1, argv=0x7fff50ae2b38) at /home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp:3079
#11 0x00007fc26684aeff in __libc_start_main (main=0x655cd0 <main(int, char**)>, argc=1, ubp_av=0x7fff50ae2b38, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fff50ae2b28) at libc-start.c:226
#12 0x0000000000574429 in _start () at ../sysdeps/x86_64/elf/start.S:113

Contents of ~/.megaglest/lastCustomGamSettings.mgg:
Code: [Select]
Description=Conflict
MapFilterIndex=0
Map=conflict
Tileset=fernland
TechTree=megapack
DefaultUnits=1
DefaultResources=1
DefaultVictoryConditions=1
FogOfWar=1
AdvancedIndex=0
AllowObservers=0
FlagTypes1=0
EnableObserverModeAtEndGame=1
PathFinderType=0
EnableServerControlledAI=1
NetworkFramePeriod=20
NetworkPauseGameForLaggedClients=1
FactionThisFactionIndex=0
FactionCount=2
FactionControlForIndex0=7
ResourceMultiplierIndex0=5
FactionTeamForIndex0=0
FactionStartLocationForIndex0=0
FactionTypeNameForIndex0=egypt
FactionPlayerNameForIndex0=tomreyn
FactionControlForIndex1=2
ResourceMultiplierIndex1=5
FactionTeamForIndex1=1
FactionStartLocationForIndex1=1
FactionTypeNameForIndex1=indian
FactionPlayerNameForIndex1=AI1
FactionControlForIndex2=0
ResourceMultiplierIndex2=10
FactionTeamForIndex2=2
FactionStartLocationForIndex2=2
FactionTypeNameForIndex2=magic
FactionPlayerNameForIndex2=Closed
FactionControlForIndex3=0
ResourceMultiplierIndex3=10
FactionTeamForIndex3=3
FactionStartLocationForIndex3=3
FactionTypeNameForIndex3=norsemen
FactionPlayerNameForIndex3=Closed
FactionControlForIndex4=0
ResourceMultiplierIndex4=10
FactionTeamForIndex4=4
FactionStartLocationForIndex4=4
FactionTypeNameForIndex4=persian
FactionPlayerNameForIndex4=Closed
FactionControlForIndex5=0
ResourceMultiplierIndex5=10
FactionTeamForIndex5=5
FactionStartLocationForIndex5=5
FactionTypeNameForIndex5=romans
FactionPlayerNameForIndex5=Closed
FactionControlForIndex6=0
ResourceMultiplierIndex6=10
FactionTeamForIndex6=6
FactionStartLocationForIndex6=6
FactionTypeNameForIndex6=tech
FactionPlayerNameForIndex6=Closed
FactionControlForIndex7=0
ResourceMultiplierIndex7=10
FactionTeamForIndex7=7
FactionStartLocationForIndex7=7
FactionTypeNameForIndex7=*Random*
FactionPlayerNameForIndex7=Closed

I assume it's probably related to the *Random* faction, and I have the feeling this was already fixed.
« Last Edit: 7 September 2011, 23:48:46 by tomreyn »
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: [bug] v3.5.2: Segfault while reloading last games' settings
« Reply #1 on: 7 September 2011, 02:28:33 »
The same (?) thing happened again today:

Code: [Select]
v3.5.2-GNUC: 40401 [64bit]-May 26 2011 09:59:59, SVN: [Rev: 2305], [STREFLOP]
megaglest: /home/softcoder/Code/megaglest/trunk/source/glest_game/facilities/components.cpp:318: void Glest::Game::GraphicListBox::setSelectedItemIndex(int, bool): Assertion `index>=0 && index<items.size()' failed.
Aborted (core dumped)

Core was generated by `./megaglest'.
Program terminated with signal 6, Aborted.
#0  0x00007fc6af293d05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64    ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
    in ../nptl/sysdeps/unix/sysv/linux/raise.c
#0  0x00007fc6af293d05 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007fc6af297ab6 in abort () at abort.c:92
#2  0x00007fc6af28c7c5 in __assert_fail (assertion=0xa96af8 "index>=0 && index<items.size()", file=<value optimized out>, line=318, function=<value optimized out>) at assert.c:81
#3  0x00000000005bbe86 in Glest::Game::GraphicListBox::setSelectedItemIndex (this=0x20de8d8, index=<value optimized out>, errorOnMissing=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/facilities/components.cpp:318
#4  0x00000000007057d7 in Glest::Game::MenuStateCustomGame::setupUIFromGameSettings (this=0x20dd800, gameSettings=...) at /home/softcoder/Code/megaglest/trunk/source/glest_game/menu/menu_state_custom_game.cpp:2580
#5  0x000000000071b906 in Glest::Game::MenuStateCustomGame::loadGameSettingsFromFile (this=<value optimized out>, fileName=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/menu/menu_state_custom_game.cpp:2503
#6  0x000000000071c67f in Glest::Game::MenuStateCustomGame::RestoreLastGameSettings (this=0x20dd800) at /home/softcoder/Code/megaglest/trunk/source/glest_game/menu/menu_state_custom_game.cpp:1072
#7  0x000000000071fde3 in Glest::Game::MenuStateCustomGame::mouseClick (this=0x20dd800, x=448, y=192, mouseButton=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/menu/menu_state_custom_game.cpp:699
#8  0x0000000000641555 in Glest::Game::MainWindow::eventMouseDown (this=0x1723b00, x=<value optimized out>, y=<value optimized out>, mouseButton=Shared::Platform::mbLeft) at /home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp:628
#9  0x00000000008a7c18 in Shared::Platform::Window::handleMouseDown (this=0x1723b00, event=...) at /home/softcoder/Code/megaglest/trunk/source/shared_lib/sources/platform/sdl/window.cpp:548
#10 0x00000000008a8172 in Shared::Platform::Window::handleEvent () at /home/softcoder/Code/megaglest/trunk/source/shared_lib/sources/platform/sdl/window.cpp:130
#11 0x0000000000654619 in Glest::Game::glestMain (argc=<value optimized out>, argv=<value optimized out>) at /home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp:2994
#12 0x0000000000655c14 in Glest::Game::glestMainWrapper (argc=1, argv=0x7fffb201e668) at /home/softcoder/Code/megaglest/trunk/source/glest_game/main/main.cpp:3079
#13 0x00007fc6af27eeff in __libc_start_main (main=0x655cd0 <main(int, char**)>, argc=1, ubp_av=0x7fffb201e668, init=<value optimized out>, fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fffb201e658) at libc-start.c:226
#14 0x0000000000574429 in _start () at ../sysdeps/x86_64/elf/start.S:113

$ cat .megaglest/lastCustomGamSettings.mgg
Description=Valley Of Death
MapFilterIndex=2
Map=valley_of_death
Tileset=karningul
TechTree=megapack
DefaultUnits=1
DefaultResources=1
DefaultVictoryConditions=1
FogOfWar=1
AdvancedIndex=0
AllowObservers=0
FlagTypes1=0
EnableObserverModeAtEndGame=1
PathFinderType=0
EnableServerControlledAI=1
NetworkFramePeriod=20
NetworkPauseGameForLaggedClients=1
FactionThisFactionIndex=0
FactionCount=1
FactionControlForIndex0=7
ResourceMultiplierIndex0=5
FactionTeamForIndex0=0
FactionStartLocationForIndex0=0
FactionTypeNameForIndex0=magic
FactionPlayerNameForIndex0=tomreyn
FactionControlForIndex1=0
ResourceMultiplierIndex1=10
FactionTeamForIndex1=1
FactionStartLocationForIndex1=1
FactionTypeNameForIndex1=indian
FactionPlayerNameForIndex1=Closed
FactionControlForIndex2=0
ResourceMultiplierIndex2=10
FactionTeamForIndex2=2
FactionStartLocationForIndex2=2
FactionTypeNameForIndex2=magic
FactionPlayerNameForIndex2=Closed
FactionControlForIndex3=0
ResourceMultiplierIndex3=10
FactionTeamForIndex3=3
FactionStartLocationForIndex3=3
FactionTypeNameForIndex3=norsemen
FactionPlayerNameForIndex3=Closed
FactionControlForIndex4=0
ResourceMultiplierIndex4=10
FactionTeamForIndex4=4
FactionStartLocationForIndex4=4
FactionTypeNameForIndex4=persian
FactionPlayerNameForIndex4=Closed
FactionControlForIndex5=0
ResourceMultiplierIndex5=10
FactionTeamForIndex5=5
FactionStartLocationForIndex5=5
FactionTypeNameForIndex5=romans
FactionPlayerNameForIndex5=Closed
FactionControlForIndex6=0
ResourceMultiplierIndex6=10
FactionTeamForIndex6=6
FactionStartLocationForIndex6=6
FactionTypeNameForIndex6=tech
FactionPlayerNameForIndex6=Closed
FactionControlForIndex7=0
ResourceMultiplierIndex7=10
FactionTeamForIndex7=7
FactionStartLocationForIndex7=7
FactionTypeNameForIndex7=*Random*
FactionPlayerNameForIndex7=Closed
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: [bug] v3.5.2: Segfault while reloading last games' settings
« Reply #2 on: 7 September 2011, 07:52:01 »
in the saved settings I see:
FactionControlForIndex0=7

this means somehow the saved control must be NetworkCpuEasy. I think this is only possible when you started with EnableNetworkCpu=true in (glest.ini) .
Maybe you started svn before and had this switch on there in glest.ini?

In this case you will run into an assert in 3.5.2, not nice, but I don't think this is too critical as this is more a debug setting meant to test the Network.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: [bug] v3.5.2: Segfault while reloading last games' settings
« Reply #3 on: 7 September 2011, 09:02:09 »
Hmm, I do use the same UserData_Root directory for 3.5.2 and my development builds, namely ~/.megaglest. I do not, however, use the same glest.ini. I do not have a system wide MegaGlest installation here (I have since purged the MegaGlest deb packages I had installed a while ago).

And the option you refer to is nowhere to be found:
Code: [Select]
$ fgrep -i NetworkCpu ~/.megaglest/glest*.ini ~/megaglest-3.5.2/glest*.ini ~/SCM/megaglest-trunk/mk/linux/glest*.ini
$

What may be possible is that EnableNetworkCpu=true is a new (hardcoded) default in the development builds, which, at runtime, propagates into ~/.megaglest/lastCustomGamSettings.mg. And that later games in 3.5.2 where I try to reload the last games' settings crash due to this. Would this seem realistic?
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: [bug] v3.5.2: Segfault while reloading last games' settings
« Reply #4 on: 7 September 2011, 13:56:30 »
yes or something different in the new version which allows "7" as control
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: [bug] v3.5.2: Segfault while reloading last games' settings
« Reply #5 on: 7 September 2011, 23:48:33 »
Softcoder fixed this in r2527. Thanks!
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

 

anything