I think this can be a different issue, since I didn't have this problem you discussed here initially (50% probability for segfault when exiting).
I do have it on r4148, though. The game actually freezes after printing this line:
In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5192] Error detected: signal 11:
Backtrace:
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
__lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:93
93 ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.
#0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:93
#1 0x00007f62be90a231 in _L_lock_10656 () at malloc.c:5220
#2 0x00007f62be907fb7 in __GI___libc_malloc (bytes=140062084028224) at malloc.c:2921
#3 0x00007f62bf1b560d in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007f62bf2123b9 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007f62bf213d95 in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007f62bf213e73 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x000000000065da29 in Glest::Game::ExceptionHandler::logError (msg=msg@entry=0x7fff1fe37840 "In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5192] Error detected: signal 11:\n", confirmToConsole=confirmToConsole@entry=true) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:526
#8 0x0000000000679f2a in Glest::Game::ExceptionHandler::handleRuntimeError (msg=msg@entry=0x7fff1fe37840 "In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5192] Error detected: signal 11:\n", getStackTraceString=getStackTraceString@entry=true) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:594
#9 0x000000000067a6cf in Glest::Game::handleSIGSEGV (sig=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:5196
#10 <signal handler called>
#11 malloc_consolidate (av=0x7f62bec3d740 <main_arena>) at malloc.c:4249
#12 0x00007f62be905446 in malloc_consolidate (av=0x7f62bec3d740 <main_arena>) at malloc.c:4226
#13 _int_malloc (av=0x7f62bec3d740 <main_arena>, bytes=4000) at malloc.c:3543
#14 0x00007f62be907fc5 in __GI___libc_malloc (bytes=4000) at malloc.c:2924
#15 0x00007f62bf1b560d in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#16 0x00000000006118f6 in allocate (__n=<optimized out>, this=<optimized out>) at /usr/include/c++/4.7/ext/new_allocator.h:94
#17 _M_allocate (__n=<optimized out>, this=<optimized out>) at /usr/include/c++/4.7/bits/stl_vector.h:169
#18 std::vector<Glest::Game::Unit*, std::allocator<Glest::Game::Unit*> >::_M_allocate_and_copy<Glest::Game::Unit**> (__n=__n@entry=500, __first=0x0, __last=0x0, this=0x7fff1fe39ee0) at /usr/include/c++/4.7/bits/stl_vector.h:1109
#19 0x000000000063d8cd in reserve (__n=500, this=0x7fff1fe39ee0) at /usr/include/c++/4.7/bits/vector.tcc:76
#20 Glest::Game::VisibleQuadContainerCache::clearVolatileCacheData (this=this@entry=0x7fff1fe39e70) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.h:140
#21 0x0000000000646f6d in clearCacheData (this=0x7fff1fe39e70) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.h:131
#22 Glest::Game::VisibleQuadContainerCache::VisibleQuadContainerCache (this=0x7fff1fe39e70) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.h:120
#23 0x000000000062fc50 in Glest::Game::Renderer::endGame (this=0xe411e0 <Glest::Game::Renderer::getInstance()::renderer>, isFinalEnd=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:742
#24 0x00000000005939d0 in Glest::Game::Game::endGame (this=this@entry=0x447da10) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:342
#25 0x00000000005a3c35 in Glest::Game::Game::exitGameState (program=0x2a28960, endStats=...) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/game/game.cpp:4664
#26 0x00000000006a3042 in Glest::Game::Program::loopWorker (this=0x2a28960) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/program.cpp:408
#27 0x0000000000686b40 in Glest::Game::glestMain (argc=argc@entry=1, argv=argv@entry=0x7fff1fe40a68) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:5049
#28 0x000000000068ac96 in Glest::Game::glestMainSEHWrapper (argc=argc@entry=1, argv=argv@entry=0x7fff1fe40a68) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:5288
#29 0x000000000068ae0b in Glest::Game::glestMainWrapper (argc=1, argv=0x7fff1fe40a68) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:5361
#30 0x00007f62be8a676d in __libc_start_main (main=0x50a0e0 <main(int, char**)>, argc=1, ubp_av=0x7fff1fe40a68, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff1fe40a58) at libc-start.c:226
#31 0x0000000000510689 in _start ()