Memory leaks in shill unit tests |
||||||||||
Issue descriptionThe ASAN builder has been failing due to memory leaks in shill_unittest: https://build.chromium.org/p/chromiumos.chromium/builders/amd64-generic-tot-asan-informational shill-0.0.3-r263: * ASAN error detected: shill-0.0.3-r263: * shill-0.0.3-r263: * ================================================================= shill-0.0.3-r263: * ==17==ERROR: LeakSanitizer: detected memory leaks shill-0.0.3-r263: * shill-0.0.3-r263: * Indirect leak of 656 byte(s) in 1 object(s) allocated from: shill-0.0.3-r263: * #0 0x7faf99baf640 in operator new(unsigned long) (/var/cache/portage/chromeos-base/shill/out/Default/shill_unittest+0x41e3640) shill-0.0.3-r263: * #1 0x7faf9b39d657 in shill::MobileOperatorInfoOverrideTest::MobileOperatorInfoOverrideTest() /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../tmp/portage/chromeos-base/shill-0.0.3-r263/work/shill-0.0.3/aosp/system/connectivity/shill/cellular/mobile_operator_info_unittest.cc:1633:35 shill-0.0.3-r263: * #2 0x7faf9b39d377 in shill::MobileOperatorInfoOverrideTest_MultipleDBOverrides_Test::MobileOperatorInfoOverrideTest_MultipleDBOverrides_Test() /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../tmp/portage/chromeos-base/shill-0.0.3-r263/work/shill-0.0.3/aosp/system/connectivity/shill/cellular/mobile_operator_info_unittest.cc:1695:1 shill-0.0.3-r263: * #3 0x7faf9b39d377 in testing::internal::ParameterizedTestFactory<shill::MobileOperatorInfoOverrideTest_MultipleDBOverrides_Test>::CreateTest() /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../usr/include/gtest/internal/gtest-param-util.h:360 shill-0.0.3-r263: * #4 0x7faf94b11cff in testing::Test* testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test*>(testing::internal::TestFactoryBase*, testing::Test* (testing::internal::TestFactoryBase::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:2078:10 shill-0.0.3-r263: * #5 0x7faf94b11cff in testing::Test* testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test*>(testing::internal::TestFactoryBase*, testing::Test* (testing::internal::TestFactoryBase::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:2114 shill-0.0.3-r263: * #6 0x7faf94af3f37 in testing::TestInfo::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:2317:22 shill-0.0.3-r263: * #7 0x7faf94af4782 in testing::TestCase::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:2444:5 shill-0.0.3-r263: * #8 0x7faf94afe018 in testing::internal::UnitTestImpl::RunAllTests() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:4315:11 shill-0.0.3-r263: * #9 0x7faf94b124af in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:2078:10 shill-0.0.3-r263: * #10 0x7faf94b124af in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:2114 shill-0.0.3-r263: * #11 0x7faf94afdc79 in testing::UnitTest::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.7.0/work/gtest-1.7.0-abi_x86_64.amd64/./src/gtest.cc:3926:10 shill-0.0.3-r263: * #12 0x7faf9b0c4d12 in RUN_ALL_TESTS() /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../usr/include/gtest/gtest.h:2288:10 shill-0.0.3-r263: * #13 0x7faf9b0c4d12 in main /build/amd64-generic/var/cache/portage/chromeos-base/shill/out/Default/../../../../../../../tmp/portage/chromeos-base/shill-0.0.3-r263/work/shill-0.0.3/aosp/system/connectivity/shill/testrunner.cc:51 shill-0.0.3-r263: * #14 0x7faf9366cfb5 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.19-r13/work/glibc-2.19/csu/libc-start.c:292 shill-0.0.3-r263: * #15 0x7faf99ad4694 in _start (/var/cache/portage/chromeos-base/shill/out/Default/shill_unittest+0x4108694) ... shill-0.0.3-r263: * SUMMARY: AddressSanitizer: 4415 byte(s) leaked in 102 allocation(s).
,
Nov 28 2016
+Ben Is this a regression, or is the memory leak test new?
,
Nov 28 2016
Seems like it started failing in build #11161, and the shill change in question would therefore be https://chromium-review.googlesource.com/c/400944/ MobileOperatorInfo seems to show up in all of the leak stacks so this seems like a reasonable blame.
,
Nov 28 2016
Skylar, could you please take a look?
,
Nov 28 2016
I found the leak (it was my oversight in code review). Testing with a fix.
,
Nov 29 2016
The following revision refers to this bug: https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/de5d79e595d3837cf2fec47742e65f6a9e7472ff commit de5d79e595d3837cf2fec47742e65f6a9e7472ff Author: Ben Chan <benchan@chromium.org> Date: Mon Nov 28 20:40:06 2016 shill: fix memory leak in MobileOperatorInfoOverrideTest MobileOperatorInfoOverrideTest owns its |operator_info_impl_| and should manage it within a std::unique_ptr. BUG= chromium:669147 TEST=Run unit tests with address sanitizer enabled. Change-Id: I9b101b73bf187726f84abaade4fe3e7e4cc2eac2 Reviewed-on: https://chromium-review.googlesource.com/414955 Commit-Ready: Ben Chan <benchan@chromium.org> Tested-by: Ben Chan <benchan@chromium.org> Reviewed-by: Kevin Cernekee <cernekee@chromium.org> [modify] https://crrev.com/de5d79e595d3837cf2fec47742e65f6a9e7472ff/cellular/mobile_operator_info_unittest.cc
,
Nov 29 2016
,
Mar 4 2017
,
Apr 17 2017
,
May 30 2017
,
Aug 1 2017
,
Oct 14 2017
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by achuith@chromium.org
, Nov 28 2016Owner: cernekee@chromium.org