Bug #2238
opengtk-3.22 client crash: ../../common/government.c:156:10: runtime error: null pointer passed as argument 1, which is declared to never be null
0%
Description
branch main
commit a4f307a09377ada80f95d529b9ca0247dca0ef9e (Date: Thu Aug 13 03:59:23 2026 +0300)
../../common/government.c:156:10: runtime error: null pointer passed as argument 1, which is declared to never be null
../../common/government.c:143:10: runtime error: member access within null pointer of type 'const struct government'
zsh: segmentation fault (core dumped) opt/freeciv-main-20260911/bin/freeciv-gtk3.22
Core was generated by `opt/freeciv-main-20260911/bin/freeciv-gtk3.22'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000560053229f26 in name_translation_get (ptrans=0x8) at ../../common/name_translation.h:123
123 return ptrans->translated;
[Current thread is 1 (Thread 0x7f1c9f97ec80 (LWP 582883))]
(gdb) bt full
#0 0x0000560053229f26 in name_translation_get (ptrans=0x8) at ../../common/name_translation.h:123
#1 government_name_translation (pgovern=pgovern@entry=0x0) at ../../common/government.c:143
#2 0x0000560053229fa0 in government_name_for_player (pplayer=pplayer@entry=0x560077c29410) at ../../common/government.c:156
#3 0x000056005306a044 in col_government (them=0x560077c29410) at ../../client/plrdlg_common.c:329
buf = "?\000narchy\000alism", '\000' <repeats 85 times>
me = <optimized out>
#4 0x00005600531486b1 in fill_row (store=0x56007dcb20b0, it=it@entry=0x7fff48bed150, pplayer=pplayer@entry=0x560077c29410)
at ../../../client/gui-gtk-3.22/plrdlg.c:661
pcol = 0x56005361bca0 <player_dlg_columns+768>
pixbuf = <optimized out>
style = 0
weight = 400
k = 16
#5 0x0000560053148ba4 in real_players_dialog_update (unused=<optimized out>) at ../../../client/gui-gtk-3.22/plrdlg.c:753
pplayer = 0x560077c29410
_pslotpplayer = 0x56007c4ab010
model = 0x56007dcb20b0
iter = {stamp = 481811873, user_data = 0x56007c37df30, user_data2 = 0x0, user_data3 = 0x0}
selected = 0
#6 0x00005600530c8144 in update_unqueue (data=<optimized out>) at ../../client/update_queue.c:320
callback = 0x560053148a78 <real_players_dialog_update>
uq_data = 0x56007d534660
MY_mem_MY_iter = 0x7fff48bed1a0 "\037\264ES"
MY_it_MY_iter = 0x7fff48bed1a0
MY_iter = <optimized out>
hash = 0x56007a147e80
#7 0x0000560052fc633c in idle_callback_wrapper (data=0x560079c085b0) at ../../../client/gui-gtk-3.22/gui_main.c:2367
cb = 0x560079c085b0
#8 0x00007f1ca4440c76 in g_main_dispatch (context=0x5600765c7100) at ../glib/glib/gmain.c:3591
user_data = 0x560079c085b0
callback = 0x560052fc630b <idle_callback_wrapper>
gaig_temp = <optimized out>
gaig_temp = <optimized out>
cb_data = 0x56007c691700
need_destroy = <optimized out>
dispatch = 0x7f1ca443cea0 <g_idle_dispatch>
prev_source = 0x0
was_in_call = 0
cb_funcs = 0x7f1ca45403a0 <g_source_callback_funcs>
begin_time_nsec = 182043067473024
source = 0x56007a16e6d0
gaig_temp = <optimized out>
current = 0x5600765be650
i = 1
#9 0x00007f1ca4442ed7 in g_main_context_dispatch_unlocked (context=0x5600765c7100) at ../glib/glib/gmain.c:4451
#10 g_main_context_iterate_unlocked
(context=0x5600765c7100, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at ../glib/glib/gmain.c:4516
max_priority = 200
timeout_usec = 0
some_ready = 1
nfds = 4
allocated_nfds = <optimized out>
fds = <optimized out>
begin_time_nsec = <optimized out>
#11 0x00007f1ca4443217 in g_main_loop_run (loop=0x560078447a00) at ../glib/glib/gmain.c:4721
self = <optimized out>
#12 0x00007f1ca4beac4f in gtk_main () at ../gtk/gtk/gtkmain.c:1332
loop = 0x560078447a00
#13 0x0000560052fcbd17 in ui_main (argc=<optimized out>, argc@entry=1, argv=<optimized out>, argv@entry=0x7fff48bedbb8)
at ../../../client/gui-gtk-3.22/gui_main.c:1998
window_name = "Freeciv (gtk3.22)\000\000\000\000\000\000\000\255\362@S\000V\000\000`ԾH\377\177\000\000P־H\377\177\000\000\001\000\000\000\000\000\000\000\363\020MS\000V\000\000\000\000\000\000\000\000\000\000\376\370@S\000V\000\000 \000\000\000\000\000\000\000\300\246\001", '\000' <repeats 13 times>, " \000\000\0000\000\000\000P־H\377\177\000\000pվH\377\177\000\000colors.playerdlg_background0\000ble0\000\000t0\0000\000hP\212\243\034\177\000\000\300ԾH\377\177\000\000hP\212\243\034\177\000\000\240\a\000\000\000\000\000\000 \t\000\000\000"...
toplevel_font_name = <optimized out>
sig = <optimized out>
#14 0x0000560052fd235f in client_main (argc=1, argv=0x7fff48bedbb8, postpone_tileset=postpone_tileset@entry=false)
at ../../client/client_main.c:694
i = 1
loglevel = LOG_NORMAL
ui_options = 0
ui_separator = false
option = <optimized out>
fatal_assertions = -1
aii = <optimized out>
uret = <optimized out>
#15 0x0000560052fcaa44 in main (argc=<optimized out>, argv=<optimized out>) at ../../../client/gui-gtk-3.22/gui_main.c:1738
See also:
Bug #1943
Bug #2043
Files
Updated by Marko Lindqvist 13 days ago
- Category changed from gtk3.22-client to client-common
In all the past tickets where we have investigated this we've been thinking the case where new contact between players is established, and client has already received the new diplstate (information about the contact) but not yet the updated government info, leading to this crash in an unfortunately timed (between the packets) idle callback.
Only now it occurred to me that also the opposite case is possible, and actually made more likely by the packet order rearrangements we've done to resolve this; we may be losing the contact and have already received the government info clearing but not yet actual loss of contact.
Updated by Marko Lindqvist 12 days ago
- File 0078-Fix-client-crash-on-government_name_for_player.patch 0078-Fix-client-crash-on-government_name_for_player.patch added
- Status changed from New to In Review
- Assignee set to Marko Lindqvist