[code]
if (gfxDriver->UsesMemoryBackBuffer()) // make sure all borders are cleared
gfxDriver->ClearRectangle(0, 0, final_scrn_wid - 1, final_scrn_hit - 1, NULL);
[/code]
With this modification game (Kq3Redux) is not segfaultting on ARM, but it just ends. Debugger says: Program exited with code 0133.
You could also look at the backtrace of all the threads (that one isn't the main one) and search for the quit call (which will contain the message explaining why it was called).
[code]
gdb) thread apply all backtrace
Thread 9 (Thread 0x46cfb490 (LWP 1707)):
#0 0x403b0798 in poll () from /lib/libc.so.6
#1 0x424676b8 in ?? () from /usr/lib/libpulse.so.0
#2 0x424676b8 in ?? () from /usr/lib/libpulse.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 6 (Thread 0x454fb490 (LWP 1704)):
#0 0x403b0798 in poll () from /lib/libc.so.6
#1 0x424676b8 in ?? () from /usr/lib/libpulse.so.0
#2 0x424676b8 in ?? () from /usr/lib/libpulse.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 2 (Thread 0x4105a490 (LWP 1700)):
#0 0x0018f258 in _linear_hline16 ()
#1 0x0020564c in _xwin_hline ()
#2 0x0015a508 in _normal_rectfill ()
#3 0x0020515c in _xwin_rectfill ()
#4 0x00053c88 in rectfill (bmp=0x645d70, x1=0, y_1=0, x2=319, y2=199, color=0) at /usr/include/allegro/inline/draw.inl:88
#5 0x00054280 in AllegroGFXFilter::ClearRect (this=0x644888, x1=0, y1=0, x2=319, y2=199, RGB=0)
at ags_maemo/Engine/acgfx.cpp:439
#6 0x000de038 in ALSoftwareGraphicsDriver::ClearRectangle (this=0x644918, x1=0, y1=0, x2=319, y2=199, colorToUse=0x0)
at ags_maemo/Engine/ali3dsw.cpp:340
#7 0x0005f040 in display_switch_in () at ags_maemo/Engine/ac.cpp:15574
#8 0x0015435c in _switch_in ()
#9 0x001b7998 in _xwin_private_handle_input ()
#10 0x001b8028 in _xwin_handle_input ()
#11 0x001aea1c in _xwin_bg_handler ()
#12 0x001e1a2c in bg_man_pthreads_threadfunc ()
#13 0x40559934 in start_thread () from /lib/libpthread.so.0
#14 0x403b9be8 in clone () from /lib/libc.so.6
#15 0x403b9be8 in clone () from /lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
Thread 1 (Thread 0x40021c90 (LWP 1697)):
#0 0x4055d27c in pthread_mutex_lock () from /lib/libpthread.so.0
#1 0x403c5cc8 in pthread_mutex_lock () from /lib/libc.so.6
#2 0x001e1774 in _unix_lock_mutex ()
#3 0x00201c50 in x_set_leds ()
#4 0x001609d8 in set_leds ()
#5 0x00161434 in remove_keyboard ()
#6 0x0014045c in allegro_exit ()
#7 0x0007bab4 in quit (quitmsg=0x21a3c0 "|You have exited.")
at ags_maemo/Engine/ac.cpp:9341
#8 0x000a0af8 in QuitGame (dialog=0) at ags_maemo/Engine/ac.cpp:17995
#9 0x000ecb04 in call_function (addr=658100, numparm=1, parms=0xbefeb128, offset=0)
at ags_maemo/Common/csrun.cpp:1224
#10 0x000f0aa0 in cc_run_code (inst=0x628588, curpc=101913)
at ags_maemo/Common/csrun.cpp:1798
#11 0x000f1704 in ccCallInstance (inst=0x656d6167, funcname=0x0, numargs=1)
at ags_maemo/Common/csrun.cpp:2026
#12 0x000bcaf4 in run_script_function_if_exist (sci=0x628588, tsname=0x2e1a10 "game_start", numParam=0, iparam=0, iparam2=0, iparam3=0)
at ags_maemo/Engine/ac.cpp:3273
#13 0x000bd8ec in run_text_script (sci=0x628588, tsname=0x21d578 "game_start")
at ags_maemo/Engine/ac.cpp:3323
#14 0x000bda20 in start_game () at ags_maemo/Engine/ac.cpp:26661
#15 0x000be6ac in initialize_start_and_play_game (override_start_room=0, loadSaveGameOnStartup=0x0)
at ags_maemo/Engine/ac.cpp:26818
#16 0x000c7d4c in initialize_engine (argc=2, argv=0xbefec2e4)
at ags_maemo/Engine/ac.cpp:28045
#17 0x000c8ae8 in main (argc=2, argv=0xbefec2e4) at ags_maemo/Engine/ac.cpp:27243
[/code]
Maybe that ARM 'port' should wait till all big know issues are solved e.g. 64bit Linux works flawlessly. Maybe some old fancy dependencies should also be thrown away (like libcda).