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

[DocDB] LeakSanitizer in MasterChangeConfigTest.TestChangeAllMasters #13932

Open
bmatican opened this issue Sep 8, 2022 · 1 comment
Open
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/low Low priority

Comments

@bmatican
Copy link
Contributor

bmatican commented Sep 8, 2022

Jira Link: DB-3429

Description

Seems like a test only issue

https://detective-gcp.dev.yugabyte.com/stability/test?branch=master&build_type=all&class=MasterChangeConfigTest&fail_tag=memory_leak&name=TestChangeAllMasters&platform=linux

https://jenkins.dev.yugabyte.com/job/github-yugabyte-db-alma8-master-clang12-asan/1232/artifact/build/asan-clang12-dynamic-ninja/yb-test-logs/tests-integration-tests__master_config-itest/MasterChangeConfigTest_TestChangeAllMasters.log

==201053==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 320 byte(s) in 1 object(s) allocated from:
    #0 0x7fe0182ccdfd in operator new(unsigned long) /opt/yb-build/llvm/yb-llvm-v12.0.1-yb-2-1659059070-22764466-almalinux8-x86_64-build/src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99:3
    #1 0x7fe01719fd9e in yb::ExternalMiniCluster::StartShellMaster(yb::ExternalMaster**) ${BUILD_ROOT}/../../src/yb/integration-tests/external_mini_cluster.cc:510:28
    #2 0x239579 in yb::master::MasterChangeConfigTest_TestChangeAllMasters_Test::TestBody() ${BUILD_ROOT}/../../src/yb/integration-tests/master_config-itest.cc:389:15
    #3 0x7fdff46c21e2 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2402:10
    #4 0x7fdff46c21e2 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2438:14
    #5 0x7fdff467e11f in testing::Test::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2474:5
    #6 0x7fdff4680297 in testing::TestInfo::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2656:11
    #7 0x7fdff46822df in testing::TestCase::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2774:28
    #8 0x7fdff4698777 in testing::internal::UnitTestImpl::RunAllTests() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:4649:43
    #9 0x7fdff46c7c81 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2402:10
    #10 0x7fdff46c7c81 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:2438:14
    #11 0x7fdff4696c98 in testing::UnitTest::Run() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/src/gmock-1.8.0/googletest/src/gtest.cc:4257:10
    #12 0x7fe018c4891d in RUN_ALL_TESTS() /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20220806014317-c2f02d2024-almalinux8-x86_64-clang12/installed/asan/include/gtest/gtest.h:2233:46
    #13 0x7fe018c47ebd in main ${BUILD_ROOT}/../../src/yb/util/test_main.cc:109:13
    #14 0x7fdfed30ecf2 in __libc_start_main (/lib64/libc.so.6+0x3acf2)
@bmatican bmatican added kind/failing-test Tests and testing infra area/docdb YugabyteDB core features priority/high High Priority status/awaiting-triage Issue awaiting triage labels Sep 8, 2022
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug and removed status/awaiting-triage Issue awaiting triage labels Sep 8, 2022
@lingamsandeep
Copy link
Contributor

This is a test specific issue. StartShellMaster returns a raw pointer to ExternalMaster which is then passed to ChangeConfig. ChangeConfig wraps the raw pointer in a scoped_refptr and so eventually it gets cleaned up properly. This explains why the test does not fail often. There is a leak only in case the test fails between StartShellMaster and ChangeConfig calls where we leak the ExternalMaster

@yugabyte-ci yugabyte-ci added priority/low Low priority and removed priority/high High Priority labels Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug kind/failing-test Tests and testing infra priority/low Low priority
Projects
None yet
Development

No branches or pull requests

3 participants