From 480f8e98010038b4ce4b994ac096914c52e65425 Mon Sep 17 00:00:00 2001 From: Bill Scales Date: Tue, 29 Apr 2025 14:33:02 +0100 Subject: [PATCH] tentacle: crushtool: init with CINIT_FLAG_NO_DAEMON_ACTIONS 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 (cherry picked from commit 2f3ffff3476763bd7cb6ecd378b16cd39eb5f302) --- src/tools/crushtool.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index a1a55422bf47..102c84730b15 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -452,9 +452,11 @@ int main(int argc, const char **argv) vector 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); -- 2.47.3