• finnur's avatar
    Revert of Fix BluetoothAdapterProfileChromeOS lifecycle management (patchset... · e952a67a
    finnur authored
    Revert of Fix BluetoothAdapterProfileChromeOS lifecycle management (patchset #7 id:120001 of https://codereview.chromium.org/935383003/)
    
    Reason for revert:
    Leaks detected.
    https://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/builds/7185
    
    =================================================================
    ==22324==ERROR: LeakSanitizer: detected memory leaks
    
    Indirect leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x4d9b8b in operator new(unsigned long) (/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__1_/build/src/out/Release/device_unittests+0x4d9b8b)
    #1 0x901bd6 in chromeos::BluetoothAdapterProfileChromeOS::Register(device::BluetoothUUID const&, chromeos::BluetoothProfileManagerClient::Options const&, base::Callback<void (chromeos::BluetoothAdapterProfileChromeOS*)> const&, base::Callback<void (std::string const&, std::string const&)> const&) device/bluetooth/bluetooth_adapter_profile_chromeos.cc:28:7
    #2 0x8f6c47 in chromeos::BluetoothAdapterChromeOS::UseProfile(device::BluetoothUUID const&, dbus::ObjectPath const&, chromeos::BluetoothProfileManagerClient::Options const&, chromeos::BluetoothProfileServiceProvider::Delegate*, base::Callback<void (chromeos::BluetoothAdapterProfileChromeOS*)> const&, base::Callback<void (std::string const&)> const&) device/bluetooth/bluetooth_adapter_chromeos.cc:982:5
    #3 0x4ec8e2 in chromeos::BluetoothAdapterProfileChromeOSTest_SimultaneousRegisterFail_Test::TestBody() device/bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc:359:3
    #4 0x85da05 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2420:12
    #5 0x85da05 in testing::Test::Run() testing/gtest/src/gtest.cc:2436
    #6 0x85f619 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2612:5
    #7 0x86040a in testing::TestCase::Run() testing/gtest/src/gtest.cc:2730:5
    #8 0x874063 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4602:11
    #9 0x8736b7 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2420:12
    #10 0x8736b7 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4220
    #11 0x814bda in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2326:10
    #12 0x814bda in base::TestSuite::Run() base/test/test_suite.cc:230
    #13 0x80ad38 in Run base/callback.h:396:12
    #14 0x80ad38 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int ()> const&, int, bool, base::Callback<void ()> const&) base/test/launcher/unit_test_launcher.cc:181
    #15 0x80a863 in base::LaunchUnitTests(int, char**, base::Callback<int ()> const&) base/test/launcher/unit_test_launcher.cc:423:10
    #16 0x7d25ac in main device/test/run_all_unittests.cc:14:10
    #17 0x7f35c8c7276c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
    
    Indirect leak of 93 byte(s) in 1 object(s) allocated from:
    #0 0x4d9b8b in operator new(unsigned long) (/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__1_/build/src/out/Release/device_unittests+0x4d9b8b)
    #1 0x7f35c92df739 in __gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*) /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/include/ext/new_allocator.h:92
    #2 0x7f35c92ded2c in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:609
    #3 0x7f35c92def04 in std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:631
    #4 0x7f35c92dbc48 in std::string::reserve(unsigned long) /build/buildd/gcc-4.6-4.6.3/build/x86_64-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:512
    #5 0x9021d7 in operator+<char, std::char_traits<char>, std::allocator<char> > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/basic_string.tcc:702:7
    #6 0x9021d7 in chromeos::BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS(device::BluetoothUUID const&) device/bluetooth/bluetooth_adapter_profile_chromeos.cc:47
    #7 0x901be8 in chromeos::BluetoothAdapterProfileChromeOS::Register(device::BluetoothUUID const&, chromeos::BluetoothProfileManagerClient::Options const&, base::Callback<void (chromeos::BluetoothAdapterProfileChromeOS*)> const&, base::Callback<void (std::string const&, std::string const&)> const&) device/bluetooth/bluetooth_adapter_profile_chromeos.cc:28:11
    #8 0x8f6c47 in chromeos::BluetoothAdapterChromeOS::UseProfile(device::BluetoothUUID const&, dbus::ObjectPath const&, chromeos::BluetoothProfileManagerClient::Options const&, chromeos::BluetoothProfileServiceProvider::Delegate*, base::Callback<void (chromeos::BluetoothAdapterProfileChromeOS*)> const&, base::Callback<void (std::string const&)> const&) device/bluetooth/bluetooth_adapter_chromeos.cc:982:5
    #9 0x4ec8e2 in chromeos::BluetoothAdapterProfileChromeOSTest_SimultaneousRegisterFail_Test::TestBody() device/bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc:359:3
    #10 0x85da05 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2420:12
    #11 0x85da05 in testing::Test::Run() testing/gtest/src/gtest.cc:2436
    #12 0x85f619 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2612:5
    #13 0x86040a in testing::TestCase::Run() testing/gtest/src/gtest.cc:2730:5
    #14 0x874063 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4602:11
    #15 0x8736b7 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2420:12
    #16 0x8736b7 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4220
    #17 0x814bda in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2326:10
    #18 0x814bda in base::TestSuite::Run() base/test/test_suite.cc:230
    #19 0x80ad38 in Run base/callback.h:396:12
    #20 0x80ad38 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int ()> const&, int, bool, base::Callback<void ()> const&) base/test/launcher/unit_test_launcher.cc:181
    #21 0x80a863 in base::LaunchUnitTests(int, char**, base::Callback<int ()> const&) base/test/launcher/unit_test_launcher.cc:423:10
    #22 0x7d25ac in main device/test/run_all_unittests.cc:14:10
    #23 0x7f35c8c7276c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
    
    Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x4d9b8b in operator new(unsigned long) (/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__1_/build/src/out/Release/device_unittests+0x4d9b8b)
    #1 0xd9c743 in chromeos::BluetoothProfileServiceProvider::Create(dbus::Bus*, dbus::ObjectPath const&, chromeos::BluetoothProfileServiceProvider::Delegate*) chromeos/dbus/bluetooth_profile_service_provider.cc:251:12
    #2 0x90227f in chromeos::BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS(device::BluetoothUUID const&) device/bluetooth/bluetooth_adapter_profile_chromeos.cc:51:7
    #3 0x901be8 in chromeos::BluetoothAdapterProfileChromeOS::Register(device::BluetoothUUID const&, chromeos::BluetoothProfileManagerClient::Options const&, base::Callback<void (chromeos::BluetoothAdapterProfileChromeOS*)> const&, base::Callback<void (std::string const&, std::string const&)> const&) device/bluetooth/bluetooth_adapter_profile_chromeos.cc:28:11
    #4 0x8f6c47 in chromeos::BluetoothAdapterChromeOS::UseProfile(device::BluetoothUUID const&, dbus::ObjectPath const&, chromeos::BluetoothProfileManagerClient::Options const&, chromeos::BluetoothProfileServiceProvider::Delegate*, base::Callback<void (chromeos::BluetoothAdapterProfileChromeOS*)> const&, base::Callback<void (std::string const&)> const&) device/bluetooth/bluetooth_adapter_chromeos.cc:982:5
    #5 0x4ec8e2 in chromeos::BluetoothAdapterProfileChromeOSTest_SimultaneousRegisterFail_Test::TestBody() device/bluetooth/bluetooth_adapter_profile_chromeos_unittest.cc:359:3
    #6 0x85da05 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2420:12
    #7 0x85da05 in testing::Test::Run() testing/gtest/src/gtest.cc:2436
    #8 0x85f619 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2612:5
    #9 0x86040a in testing::TestCase::Run() testing/gtest/src/gtest.cc:2730:5
    #10 0x874063 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4602:11
    #11 0x8736b7 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2420:12
    #12 0x8736b7 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4220
    #13 0x814bda in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2326:10
    #14 0x814bda in base::TestSuite::Run() base/test/test_suite.cc:230
    #15 0x80ad38 in Run base/callback.h:396:12
    #16 0x80ad38 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int ()> const&, int, bool, base::Callback<void ()> const&) base/test/launcher/unit_test_launcher.cc:181
    #17 0x80a863 in base::LaunchUnitTests(int, char**, base::Callback<int ()> const&) base/test/launcher/unit_test_launcher.cc:423:10
    #18 0x7d25ac in main device/test/run_all_unittests.cc:14:10
    #19 0x7f35c8c7276c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226
    
    Original issue's description:
    > Fix BluetoothAdapterProfileChromeOS lifecycle management
    >
    > Have BluetoothAdapterProfileChromeOS remove itself from adapters when it
    > is deleted via it's deconstructor, to avoid references being left behind
    > after deletion.
    >
    > BUG=457978
    >
    > Committed: https://crrev.com/0cca591aaf6f6a0cbf46840faaead236dd8317a2
    > Cr-Commit-Position: refs/heads/master@{#318925}
    
    TBR=keybuk@chromium.org,isherman@chromium.org,armansito@chromium.org,stgao@chromium.org,jamuraa@chromium.org
    NOPRESUBMIT=true
    NOTREECHECKS=true
    NOTRY=true
    BUG=457978
    
    Review URL: https://codereview.chromium.org/975323002
    
    Cr-Commit-Position: refs/heads/master@{#319034}
    e952a67a
bluetooth_adapter_profile_chromeos.h 4.05 KB