From: Alex Ainscow Date: Thu, 16 Apr 2026 09:28:29 +0000 (+0100) Subject: test/librbd: Fix infinite recursion in MockTestMemRadosClient::do_mon_command X-Git-Tag: v21.0.1~73^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d9019e4a4ba89f667d473f3f95a031095a8cae5;p=ceph.git test/librbd: Fix infinite recursion in MockTestMemRadosClient::do_mon_command The do_mon_command() method was calling the mocked mon_command() which has a default action that calls do_mon_command(), creating an infinite recursion that caused a segmentation fault due to stack overflow. Fixed by calling TestRadosClient::mon_command() (the base class implementation) instead of the mocked version. This resolves the segfault in unittest_librbd when running the run-rbd-unit-tests.sh script. Signed-off-by: Alex Ainscow --- diff --git a/src/test/librados_test_stub/MockTestMemRadosClient.h b/src/test/librados_test_stub/MockTestMemRadosClient.h index ddd161dae5e..8f24156be02 100644 --- a/src/test/librados_test_stub/MockTestMemRadosClient.h +++ b/src/test/librados_test_stub/MockTestMemRadosClient.h @@ -75,7 +75,7 @@ public: int do_mon_command(const std::vector& cmd, const bufferlist &inbl, bufferlist *outbl, std::string *outs) { - return mon_command(cmd, inbl, outbl, outs); + return TestRadosClient::mon_command(cmd, inbl, outbl, outs); } MOCK_METHOD0(wait_for_latest_osd_map, int());