Author Topic: [fixed] 3209: MegaGlest crashes with multiple units selected for a longer time  (Read 982 times)

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
I noticed that whenever I reloaded a savegame, memory allocation of MegaGlest seemed to increased. Actually it pretty much stopped increasing after reaching about reaching 670 MB, though. After reloading yet another savegame I had created on the same revision of MegaGlest, I ended up with many archers which were still selected (that's how the game had been saved). But there is this delay after larger games get reloaded. So I did not do anything but click on the ground, hoping to deselect my archers this way. However, this actually seemed to have triggered this issue:

Code: [Select]
megaglest v3.6.1-dev
Compiled using: GNUC: 40601 [64bit] on: Mar 31 2012 22:11:45
SVN: [Rev: 3209M] - using STREFLOP [SSE] - [no-denormals]
In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 634] Error detected: signal 11:
Error saved to logfile [/home/tomreyn/.megaglest/error.log]

Segmentation fault detected, analyzing...

warning:
Can't read pathname for load map: Eingabe-/Ausgabefehler.
[Thread debugging using libthread_db enabled]
Core was generated by `./megaglest'.
Program terminated with signal 11, Segmentation fault.
#0  0x000000000085dcdf in isInside (y=1065353216, x=0, this=0x0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/world/map.cpp:562
562        return x>=0 && y>=0 && x<w && y<h;
#0  0x000000000085dcdf in isInside (y=1065353216, x=0, this=0x0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/world/map.cpp:562
#1  Glest::Game::Map::isInside (this=0x0, pos=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/world/map.cpp:566
#2  0x00000000007bf4c5 in Glest::Game::Unit::computeHeight (this=0x7f9fb05c2790, pos=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:2717
#3  0x00000000007bf6e1 in Glest::Game::Unit::getVectorFlat (this=0x7f9fb05c2790, lastPosValue=..., curPosValue=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1212
#4  0x00000000007bf7c7 in Glest::Game::Unit::getCurrVectorFlat (this=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1185
#5  0x00000000005ce689 in Glest::Game::Renderer::renderSelectionEffects (this=0xc74260) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:4711
#6  0x000000000054296c in Glest::Game::Game::render3d (this=0x7f9fbb77def0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:2833
#7  0x00000000005658f2 in Glest::Game::Game::renderWorker (this=0x7f9fbb77def0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:1662
#8  0x0000000000565e18 in Glest::Game::Game::render (this=0x7f9fbb77def0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:1592
#9  0x0000000000633566 in Glest::Game::Program::loopWorker (this=0x1f0fd10) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/program.cpp:391
#10 0x0000000000629dd5 in Glest::Game::ExceptionHandler::handleRuntimeError (msg=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:512
#11 0x0000000000616442 in Glest::Game::handleSIGSEGV (sig=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:638
#12 <signal handler called>
#13 0x000000000085dcdf in isInside (y=1065353216, x=0, this=0x0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/world/map.cpp:562
#14 Glest::Game::Map::isInside (this=0x0, pos=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/world/map.cpp:566
#15 0x00000000007bf4c5 in Glest::Game::Unit::computeHeight (this=0x7f9fb05c2790, pos=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:2717
#16 0x00000000007bf6e1 in Glest::Game::Unit::getVectorFlat (this=0x7f9fb05c2790, lastPosValue=..., curPosValue=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1212
#17 0x00000000007bf7c7 in Glest::Game::Unit::getCurrVectorFlat (this=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1185
#18 0x00000000005ce689 in Glest::Game::Renderer::renderSelectionEffects (this=0xc74260) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:4711
#19 0x000000000054296c in Glest::Game::Game::render3d (this=0x7f9fbb77def0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:2833
#20 0x00000000005658f2 in Glest::Game::Game::renderWorker (this=0x7f9fbb77def0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:1662
#21 0x0000000000565e18 in Glest::Game::Game::render (this=0x7f9fbb77def0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:1592
#22 0x0000000000633566 in Glest::Game::Program::loopWorker (this=0x1f0fd10) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/program.cpp:391
#23 0x0000000000620c10 in Glest::Game::glestMain (argc=<optimized out>, argv=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:3849
#24 0x0000000000623f56 in Glest::Game::glestMainWrapper (argc=1, argv=0x7fff2ca42ce8) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:4005
#25 0x00007f9ff5f3130d in __libc_start_main (main=0x4aafc0 <main(int, char**)>, argc=1, ubp_av=0x7fff2ca42ce8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff2ca42cd8) at libc-start.c:226
#26 0x00000000004b0439 in _start ()

So I'm not entirely sure how to reproduce it unfortunately. Maybe the stacktrace can provide enough info.
« Last Edit: 14 April 2012, 21:16:00 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
I assume this one is related. Like the above crash, this occurs about three minutes after loading this savegame (screenshot) (which I think was produced on r3209, too), and not clicking anywhere or doing anything.

Code: [Select]
$ ./dev_rungame
megaglest v3.6.1-dev
Compiled using: GNUC: 40601 [64bit] on: Mar 31 2012 22:11:45
SVN: [Rev: 3209M] - using STREFLOP [SSE] - [no-denormals]
In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 634] Error detected: signal 11:
Error saved to logfile [/home/tomreyn/.megaglest/error.log]
[2012-03-31 23:53:36] *ERROR* In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 407] [In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 634] Error detected: signal 11:
] gameInitialized = 1, program = 0x2306ba0
[2012-03-31 23:53:38] *ERROR* In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 494] [In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 634] Error detected: signal 11:

Stack Trace:
./megaglest() [0x616442] address [0x616442] line: 638
/lib/x86_64-linux-gnu/libc.so.6:() address [0x7ff9ab9d6420] line: 0
./megaglest:Glest::Game::Map::isInside(Shared::Graphics::Vec2<int> const&) const address [0x85dcdf] line: 562
./megaglest:Glest::Game::Unit::computeHeight(Shared::Graphics::Vec2<int> const&) const address [0x7bf4c5] line: 2717
./megaglest:Glest::Game::Unit::getVectorFlat(Shared::Graphics::Vec2<int> const&, Shared::Graphics::Vec2<int> const&) const address [0x7bf6e1] line: 1213
./megaglest:Glest::Game::Unit::getCurrVectorFlat() const address [0x7bf7c7] line: 1185
./megaglest:Glest::Game::Renderer::renderSelectionEffects() address [0x5ce689] line: 4711
./megaglest:Glest::Game::Game::render3d() address [0x54296c] line: 2834
./megaglest:Glest::Game::Game::renderWorker() address [0x5658f2] line: 1664
./megaglest:Glest::Game::Game::render() address [0x565e18] line: 1623
./megaglest:Glest::Game::Program::loopWorker() address [0x633566] line: 393
./megaglest:Glest::Game::glestMain(int, char**) address [0x620c10] line: 3849
./megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x623f56] line: 4007
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main() address [0x7ff9ab9c130d] line: 0
./megaglest() [0x4b0439] address [0x4b0439] line: 0
]

** Already in error handler, msg [#7 Invalid path position = x [0] y [0]]

Segmentation fault detected, analyzing...

[spurious messages redacted here]
[Thread debugging using libthread_db enabled]
64    ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
Core was generated by `./megaglest'.
Program terminated with signal 6, Aborted.
#0  0x00007ff9ab9d63a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
    in ../nptl/sysdeps/unix/sysv/linux/raise.c
