From 75d76f1a77ebc139790ae2e135103b5cc739f420 Mon Sep 17 00:00:00 2001 From: Jonathan Steffan Date: Thu, 15 Oct 2026 08:52:43 -0600 Subject: [PATCH] chore: update monado to f07dd1348, drop upstreamed patch 0009 --- flake.nix | 2 +- monado-rev | 2 +- ...-Add-m_relation_history_get_clamped.patch} | 0 ...-join-client-threads-before-teardown.patch | 62 ------------------- ...amvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch} | 0 ...> 0011-frame-controller-interaction.patch} | 0 6 files changed, 2 insertions(+), 64 deletions(-) rename patches/monado/{0010-a-math-Add-m_relation_history_get_clamped.patch => 0009-a-math-Add-m_relation_history_get_clamped.patch} (100%) delete mode 100644 patches/monado/0009-ipc-join-client-threads-before-teardown.patch rename patches/monado/{0011-d-steamvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch => 0010-d-steamvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch} (100%) rename patches/monado/{0012-frame-controller-interaction.patch => 0011-frame-controller-interaction.patch} (100%) diff --git a/flake.nix b/flake.nix index eabea8b7..92dceaeb 100644 --- a/flake.nix +++ b/flake.nix @@ -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="; }; }; diff --git a/monado-rev b/monado-rev index 9afe52ba..b61b8a66 100644 --- a/monado-rev +++ b/monado-rev @@ -1 +1 @@ -09741cbcb45236f4f4f79790ea133cd90d68d5eb +f07dd134877d850ca9407c4b1a7b0c5a2a3d1ce2 diff --git a/patches/monado/0010-a-math-Add-m_relation_history_get_clamped.patch b/patches/monado/0009-a-math-Add-m_relation_history_get_clamped.patch similarity index 100% rename from patches/monado/0010-a-math-Add-m_relation_history_get_clamped.patch rename to patches/monado/0009-a-math-Add-m_relation_history_get_clamped.patch diff --git a/patches/monado/0009-ipc-join-client-threads-before-teardown.patch b/patches/monado/0009-ipc-join-client-threads-before-teardown.patch deleted file mode 100644 index d98dc7c1..00000000 --- a/patches/monado/0009-ipc-join-client-threads-before-teardown.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 4f0256590650672bf790cf571f5cc7b6495cb5f0 Mon Sep 17 00:00:00 2001 -From: no name -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 - diff --git a/patches/monado/0011-d-steamvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch b/patches/monado/0010-d-steamvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch similarity index 100% rename from patches/monado/0011-d-steamvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch rename to patches/monado/0010-d-steamvr_lh-Add-LH_MAX_EXTRAPOLATION_MS.patch diff --git a/patches/monado/0012-frame-controller-interaction.patch b/patches/monado/0011-frame-controller-interaction.patch similarity index 100% rename from patches/monado/0012-frame-controller-interaction.patch rename to patches/monado/0011-frame-controller-interaction.patch