Author Topic: [fixed] 3.9.0 & r4539: MegaGlest can sometimes get stuck on "Unloading World"  (Read 1272 times)

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
MegaGlest can sometimes get stuck on message: "Unloading World" for forever (max. test time ~10 minutes).
Issue is also present in git head.

It's especially very annoying in full screen mode.
It's hard to reproduce, but usually occurs after a bit heavier/ longer game with a lot of units.

MegaGlest then behaves as follows:
- "game's graphics" is stuck, main "X" button (window mode) doesn't work,
- game process looks unbusy, low cpu load ~1-2%, memory consumtion not growing,
- console output is clean.
« Last Edit: 10 January 2014, 19:14:57 by filux »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Next time you get this try running this command in linux to get as backtrace of the stuck process and paste here:

Code: [Select]
gdb -q -n -ex bt -batch megaglest `pidof megaglest` | tee /tmp/test

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Output from 3.9.0 after a long battle

(click to show/hide)
Quote
[New LWP 28461]
[New LWP 28460]
[New LWP 28459]
[New LWP 28458]
[New LWP 28457]
[New LWP 28450]
[New LWP 28327]
[New LWP 28326]
[New LWP 28325]
[New LWP 28323]
[New LWP 28322]
[New LWP 28320]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007fad1e4d4502 in pthread_join (threadid=140381112489728, thread_return=thread_return@entry=0x0) at pthread_join.c:92
#0  0x00007fad1e4d4502 in pthread_join (threadid=140381112489728, thread_return=thread_return@entry=0x0) at pthread_join.c:92
#1  0x00007fad1e73d59b in SDL_SYS_WaitThread (thread=thread@entry=0x1981ee20) at src/thread/pthread/SDL_systhread.c:107
#2  0x00007fad1e6fddb6 in SDL_WaitThread (thread=0x1981ee20, status=0x0) at src/thread/SDL_thread.c:272
#3  0x0000000000aa915c in Shared::Platform::Thread::~Thread() ()
#4  0x0000000000a6574a in Shared::PlatformCommon::BaseThread::~BaseThread() ()
#5  0x00000000008f6a97 in Glest::Game::FactionThread::~FactionThread() ()
#6  0x0000000000901f77 in Glest::Game::Faction::end() ()
#7  0x00000000009b3e10 in Glest::Game::World::end() ()
#8  0x000000000057365b in Glest::Game::Game::~Game() ()
#9  0x00000000005751b9 in Glest::Game::Game::~Game() ()
#10 0x00000000006bf94a in Glest::Game::BattleEnd::~BattleEnd() ()
#11 0x00000000006c0129 in Glest::Game::BattleEnd::~BattleEnd() ()
#12 0x0000000000660b9f in Glest::Game::Program::setState(Glest::Game::ProgramState*, bool) ()
#13 0x00000000006b3f95 in Glest::Game::BattleEnd::mouseDownLeft(int, int) ()
#14 0x000000000069de68 in Glest::Game::MainWindow::eventMouseDown(int, int, Shared::Platform::MouseButton) ()
#15 0x0000000000ab64e3 in Shared::Platform::Window::handleMouseDown(SDL_Event) ()
#16 0x0000000000ab71ac in Shared::Platform::Window::handleEvent() ()
#17 0x00000000006a5ea0 in Glest::Game::glestMain(int, char**) ()
#18 0x00000000006ad131 in Glest::Game::glestMainSEHWrapper(int, char**) ()
#19 0x00007fad1b2acbe5 in __libc_start_main (main=0x4dc080 <main>, argc=1, argv=0x7fff1c660418, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff1c660408) at libc-start.c:269
#20 0x00000000004e24b9 in _start ()

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Please try git head and see if this can be reproduced. I tried to add some code to attempt to fix this.

filux

  • MegaGlest Team
  • Draco Rider
  • ********
  • Posts: 310
  • was OpenSuse x64, is Debian testing x64
    • View Profile
Looks like it's fixed now.

Note:
Solution is little more sensitive than I had problems.
In most cases "solution" produces for me in console:
Code: [Select]
**WARNING** thread destructor delayed, trying to exit...
**WARNING** thread destructor delayed, trying to exit... 
but message can be also received once or three times.