Project

General

Profile

Actions

Bug #1954

open

SIGSEGV at startup

Added by John Robertson 8 months ago. Updated 13 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Qt-client
Target version:
-
Start date:
02/25/2026
Due date:
% Done:

0%

Estimated time:

Description

Latest dev [Qt]
Race condition `real_menus_update()` is sometimes called before `real_menus_init()`.
For the Qt client this results in accessing an uninitialized `multiplayer_menu` variable.


Files

1954.patch (929 Bytes) 1954.patch John Robertson, 02/26/2026 01:40 AM
1954.v2.patch (1.33 KB) 1954.v2.patch John Robertson, 02/26/2026 05:04 AM
1954.v3.patch (1.39 KB) 1954.v3.patch John Robertson, 02/26/2026 05:35 AM
clipboard-202602252103-ddzg2.png (53.5 KB) clipboard-202602252103-ddzg2.png John Robertson, 02/26/2026 06:03 AM
clipboard-202602252103-ddzg2.png
Actions #1

Updated by John Robertson 8 months ago

This could also be cause from a delay in the loading of the ruleset (e.g. `!game.client.ruleset_ready`).

If `real_menu_init() returns without initializing, because the ruleset took too long to load, is it ever called again?

Actions #2

Updated by John Robertson 8 months ago

I tend to startup the server and client at the same time. I think `real_menus_init()` returns because the ruleset has not yet been loaded, causing the `multiplayer_menu` variable to never become initialized.

Actions #3

Updated by John Robertson 8 months ago

NOPE!

Actions #4

Updated by John Robertson 8 months ago

Reduced, but not perfect, risk.

Actions #5

Updated by John Robertson 8 months ago

Perfectly remove the SIGSEGV, at the sacrifice of the menus. The menus are constantly rebuilt/updated, so eventually, the `real_menus_init()` should succeed.

Actions #6

Updated by John Robertson 8 months ago

clipboard-202602252103-ddzg2.png


Before fix
`multiplayer_menu` is NULL in `real_menus_update()` if `real_menus_init()` exits because the server ruleset is not ready.

Actions #7

Updated by Marko Lindqvist 13 days ago

John Robertson wrote in #note-2:

I tend to startup the server and client at the same time. I think `real_menus_init()` returns because the ruleset has not yet been loaded, causing the `multiplayer_menu` variable to never become initialized.

That makes no sense. Server loads rulesets before accepting any client connections, so server start time shouldn't have any role in this.

However, it's possible that client tries to use menus before it has received rulesets from the server. We've had bugs of that type in the past. There's mystery, though, in why you are seeing this and others (at least myself) are not. One would assume it to be deterministic.

Actions

Also available in: Atom PDF