Bug #1961
closed3.2.3: segfault in sdl3 client when selecting nation
0%
Description
Hi Team,
Trying to update our packaging downstream since the 3.2.0 beta and I've come across this behaviour:
nation_button_callback (nation_button=0x7fffe8004520) at ../freeciv-R3_2_3/client/gui-sdl3/dialogs.c:2898
⚠️ warning: 2898 ../freeciv-R3_2_3/client/gui-sdl3/dialogs.c: No such file or directory
(gdb) bt
#0 nation_button_callback (nation_button=0x7fffe8004520) at ../freeciv-R3_2_3/client/gui-sdl3/dialogs.c:2898
#1 0x00005555555d65d1 in widget_pressed_action (pwidget=0x7fffe8004520) at ../freeciv-R3_2_3/client/gui-sdl3/widget.c:399
#2 0x0000555555598148 in main_mouse_button_down_handler (button_event=0x5555556924e8 <main_data+1352>, data=<optimized out>) at ../freeciv-R3_2_3/client/gui-sdl3/gui_main.c:382
#3 0x00005555555a237d in gui_event_loop.constprop.0 (data=data@entry=0x0, loop_action=loop_action@entry=0x0, key_down_handler=key_down_handler@entry=0x5555555971d0 <main_key_down_handler>,
key_up_handler=key_up_handler@entry=0x555555597f80 <main_key_up_handler>, textinput_handler=textinput_handler@entry=0x0, finger_down_handler=finger_down_handler@entry=0x555555597fb0 <main_finger_down_handler>,
finger_up_handler=0x555555598150 <main_finger_up_handler>, mouse_button_down_handler=0x5555555980a0 <main_mouse_button_down_handler>, mouse_button_up_handler=0x5555555982a0 <main_mouse_button_up_handler>,
mouse_motion_handler=0x5555555a19a0 <main_mouse_motion_handler>, finger_motion_handler=0x0) at ../freeciv-R3_2_3/client/gui-sdl3/gui_main.c:845
#4 0x00005555555a34c1 in ui_main (argc=<optimized out>, argv=<optimized out>) at ../freeciv-R3_2_3/client/gui-sdl3/gui_main.c:1136
#5 0x00005555555ea9bf in client_main.constprop.0 (argc=<optimized out>, argv=<optimized out>, postpone_tileset=false) at ../freeciv-R3_2_3/client/client_main.c:699
#6 0x00007ffff63903fb in __libc_start_call_main () from /usr/lib64/libc.so.6
#7 0x00007ffff63904ab in __libc_start_main_impl () from /usr/lib64/libc.so.6
#8 0x000055555556f435 in _start ()
Configured with
meson setup -Db_lto=true --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /var/tmp/portage/games-strategy/freeciv-3.2.3/temp/lua5.4/pkgconfig:/usr/share/pkgconfig --pkg-config-path /var/tmp/portage/games-strategy/freeciv-3.2.3/temp/lua5.4/pkgconfig:/usr/share/pkgconfig --native-file /var/tmp/portage/games-strategy/freeciv-3.2.3/temp/meson.x86_64-pc-linux-gnu.ini -Db_pch=false -Dwerror=false -Dbuildtype=plain -Dserver=enabled -Dqtver=qt6 -Dsvgflags=true -Dclients=['sdl3', 'qt'] -Dfcmp=[] -Daudio=sdl3 -Dtools=['manual'] -Djson-protocol=false -Dmwand=false -Dnls=true -Dreadline=true -Dsyslua=true /var/tmp/portage/games-strategy/freeciv-3.2.3/work/freeciv-R3_2_3 /var/tmp/portage/games-strategy/freeciv-3.2.3/work/freeciv-3.2.3-build
and built with the following flags:
-march=native -O2 -pipe -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fdiagnostics-color=always -frecord-gcc-switches
I also note that the SDL3 client nation picker doesn't actually display anything until you scroll, which may be related? I'll have a poke around in a local copy of the source.
Files
Updated by Matt Jolly 6 days ago
Sorry, missed some context - the SDL3 client segfaults when I attempt to select a nation after trying to start a new game.
Attached is an image of the "empty" nations pane, which fills upon scrolling.
Updated by Matt Jolly 6 days ago
Can confirm that I don't see this in 3.2.0_beta2 which is the last version that we have packaged in ::gentoo (though the "empty nations list" is still a thing)
Updated by Matt Jolly 6 days ago
Can repro on main (fd35c268f2814109448840a6b15cedff5db0acb9):
Thread 1 "freeciv-sdl3" received signal SIGSEGV, Segmentation fault.
nation_button_callback (nation_button=0x7fffe8005060) at ../freeciv-9999/client/gui-sdl3/dialogs.c:2910
⚠️ warning: 2910 ../freeciv-9999/client/gui-sdl3/dialogs.c: No such file or directory
(gdb) bt
#0 nation_button_callback (nation_button=0x7fffe8005060) at ../freeciv-9999/client/gui-sdl3/dialogs.c:2910
#1 0x00005555555dd111 in widget_pressed_action (pwidget=0x7fffe8005060) at ../freeciv-9999/client/gui-sdl3/widget.c:399
#2 0x000055555559fab8 in main_mouse_button_down_handler (button_event=0x555555698888 <main_data+1352>, data=<optimized out>) at ../freeciv-9999/client/gui-sdl3/gui_main.c:383
#3 0x00005555555a2b2d in gui_event_loop.constprop.0 (data=data@entry=0x0, loop_action=loop_action@entry=0x0, key_down_handler=key_down_handler@entry=0x5555555a3990 <main_key_down_handler>,
key_up_handler=key_up_handler@entry=0x55555559f8f0 <main_key_up_handler>, textinput_handler=textinput_handler@entry=0x0, finger_down_handler=finger_down_handler@entry=0x55555559f920 <main_finger_down_handler>,
finger_up_handler=0x55555559fac0 <main_finger_up_handler>, mouse_button_down_handler=0x55555559fa10 <main_mouse_button_down_handler>, mouse_button_up_handler=0x55555559fc10 <main_mouse_button_up_handler>,
mouse_motion_handler=0x5555555a2150 <main_mouse_motion_handler>, finger_motion_handler=0x0) at ../freeciv-9999/client/gui-sdl3/gui_main.c:846
#4 0x00005555555a5501 in ui_main (argc=<optimized out>, argv=<optimized out>) at ../freeciv-9999/client/gui-sdl3/gui_main.c:1137
#5 0x00005555555eac05 in client_main.constprop.0 (argc=<optimized out>, argv=<optimized out>, postpone_tileset=false) at ../freeciv-9999/client/client_main.c:693
#6 0x00007ffff624d3fb in __libc_start_call_main () from /usr/lib64/libc.so.6
#7 0x00007ffff624d4ab in __libc_start_main_impl () from /usr/lib64/libc.so.6
#8 0x000055555556f6f5 in _start ()
Updated by Marko Lindqvist 6 days ago
- Category set to sdl2-client
Happens also with the sdl2-client.
Updated by Matt Jolly 6 days ago
I think I know what's happening - testing a fix now.
Updated by Matt Jolly 6 days ago
Okay, `7a187ce264` seems to be the culprit - sdl2 and sdl3 were still using Uint16 instead of Uint32. Patch attached.
I haven't tested sdl2, but I identified the same issue there so the patch covers both. Sdl3 seems to work on 3.2.3 now, or at least I can actually start a game.
The graphical bug in sdl3 is still there - I'll leave that to actual developers :)
Updated by Marko Lindqvist 6 days ago
- Status changed from New to In Review
- Assignee set to Marko Lindqvist
- Target version set to 3.2.4