From ca7d6824249383be9b46c2f6036cc94d81d43c1f Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Mon, 9 Oct 2023 15:11:13 +0300 Subject: [PATCH] uORBManager.cpp: Make sure the sub is registered (valid) before invoking cb There seems to be a race condition where the callback thread is signaled but the sub is not registered when the orb_callback thread executes. This patches such errors, but the root cause of the race condition is not known. Regardless, this sanity check is not wrong. --- platforms/common/uORB/uORBManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platforms/common/uORB/uORBManager.cpp b/platforms/common/uORB/uORBManager.cpp index dc7a882eb3dc..2bd82ea693c3 100644 --- a/platforms/common/uORB/uORBManager.cpp +++ b/platforms/common/uORB/uORBManager.cpp @@ -492,6 +492,10 @@ uORB::Manager::callback_thread(int argc, char *argv[]) break; } + if (!sub->registered()) { + continue; + } + sub->call(); }