New issue
Advanced search Search tips

Issue 709095 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

ClangToTLinuxAsan_tester failing unit_tests with LeakSanitizer: detected memory leaks

Project Member Reported by inglorion@chromium.org, Apr 6 2017

Issue description

First failing build: https://build.chromium.org/p/chromium.fyi/builders/ClangToTLinuxASan%20tester/builds/1980

Logs: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Fchromium.fyi%2FClangToTLinuxASan_tester%2F1980%2F%2B%2Frecipes%2Fsteps%2Funit_tests%2F0%2Fstdout

Example:
==1908==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7b3740 in operator new(unsigned long) /b/c/b/ClangToTLinuxASan/src/third_party/llvm/compiler-rt/lib/asan/asan_new_delete.cc:82
    #1 0xb5a5ca0 in __allocate buildtools/third_party/libc++/trunk/include/new:168:10
    #2 0xb5a5ca0 in allocate buildtools/third_party/libc++/trunk/include/memory:1729
    #3 0xb5a5ca0 in allocate buildtools/third_party/libc++/trunk/include/memory:1488
    #4 0xb5a5ca0 in std::__1::deque<std::__1::unique_ptr<base::internal::Task, std::__1::default_delete<base::internal::Task> >, std::__1::allocator<std::__1::unique_ptr<base::internal::Task, std::__1::default_delete<base::internal::Task> > > >::__add_back_capacity() buildtools/third_party/libc++/trunk/include/deque:2461
    #5 0xb5a4aca in push_back buildtools/third_party/libc++/trunk/include/deque:1817:9
    #6 0xb5a4aca in push buildtools/third_party/libc++/trunk/include/queue:289
    #7 0xb5a4aca in base::internal::Sequence::PushTask(std::__1::unique_ptr<base::internal::Task, std::__1::default_delete<base::internal::Task> >) base/task_scheduler/sequence.cc:25
    #8 0xb5a0192 in base::internal::SchedulerWorkerPoolImpl::PostTaskWithSequenceNow(std::__1::unique_ptr<base::internal::Task, std::__1::default_delete<base::internal::Task> >, scoped_refptr<base::internal::Sequence>) base/task_scheduler/scheduler_worker_pool_impl.cc:280:45
    #9 0xb59feba in base::internal::SchedulerWorkerPoolImpl::PostTaskWithSequence(std::__1::unique_ptr<base::internal::Task, std::__1::default_delete<base::internal::Task> >, scoped_refptr<base::internal::Sequence>) base/task_scheduler/scheduler_worker_pool_impl.cc:253:5
    #10 0xb5a2999 in base::internal::(anonymous namespace)::SchedulerSequencedTaskRunner::PostDelayedTask(tracked_objects::Location const&, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>, base::TimeDelta) base/task_scheduler/scheduler_worker_pool_impl.cc:103:26
    #11 0xb4b9ea0 in PostTask base/task_runner.cc:47:10
    #12 0xb4b9ea0 in base::(anonymous namespace)::PostTaskAndReplyTaskRunner::PostTask(tracked_objects::Location const&, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>) base/task_runner.cc:40
    #13 0xb4d81be in base::internal::PostTaskAndReplyImpl::PostTaskAndReply(tracked_objects::Location const&, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>) base/threading/post_task_and_reply_impl.cc:91:8
    #14 0xb4b9baa in base::TaskRunner::PostTaskAndReply(tracked_objects::Location const&, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>, base::Callback<void (), (base::internal::CopyMode)0, (base::internal::RepeatMode)0>) base/task_runner.cc:53:43
    #15 0xbb5465f in leveldb_proto::ProtoDatabaseImpl<budget_service::Budget>::InitWithDatabase(std::__1::unique_ptr<leveldb_proto::LevelDB, std::__1::default_delete<leveldb_proto::LevelDB> >, leveldb_proto::Options const&, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) components/leveldb_proto/proto_database_impl.h:270:17
    #16 0xbb5296a in leveldb_proto::ProtoDatabaseImpl<budget_service::Budget>::InitWithOptions(char const*, leveldb_proto::Options const&, base::Callback<void (bool), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) components/leveldb_proto/proto_database_impl.h:235:3
    #17 0xbb4cc09 in Init components/leveldb_proto/proto_database.h:47:5
    #18 0xbb4cc09 in BudgetDatabase::BudgetDatabase(Profile*, base::FilePath const&) chrome/browser/budget_service/budget_database.cc:62
    #19 0xbb5b998 in BudgetManager::BudgetManager(Profile*) chrome/browser/budget_service/budget_manager.cc:22:7
    #20 0xbb5e841 in BudgetManagerFactory::BuildServiceInstanceFor(content::BrowserContext*) const chrome/browser/budget_service/budget_manager_factory.cc:43:14
    #21 0xf4f1427 in BrowserContextKeyedServiceFactory::BuildServiceInstanceFor(base::SupportsUserData*) const components/keyed_service/content/browser_context_keyed_service_factory.cc:92:7
    #22 0xe6f5def in KeyedServiceFactory::GetServiceForContext(base::SupportsUserData*, bool) components/keyed_service/core/keyed_service_factory.cc:89:15
    #23 0xa5c781 in GetManager chrome/browser/budget_service/budget_manager_unittest.cc:36:12
    #24 0xa5c781 in BudgetManagerTest::ReserveBudget(Profile*, blink::mojom::BudgetOperationType) chrome/browser/budget_service/budget_manager_unittest.cc:97
    #25 0xa5e15e in BudgetManagerTest_TestUniqueOrigin_Test::TestBody() chrome/browser/budget_service/budget_manager_unittest.cc:202:3
    #26 0xaae019c in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #27 0xaae019c in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #28 0xaae1ac4 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #29 0xaae2bf6 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #30 0xaaf8826 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #31 0xaaf7d67 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #32 0xaaf7d67 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #33 0x94d9494 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #34 0x94d9494 in base::TestSuite::Run() base/test/test_suite.cc:271
    #35 0x94dd811 in Run base/callback.h:80:12
    #36 0x94dd811 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:211
    #37 0x94dd41e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #38 0x94c40ff in main chrome/test/base/run_all_unittests.cc:30:10
    #39 0x7fcf670e0f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287

 
