This is not really news, but I'd like to document that the game may freeze if too many units are present.
Here's what and how it happened today:
We just had a large (>600 units) and very long game, 3 humans (all magic) against 3 Indian CPUs. I was hosting (on SVN r2312, the other players were on 3.5.2). One player got disconnected due to a time-out, but the other human player was still on my server. And we kept playing against 3 CPUs. At some point the game became so slow that it seemed to be frozen. The camera and units would not move for some minutes and when I pressed ALT-enter it took some more minutes until it went into windowed mode (I was surprised it did at all).
One or two minutes after I pressed ALT-enter and before it actually went into windowed mode the game switched to a screen saying "generating AI for player 1" (or similar), and then was stuck there at a low percentage of the progress bar. Maybe the other human player timed out, too, and so got replaced by CPU. But this would mean it took (close to?) indefinitely to generate the replacement CPU player. Which could be, since my quad core CPU was all maxed out at this time and for several minutes.
I then put the MG window in the background and started documenting what happened on IRC. When I checked it again some minutes later CP load was down to a low value (unusually low for MG) and the MG window was all black and remained this way for several other minutes. At this time, the console contained these messages:
[many more socket write timeouts here]
[2011-05-28 19:12:15] *ERROR* SOCKET WRITE TIMEOUT In [/home/user1/SCM/megaglest-trunk/source/shared_lib/sources/platform/posix/socket.cpp::isWritable Line: 1463] i = 0 sock = 15
In [/home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 574] Error detected: signal 11:
[2011-05-28 19:15:41] *ERROR* In [/home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cp
At this time a stck trace on the running/frozen process would return this:
0x00007fbe4ccb85ae in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#0 0x00007fbe4ccb85ae in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007fbe4cc4137e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007fbe4cc3967c in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007fbe4cc70635 in fork () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007fbe4cc2c349 in _IO_proc_open () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007fbe4cc2c639 in popen () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00000000005772e2 in getFileAndLine (msg=<value optimized out>) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp:308
#7 Glest::Game::ExceptionHandler::handleRuntimeError (msg=<value optimized out>) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp:426
#8 0x00000000005619e2 in Glest::Game::handleSIGSEGV (sig=<value optimized out>) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp:577
#9 <signal handler called>
#10 0x00007fbe4cc3abda in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x00007fbe4cc3c472 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#12 0x00007fbe4cc3f31e in malloc () from /lib/x86_64-linux-gnu/libc.so.6
#13 0x00007fbe4d4abe0d in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#14 0x000000000073fa16 in allocate (this=0x7fff3e9459f8, __position=..., __x=<value optimized out>) at /usr/include/c++/4.5/ext/new_allocator.h:89
#15 _M_allocate (this=0x7fff3e9459f8, __position=..., __x=<value optimized out>) at /usr/include/c++/4.5/bits/stl_vector.h:140
#16 std::vector<Glest::Game::SurfaceCell*, std::allocator<Glest::Game::SurfaceCell*> >::_M_insert_aux (this=0x7fff3e9459f8, __position=..., __x=<value optimized out>) at /usr/include/c++/4.5/bits/vector.tcc:322
#17 0x000000000073b3eb in push_back (this=0x2bde520, newPos=..., sightRange=14, teamIndex=1) at /usr/include/c++/4.5/bits/stl_vector.h:749
#18 Glest::Game::World::exploreCells (this=0x2bde520, newPos=..., sightRange=14, teamIndex=1) at /home/user1/SCM/megaglest-trunk/source/glest_game/world/world.cpp:1386
#19 0x00000000006a843a in Glest::Game::Unit::exploreCells (this=0x7fbe0eafdf30) at /home/user1/SCM/megaglest-trunk/source/glest_game/type_instances/unit.cpp:1945
#20 0x000000000073bad0 in Glest::Game::World::computeFow (this=0x2bde520, factionIdxToTick=-1) at /home/user1/SCM/megaglest-trunk/source/glest_game/world/world.cpp:1536
#21 0x000000000073d30f in Glest::Game::World::tick (this=0x2bde520) at /home/user1/SCM/megaglest-trunk/source/glest_game/world/world.cpp:488
#22 0x000000000050b402 in Glest::Game::Game::update (this=0x2bde4f0) at /home/user1/SCM/megaglest-trunk/source/glest_game/game/game.cpp:866
#23 0x0000000000583378 in Glest::Game::Program::loopWorker (this=0x245ee80) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/program.cpp:305
#24 0x0000000000574334 in Glest::Game::glestMain (argc=<value optimized out>, argv=<value optimized out>) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp:2995
#25 0x0000000000575f30 in glestMainWrapper (argc=1, argv=0x7fff3e9484a8) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp:3079
#26 main (argc=1, argv=0x7fff3e9484a8) at /home/user1/SCM/megaglest-trunk/source/glest_game/main/main.cpp:3101
I ran this a couple times and always got the exact same stack trace.
So if I interpret this correctly (chances are I do not) then a segmentation fault had occurred there but the process used to analyse segmentation faults was stuck. I think I've seen this before.
I finally needed to kill -9 since a default kill would not work. No core file was created (but ulimit -c unlimited was set).
Maybe the code to handle / trigger segmentation faults is not safe enough to rely on?
Maybe we need a unit limit (500 units?)?