#0  0x00007ff9ab9d63a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ff9ab9d9b0b in __GI_abort () at abort.c:92
#2  0x0000000000629542 in Glest::Game::ExceptionHandler::handleRuntimeError (msg=0x7ff97ea8afa8 "#7 Invalid path position = x [0] y [0]") at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:399
#3  0x000000000061c885 in Glest::Game::glestMain (argc=<optimized out>, argv=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:3898
#4  0x0000000000623f56 in Glest::Game::glestMainWrapper (argc=1, argv=0x7fff0d8e50b8) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:4005
#5  0x00007ff9ab9c130d in __libc_start_main (main=0x4aafc0 <main(int, char**)>, argc=1, ubp_av=0x7fff0d8e50b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff0d8e50a8) at libc-start.c:226
#6  0x00000000004b0439 in _start ()

As you will notice while reproducing this crash from the above savegame, the human players' archers who die remain selected, even though their bodies have already vanished. Maybe this is the actual source of this issue?

Edit: I cannot reproduce this issue if I deselect the archers (as soon as this becomes possible), so this does indeed seem to be related to unit selection.
« Last Edit: 31 March 2012, 22:17:18 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 · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Are you able to reproduce this on a current build? This may have been related to some lua bugfixes we made in the past week.

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
I don't know what exactly triggered this crash, so it's hard to reproduce it. Would I need to create a new savegame to see if its reproducible? If so, I probably cannot reproduce it since I do not know what caused this situation to occur.

