Bug #1954
openSIGSEGV at startup
0%
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
Updated by John Robertson 5 days 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?
Updated by John Robertson 5 days ago
- File 1954.patch 1954.patch added
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.
Updated by John Robertson 5 days ago
- File 1954.v2.patch 1954.v2.patch added
Reduced, but not perfect, risk.
Updated by John Robertson 5 days ago
- File 1954.v3.patch 1954.v3.patch added
Perfectly remove the SIGSEGV, at the sacrifice of the menus. The menus are constantly rebuilt/updated, so eventually, the `real_menus_init()` should succeed.
Updated by John Robertson 5 days ago

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