From: Nitzan Mordechai Date: Sun, 22 Jun 2025 13:43:55 +0000 (+0000) Subject: test/librados/aio_cxx: Fix potential mutex destruction failure on PoolEIOFlag X-Git-Tag: v20.1.0~120^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F64242%2Fhead;p=ceph.git test/librados/aio_cxx: Fix potential mutex destruction failure on PoolEIOFlag GTEST_SKIP() does not return and causes early test exit, which skips any following cleanup logic. In this case, the test skipped before releasing my_lock, causing pthread_mutex_destroy() to fail with EBUSY and trigger a ceph_assert() in the mutex debug wrapper. Fix by explicitly unlocking the mutex before calling GTEST_SKIP(). Signed-off-by: Nitzan Mordechai (cherry picked from commit 26e7bbf68142419d9e2991099e42853c1a7339b4) --- diff --git a/src/test/librados/aio_cxx.cc b/src/test/librados/aio_cxx.cc index b0b7b6c4e7d5..32470489373b 100644 --- a/src/test/librados/aio_cxx.cc +++ b/src/test/librados/aio_cxx.cc @@ -2349,7 +2349,7 @@ void pool_io_callback(completion_t cb, void *arg /* Actually AioCompletion* */) ASSERT_EQ(0, info->c->wait_for_complete()); } int r = info->c->get_return_value(); - cout << "finish " << i << " r = " << r << std::endl; + //cout << "finish " << i << " r = " << r << std::endl; std::scoped_lock l(my_lock); inflight.erase(i); @@ -2426,8 +2426,8 @@ TEST(LibRadosAio, PoolEIOFlag) { } if (!missed_eio) { - GTEST_SKIP() << "eio flag missed all ios that already completed"; my_lock.unlock(); + GTEST_SKIP() << "eio flag missed all ios that already completed"; } cout << "max_success " << max_success << ", min_failed " << min_failed << std::endl; ASSERT_TRUE(max_success + 1 == min_failed);