Owner: altimin@chromium.org
altimin, since the trace mentions BudgetManager and BudgetDatabase a number of times, I wonder if this is related to https://codereview.chromium.org/2798563003

Could you take a look?
Owner: inglorion@chromium.org
Nope, that's not me, my budgets are a different thing from BudgetManager and BudgetDatabase. Moreover, my code is in renderer process only, this code is in the browser process.
Cc: h...@chromium.org
Hans, I'm currently bisecting this one. I'll let you know what that yields.
Owner: fdoray@chromium.org
Bisect identifies https://codereview.chromium.org/2767923002 as the first chromium revision that exhibits this problem.

fdoray, can you take a look?

Comment 6 by h...@chromium.org, Apr 11 2017

I double checked that this happens both with currently used clang and newer versions, so it's not anything that changed in clang.

I'm curious how the CL got through the commit queue though, because there was a linux_chromium_asan_rel_ng tryjob there:
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/343225

fdoray: Have you had a chance to look at this yet?

Comment 7 by h...@chromium.org, Apr 11 2017

chromium.memory is also green: https://build.chromium.org/p/chromium.memory/console

Very strange.

Comment 8 by fdoray@chromium.org, Apr 12 2017

https://codereview.chromium.org/2812293002/ should fix the issue
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 13 2017

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

commit 6044a51d3e0eff211412224d21f62777db7641a4
Author: fdoray <fdoray@chromium.org>
Date: Thu Apr 13 12:04:20 2017

Flush TaskScheduler in ~ScopedTaskEnvironment and ~ScopedAsyncTaskScheduler.

Skipping tasks when destroying ScopedTaskEnvironment or
ScopedAsyncTaskScheduler means that DeleteSoon() tasks
can be skipped, resulting in memory leaks.

BUG=708584,  709095 

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

[modify] https://crrev.com/6044a51d3e0eff211412224d21f62777db7641a4/base/test/scoped_async_task_scheduler.cc
[modify] https://crrev.com/6044a51d3e0eff211412224d21f62777db7641a4/base/test/scoped_task_environment.cc

Comment 10 by h...@chromium.org, Apr 17 2017

Status: Fixed (was: Available)

Sign in to add a comment