]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tentacle: crushtool: init with CINIT_FLAG_NO_DAEMON_ACTIONS
authorBill Scales <bill_scales@uk.ibm.com>
Tue, 29 Apr 2025 13:33:02 +0000 (14:33 +0100)
committerConnor Fawcett <connorfa@uk.ibm.com>
Fri, 18 Jul 2025 12:56:04 +0000 (13:56 +0100)
A change to mempool https://github.com/ceph/ceph/pull/55696 has
exposed a use after free bug in crushtool during process exit
where dtors are being called to free up mempool data structures
at the same time that the ceph context service thread is trying
to update them.

This commit modifies crushtool's initialization to prevent
this (unneeded) thread from being created. See issue for more
details about why the thread was not terminiating.

Fixes: https://tracker.ceph.com/issues/71027
Signed-off-by: Connor Fawcett <connorfa@uk.ibm.com>
(cherry picked from commit 2f3ffff3476763bd7cb6ecd378b16cd39eb5f302)

src/tools/crushtool.cc

index a1a55422bf47c0dbb50005840cceecf46a571699..102c84730b154c42d58cad8bde34d8b9f67fa035 100644 (file)
@@ -452,9 +452,11 @@ int main(int argc, const char **argv)
   vector<const char *> empty_args;
   auto cct = global_init(NULL, empty_args, CEPH_ENTITY_TYPE_CLIENT,
                         CODE_ENVIRONMENT_UTILITY,
-                        CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+                        CINIT_FLAG_NO_DEFAULT_CONFIG_FILE|
+                        CINIT_FLAG_NO_DAEMON_ACTIONS);
   // crushtool times out occasionally when quits. so do not
-  // release the g_ceph_context.
+  // release the g_ceph_context. This causes other problems
+  // see https://tracker.ceph.com/issues/71027
   cct->get();
   common_init_finish(g_ceph_context);