From: Bill Scales Date: Tue, 29 Apr 2025 13:33:02 +0000 (+0100) Subject: tentacle: crushtool: init with CINIT_FLAG_NO_DAEMON_ACTIONS X-Git-Tag: v20.1.0~56^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F64578%2Fhead;p=ceph.git 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) --- diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index a1a55422bf4..102c84730b1 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);