New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 660866 link

Starred by 2 users

Issue metadata

Status: Archived
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Memory Asan Bot failing on NetworkThrottlingObserverTest.ThrottlingChangeCallsShill

Project Member Reported by tommycli@chromium.org, Oct 31 2016

Issue description

First failing run: https://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/builds/17281

Likely culprit:
https://codereview.chromium.org/2364703002/

NetworkThrottlingObserverTest.ThrottlingChangeCallsShill (run #1):
<truncated (3232909 bytes)>
f6c4779 in chromeos::DBusThreadManager::DBusThreadManager(chromeos::DBusThreadManager::ProcessMask, bool) chromeos/dbus/dbus_thread_manager.cc:52:32
    #3 0xf6c5c6f in chromeos::DBusThreadManager::Initialize(chromeos::DBusThreadManager::ProcessMask) chromeos/dbus/dbus_thread_manager.cc:231:31
    #4 0x57e5434 in chromeos::test::NetworkThrottlingObserverTest::NetworkThrottlingObserverTest() chrome/browser/chromeos/net/network_throttling_observer_unittest.cc:29:5
    #5 0x57e52ca in NetworkThrottlingObserverTest_ThrottlingChangeCallsShill_Test chrome/browser/chromeos/net/network_throttling_observer_unittest.cc:54:1
    #6 0x57e52ca in testing::internal::TestFactoryImpl<chromeos::test::NetworkThrottlingObserverTest_ThrottlingChangeCallsShill_Test>::CreateTest() testing/gtest/include/gtest/internal/gtest-internal.h:484
    #7 0xc484352 in HandleExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test *> testing/gtest/src/gtest.cc:2458:12
    #8 0xc484352 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2647
    #9 0xc485126 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #10 0xc499566 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #11 0xc498ba7 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #12 0xc498ba7 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #13 0xb97f6c8 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #14 0xb97f6c8 in base::TestSuite::Run() base/test/test_suite.cc:246
    #15 0xb983b34 in Run base/callback.h:64:12
    #16 0xb983b34 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:210
    #17 0xb98378e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:452:10
    #18 0xb96cf19 in main chrome/test/base/run_all_unittests.cc:19:10
    #19 0x7f2d2971c7ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0xb06b4b in operator new(unsigned long) (/b/swarming/w/ir2rNa_o/out/Release/unit_tests+0xb06b4b)
    #1 0xf879552 in chromeos::DBusClientsCommon::DBusClientsCommon(bool) chromeos/dbus/dbus_clients_common.cc:91:37
    #2 0xf6c471e in chromeos::DBusThreadManager::DBusThreadManager(chromeos::DBusThreadManager::ProcessMask, bool) chromeos/dbus/dbus_thread_manager.cc:50:27
    #3 0xf6c5c6f in chromeos::DBusThreadManager::Initialize(chromeos::DBusThreadManager::ProcessMask) chromeos/dbus/dbus_thread_manager.cc:231:31
    #4 0x57e5434 in chromeos::test::NetworkThrottlingObserverTest::NetworkThrottlingObserverTest() chrome/browser/chromeos/net/network_throttling_observer_unittest.cc:29:5
    #5 0x57e52ca in NetworkThrottlingObserverTest_ThrottlingChangeCallsShill_Test chrome/browser/chromeos/net/network_throttling_observer_unittest.cc:54:1
    #6 0x57e52ca in testing::internal::TestFactoryImpl<chromeos::test::NetworkThrottlingObserverTest_ThrottlingChangeCallsShill_Test>::CreateTest() testing/gtest/include/gtest/internal/gtest-internal.h:484
    #7 0xc484352 in HandleExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test *> testing/gtest/src/gtest.cc:2458:12
    #8 0xc484352 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2647
    #9 0xc485126 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #10 0xc499566 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #11 0xc498ba7 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #12 0xc498ba7 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #13 0xb97f6c8 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #14 0xb97f6c8 in base::TestSuite::Run() base/test/test_suite.cc:246
    #15 0xb983b34 in Run base/callback.h:64:12
    #16 0xb983b34 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:210
    #17 0xb98378e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:452:10
    #18 0xb96cf19 in main chrome/test/base/run_all_unittests.cc:19:10
    #19 0x7f2d2971c7ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226

SUMMARY: AddressSanitizer: 41518 byte(s) leaked in 1003 allocation(s).

 
Cc: tommycli@chromium.org steve...@chromium.org
I am not able to reproduce this locally as the asan build fails for me. Could someone more well-versed with Chrome help here?

Build log: https://paste.googleplex.com/6344161439514624

My build setup: 
(sdk zako R56-8934.0.0) kirtika@kirtika2 ~/chromium/src $ cat out/asan/args.gn 
# Build arguments go here. Examples:
#   is_component_build = true
#   is_debug = false
# See "gn args <out_dir> --list" for available build arguments.
is_asan = true
enable_nacl = false
is_debug = true


Command I am running: 
ninja -j 1000 -l 100 -C out/asan chrome unit_tests

Comment 2 by kirtika@google.com, Nov 3 2016

Update - built the asan unit_tests and ran them on my goobuntu desktop over ssh (used the xvfb work-around) - did 10 runs and the test passes each. 

My command: ./out/asan/unit_tests --gtest_filter="NetworkThrottlingObserverTest.ThrottlingChangeCallsShill"

My config: 
$ cat out/asan/args.gn 
# Build arguments go here. Examples:
#   is_component_build = true
#   is_debug = false
# See "gn args <out_dir> --list" for available build arguments.
is_asan = true
enable_nacl = false
is_debug = false
target_os = "chromeos"


Questions: 
(a) How can I replicate the bot's failure?
(b) From the bot's stacktrace, I am pointed each time to this line, which is initializing a FakePermissionBrokerClient: https://cs.chromium.org/chromium/src/chromeos/dbus/dbus_clients_common.cc?q=dbus_clients_common.cc&sq=package:chromium&dr&l=91
This happens during DBusThreadManager::Initialize. This seems like a leak in the existing code that my test is hitting? 

The original CL was missing NetworkHandler::Shutdown, which I added in the draft CL here: https://codereview.chromium.org/2466693002/
However, this draft is still failing the asan trybot in the same place. 


Comment 3 by kirtika@google.com, Nov 3 2016

Cc: sduraisamy@chromium.org snanda@chromium.org
Labels: -Pri-3 Pri-1
Labels: OS-Chrome
For the record, kirtika's CL has been reverted so this is no longer causing chromium.memory bots to go red.

https://www.chromium.org/developers/testing/leaksanitizer says to use the following to turn on leak detection: ASAN_OPTIONS="detect_leaks=1 ..." out/path/to/test_binary
Additionally, I prepared a couple of CLs to prevent some of the errors made here from happening in the future:

https://codereview.chromium.org/2472203003/
https://codereview.chromium.org/2478573003/
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1a5f12f04de58d44e4198094e5f0bac36ce90517

commit 1a5f12f04de58d44e4198094e5f0bac36ce90517
Author: thestig <thestig@chromium.org>
Date: Fri Nov 04 18:46:11 2016

NetworkStateHandler::InitializeForTest() should return a std::unique_ptr.

BUG= 660866 

Review-Url: https://codereview.chromium.org/2478573003
Cr-Commit-Position: refs/heads/master@{#429961}

[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/auto_connect_handler_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/client_cert_resolver_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/host_resolver_impl_chromeos_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/managed_network_configuration_handler_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/network_cert_migrator_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/network_configuration_handler_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/network_connection_handler_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/network_device_handler_unittest.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/network_state_handler.cc
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/network_state_handler.h
[modify] https://crrev.com/1a5f12f04de58d44e4198094e5f0bac36ce90517/chromeos/network/prohibited_technologies_handler_unittest.cc

Status: Fixed (was: Assigned)
https://chromium.googlesource.com/chromium/src/+/857eeac9ace6b79bd8b99fceac315455ee82f617 landed, so I'll close this.

Comment 8 by dchan@google.com, Jan 21 2017

Labels: VerifyIn-57

Comment 9 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 10 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 11 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 13 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)

Sign in to add a comment