]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: Fix infinite recursion in MockTestMemRadosClient::do_mon_command
authorAlex Ainscow <aainscow@uk.ibm.com>
Thu, 16 Apr 2026 09:28:29 +0000 (10:28 +0100)
committerJon Bailey <jonathan.bailey1@ibm.com>
Thu, 28 May 2026 14:15:50 +0000 (15:15 +0100)
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 <aainscow@uk.ibm.com>
src/test/librados_test_stub/MockTestMemRadosClient.h

index ddd161dae5e22bbd31c5f3cc205214392b530b8c..8f24156be02c092170c5a16cb471d6f2ea5da4f4 100644 (file)
@@ -75,7 +75,7 @@ public:
   int do_mon_command(const std::vector<std::string>& 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());