Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/librbd: fix valgrind memory leak warning #17187

Merged
merged 3 commits into from Sep 7, 2017

Conversation

trociny
Copy link
Contributor

@trociny trociny commented Aug 23, 2017

Signed-off-by: Mykola Golub mgolub@mirantis.com

==947== 16 bytes in 1 blocks are definitely lost in loss record 4 of 16
==947==    at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==947==    by 0x6122A7: create_context_callback<librbd::ExclusiveLock<librbd::(anonymous namespace)::MockExclusiveLockImageCtx>, &librbd::ExclusiveLock<librbd::(anonymous namespace)::MockExclusiveLockImageCtx>::handle_post_acquiring_lock> (Utils.h:133)
==947==    by 0x6122A7: librbd::ExclusiveLock<librbd::(anonymous namespace)::MockExclusiveLockImageCtx>::post_acquire_lock_handler(int, Context*) (ExclusiveLock.cc:242)
==947==    by 0x61271C: librbd::TestMockExclusiveLock::when_post_acquire_lock_handler(librbd::ManagedLock<librbd::(anonymous namespace)::MockExclusiveLockImageCtx>&, int) [clone .isra.883] [clone .constprop.1348] (test_mock_ExclusiveLock.cc:304)
==947==    by 0x617836: librbd::TestMockExclusiveLock_ReacquireLock_Test::TestBody() (test_mock_ExclusiveLock.cc:630)
==947==    by 0xC0A5B2: HandleSehExceptionsInMethodIfSupported<testing::Test, void> (gtest.cc:2402)
==947==    by 0xC0A5B2: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2438)
==947==    by 0xC01F99: testing::Test::Run() (gtest.cc:2475)
==947==    by 0xC020E7: testing::TestInfo::Run() (gtest.cc:2656)
==947==    by 0xC021C4: testing::TestCase::Run() (gtest.cc:2774)
==947==    by 0xC0249E: testing::internal::UnitTestImpl::RunAllTests() (gtest.cc:4649)
==947==    by 0xC0AA92: HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (gtest.cc:2402)
==947==    by 0xC0AA92: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (gtest.cc:2438)
==947==    by 0xC027D3: testing::UnitTest::Run() (gtest.cc:4257)
==947==    by 0x5A7721: RUN_ALL_TESTS (gtest.h:2233)
==947==    by 0x5A7721: main (test_main.cc:57)

Mykola Golub added 3 commits August 23, 2017 14:49
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@trociny
Copy link
Contributor Author

trociny commented Aug 23, 2017

Another warning fixed:

==9301== Thread 32 tp_librbd:
==9301== Conditional jump or move depends on uninitialised value(s)
==9301==    at 0xEA55CAE: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_int<long>(std::ostrm)
==9301==    by 0xEA55EDC: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char,o)
==9301==    by 0xEA623F9: std::ostream& std::ostream::_M_insert<long>(long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==9301==    by 0x8BBEC2: librbd::operation::SnapshotRemoveRequest<librbd::MockImageCtx>::should_complete(int) (SnapshotRemoveRequest.cc:67)
==9301==    by 0x5CC024: complete (AsyncRequest.h:23)
==9301==    by 0x5CC024: librbd::util::detail::C_CallbackAdapter<librbd::AsyncRequest<librbd::MockImageCtx>, &librbd::AsyncRequest<librbd::MockImageCtx>::complete>::finish(int) (Utils.h:57)
==9301==    by 0x5CA0F8: Context::complete(int) (Context.h:70)
==9301==    by 0x682940: ContextWQ::process(Context*) (WorkQueue.h:611)
==9301==    by 0x5CE01B8: ThreadPool::worker(ThreadPool::WorkThread*) (WorkQueue.cc:120)
==9301==    by 0x5CE12CF: ThreadPool::WorkThread::entry() (WorkQueue.h:448)
==9301==    by 0x56066B9: start_thread (pthread_create.c:333)
==9301==    by 0xF2FB3DC: clone (clone.S:109)

Copy link

@dillaman dillaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dillaman dillaman merged commit 6fbc3e1 into ceph:master Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants