Skip to contentSkip to conversation

system: fix assertion when cannot get/set rlimit

PATCH New Nikita Ostrenkov 1 participant 1 message Mar 12, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 system: fix assertion when cannot get/set rlimit

If cannot get/set rlinit warn_print called, which uses monitor_lock mutex. monitor_lock mutex initialized in monitor_init_globals, then monitor_init_globals should be called before os_setup_limits.

---
 system/runstate.c | 1 -
 system/vl.c       | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
system/runstate.c +0 -1
index 272801d307..de01cb9833 100644
@@ -874,7 +874,6 @@ void qemu_init_subsystems(void)
     runstate_init();
     precopy_infrastructure_init();
     postcopy_infrastructure_init();
-    monitor_init_globals();
 
     if (qcrypto_init(&err) < 0) {
         error_reportf_err(err, "cannot initialize crypto: ");
system/vl.c +2 -0
index 04f78466c4..0742a3b407 100644
@@ -2885,6 +2885,8 @@ void qemu_init(int argc, char **argv)
     error_init(argv[0]);
     qemu_init_exec_dir(argv[0]);
 
+    monitor_init_globals();
+
     os_setup_limits();
 
 #ifdef CONFIG_MODULES
Signature · 1 line
2.34.1