chore: update monado to f07dd1348, drop upstreamed patch 0009

This commit is contained in:
Jonathan Steffan
2026-10-15 23:00:44 +02:00
committed by xytovl
parent bc3e374b96
commit 75d76f1a77
6 changed files with 2 additions and 64 deletions
+1 -1
View File
@@ -70,7 +70,7 @@
# Keep in sync with CMakeLists.txt monado rev
rev = lib.strings.trim (builtins.readFile ./monado-rev);
# Nix will output the correct hash when it doesn't match
hash = "sha256-3+bdxyXHuaweT/K+Jwh428XNMuZUd1tL2bdFBRIZ/Po=";
hash = "sha256-yeRZ0bodNC9A7ng84oSRXUt1WXGIFMF1OUTMybpimeQ=";
};
};
+1 -1
View File
@@ -1 +1 @@
09741cbcb45236f4f4f79790ea133cd90d68d5eb
f07dd134877d850ca9407c4b1a7b0c5a2a3d1ce2
@@ -1,62 +0,0 @@
From 4f0256590650672bf790cf571f5cc7b6495cb5f0 Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
Date: Sun, 28 Jun 2026 11:36:08 -0600
Subject: [PATCH 9/9] ipc: join client threads before teardown
On shutdown main_loop() returns as soon as s->running is cleared, but the
per-client threads may still be in common_shutdown() destroying their
compositor and dereferencing s->xsysd/s->xso. teardown_all() then frees
those resources concurrently, so a client thread can lock a mutex the main
thread has already destroyed (assert om->initialized in
multi_compositor_destroy). Join the client threads first.
---
src/xrt/ipc/server/ipc_server_process.c | 28 +++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/xrt/ipc/server/ipc_server_process.c b/src/xrt/ipc/server/ipc_server_process.c
index 8adf617dd..9ab982396 100644
--- a/src/xrt/ipc/server/ipc_server_process.c
+++ b/src/xrt/ipc/server/ipc_server_process.c
@@ -163,11 +163,39 @@ print_linux_end_user_started_information(enum u_logging_level log_level)
U_LOG_IFL_I(log_level, "%s", sink.buffer);
}
+/*!
+ * Join any still-running per-client threads.
+ *
+ * On shutdown @ref main_loop returns as soon as `s->running` is cleared, but the
+ * per-client threads may still be inside common_shutdown(), which destroys each
+ * client's compositor and dereferences `s->xsysd` / `s->xso`. Waiting for them
+ * here, before teardown_all() destroys those resources, avoids a race where a
+ * client thread locks a mutex the teardown below has already freed (observed as
+ * an `om->initialized` assertion in multi_compositor_destroy). `s->running` is
+ * already false by this point, so each client loop exits within its poll timeout.
+ */
+static void
+join_all_client_threads(struct ipc_server *s)
+{
+ for (uint32_t i = 0; i < IPC_MAX_CLIENTS; i++) {
+ struct ipc_thread *it = &s->threads[i];
+ if (it->state == IPC_THREAD_READY) {
+ continue;
+ }
+ os_thread_join(&it->thread);
+ os_thread_destroy(&it->thread);
+ it->state = IPC_THREAD_READY;
+ }
+}
+
static void
teardown_all(struct ipc_server *s)
{
u_var_remove_root(s);
+ // Client threads reference the resources destroyed below; wait them out first.
+ join_all_client_threads(s);
+
xrt_syscomp_destroy(&s->xsysc);
xrt_space_overseer_destroy(&s->xso);
--
2.55.0