I cannot reproduce the delay where you cannot deselect units or give orders after game loading for up to ~1 minute on r3235, though.

Update: I just played the "Amazones light" scenario again to the point where the restored savegame crashed last time, created a new savegame (screenshot) there, restarted MegaGlest, reloaded the savegame, did not click anywhere (not even deselect the selected units) and voila, it's still crashing:

Code: [Select]
tomreyn@atibox:~/SCM/megaglest-trunk/mk/linux$ ./dev_rungame
megaglest v3.6.1-dev
Compiled using: GNUC: 40601 [64bit] on: Apr 11 2012 13:02:44
SVN: [Rev: 3235M] - using STREFLOP [SSE] - [no-denormals]
Error saved to logfile [/home/tomreyn/.megaglest/error.log]
terminate called after throwing an instance of 'std::runtime_error'
  what():  #7 Invalid path position = x [1696282424] y [32607]
[2012-04-11 13:25:25] *ERROR* In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 407] [#7 Invalid path position = x [1696282424] y [32607]] gameInitialized = 1, program = 0x2182930
[2012-04-11 13:25:25] *ERROR* In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 494] [#7 Invalid path position = x [1696282424] y [32607]
Stack Trace:
./megaglest:Glest::Game::glestMain(int, char**) address [0x628d9d] line: 4617
./megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x6330d6] line: 4726
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main() address [0x7f5fa193130d] line: 0
./megaglest() [0x4b0839] address [0x4b0839] line: 0
]

[irrelevant output redacted]

Core was generated by `./megaglest'.
Program terminated with signal 6, Aborted.
#0  0x00007f5fa19463a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
    in ../nptl/sysdeps/unix/sysv/linux/raise.c
#0  0x00007f5fa19463a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f5fa1949b0b in __GI_abort () at abort.c:92
#2  0x00007f5fa1f82d7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007f5fa1f80f26 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007f5fa1f80f53 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007f5fa1f8104e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00000000007cf66a in Glest::Game::Unit::computeHeight (this=<optimized out>, pos=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:2720
#7  0x00000000007cf821 in Glest::Game::Unit::getVectorFlat (this=0x7f5f6532fb20, lastPosValue=..., curPosValue=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1214
#8  0x00000000007cf907 in Glest::Game::Unit::getCurrVectorFlat (this=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1187
#9  0x00000000005d0371 in Glest::Game::Renderer::renderSelectionEffects (this=0xc862a0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:4777
#10 0x000000000054302c in Glest::Game::Game::render3d (this=0x7f5f71d4eb80) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:2833
#11 0x0000000000565fd2 in Glest::Game::Game::renderWorker (this=0x7f5f71d4eb80) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:1662
#12 0x00000000005664f8 in Glest::Game::Game::render (this=0x7f5f71d4eb80) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:1592
#13 0x0000000000642606 in Glest::Game::Program::loopWorker (this=0x2182930) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/program.cpp:409
#14 0x00000000006383a5 in Glest::Game::ExceptionHandler::handleRuntimeError (msg=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:512
#15 0x0000000000628d9d in Glest::Game::glestMain (argc=<optimized out>, argv=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:4617
#16 0x00000000006330d6 in Glest::Game::glestMainWrapper (argc=1, argv=0x7fff4520b478) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:4724
#17 0x00007f5fa193130d in __libc_start_main (main=0x4ab3c0 <main(int, char**)>, argc=1, ubp_av=0x7fff4520b478, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff4520b468) at libc-start.c:226
#18 0x00000000004b0839 in _start ()

 After restoring the savegame you will notice that some of the already selected units die, and that they remain selected. This could be a contributing factor.
« Last Edit: 11 April 2012, 11:39:38 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 · · ·

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Fixed in svn, this was a long standing bug, if a unit was selected and the unit dies and the player did not change the selection, eventually the program would crash.

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
And confirmed, thanks for looking into this, I bet this one wasn't easy. I realize the selection circles around dead units disappear after a while now, and with the savegame I provided MG no longer crashes. :-)
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