If, for example, you create a savegame which was running on a map you later removed, you'll run into a segmentation fault:
./dev_rungame
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: option value of option vblank_mode ignored.
megaglest v3.6.1-dev
Compiled using: GNUC: 40601 [64bit] on: Mar 31 2012 15:09:09
SVN: [Rev: 3207M] - using STREFLOP [SSE] - [no-denormals]
[2012-03-31 20:19:19] *ERROR* In [program.cpp::setState Line: 569] Error [Map [no_such_map] not found, scenarioDir []]
Error saved to logfile [/home/tomreyn/.megaglest/error.log]
terminate called after throwing an instance of 'std::runtime_error'
what(): font == NULL
[2012-03-31 20:19:19] *ERROR* In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 407] [font == NULL] gameInitialized = 1, program = 0x7f6e68000ad0
[2012-03-31 20:19:20] *ERROR* In [/home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp::handleRuntimeError Line: 494] [font == NULL
Stack Trace:
./megaglest:Glest::Game::glestMain(int, char**) address [0x61b445] line: 3898
./megaglest:Glest::Game::glestMainWrapper(int, char**) address [0x622b16] line: 4007
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main() address [0x7f6e79a2230d] line: 0
./megaglest() [0x4afa69] address [0x4afa69] line: 0
]
Segmentation fault detected, analyzing...
warning: [New LWP 31461]
[New LWP 31465]
[New LWP 31467]
[New LWP 31466]
[New LWP 31469]
[New LWP 31464]
[New LWP 31472]
[New LWP 31470]
[New LWP 31471]
Can't read pathname for load map: Eingabe-/Ausgabefehler.
[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 0x00007f6e79a373a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
in ../nptl/sysdeps/unix/sysv/linux/raise.c
#0 0x00007f6e79a373a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007f6e79a3ab0b in __GI_abort () at abort.c:92
#2 0x00007f6e7a073d7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007f6e7a071f26 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007f6e7a071f53 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007f6e7a07204e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00000000005c2e57 in Glest::Game::Renderer::getCentered3DPos (this=<optimized out>, text=..., font=<optimized out>, pos=..., w=<optimized out>, h=22, centeredW=true, centeredH=true) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:2403
#7 0x00000000005c370c in Glest::Game::Renderer::renderTextBoundingBox3D (this=0xc71260, text=..., font=0x0, color=..., x=<optimized out>, y=<optimized out>, w=90, h=22, centeredW=true, centeredH=true) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:2538
#8 0x00000000005c3c55 in Glest::Game::Renderer::renderButton (this=0xc71260, button=0x7f6e68018a70, fontColorOverride=<optimized out>, lightedOverride=0x0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:2856
#9 0x00000000005c5f89 in renderButton (button=0x7f6e68018a70, this=<optimized out>, fontColorOverride=<optimized out>, lightedOverride=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:2746
#10 Glest::Game::Renderer::renderMessageBox (this=0xc71260, messageBox=0x7f6e68000b20) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/graphics/renderer.cpp:3287
#11 0x00000000006347f4 in Glest::Game::Program::renderProgramMsgBox (this=0x7f6e68000ad0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/program.cpp:476
#12 0x000000000063d137 in Glest::Game::Intro::render (this=0x7f6e5e107a10) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/intro.cpp:751
#13 0x0000000000632126 in Glest::Game::Program::loopWorker (this=0x7f6e68000ad0) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/program.cpp:391
#14 0x0000000000628995 in Glest::Game::ExceptionHandler::handleRuntimeError (msg=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:512
#15 0x000000000061b445 in Glest::Game::glestMain (argc=<optimized out>, argv=<optimized out>) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:3898
#16 0x0000000000622b16 in Glest::Game::glestMainWrapper (argc=1, argv=0x7fff1e1e6c58) at /home/tomreyn/SCM/megaglest-trunk/source/glest_game/main/main.cpp:4005
#17 0x00007f6e79a2230d in __libc_start_main (main=0x4aa5f0 <main(int, char**)>, argc=1, ubp_av=0x7fff1e1e6c58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff1e1e6c48) at libc-start.c:226
#18 0x00000000004afa69 in _start ()
The game should provide a user friendly on screen error message when any data referenced (and depended upon) by the savegame does not exist and there should be no segfault. Instead the game should return to the "Load game" or main menu in all cases but for missing tilesets, in which case a default replacement tileset should be loaded (this can be just the first one in the list of available tilesets), accompanied by a console warning message reporting the override.