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

Issue 809566 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Build-Toolchain



Sign in to add a comment

Memory leak in cryptohome

Project Member Reported by manojgupta@chromium.org, Feb 6 2018

Issue description

https://build.chromium.org/p/chromiumos/builders/amd64-generic-asan/builds/23252

cryptohome-0.0.1-r2444:  * =================================================================
cryptohome-0.0.1-r2444:  * ==17==ERROR: LeakSanitizer: detected memory leaks
cryptohome-0.0.1-r2444:  * 
cryptohome-0.0.1-r2444:  * Direct leak of 32 byte(s) in 1 object(s) allocated from:
cryptohome-0.0.1-r2444:  *     #0 0x7f37d5386902 in operator new(unsigned long) ??:0:0
cryptohome-0.0.1-r2444:  *     #1 0x7f37d6786bfd in cryptohome::SignInHashTree::SignInHashTree(unsigned int, unsigned char, base::FilePath) /build/amd64-generic/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-0.0.1-r2444/work/cryptohome-0.0.1/platform2/cryptohome/sign_in_hash_tree.cc:28:12
cryptohome-0.0.1-r2444:  *     #2 0x7f37d6329cec in cryptohome::SignInHashTreeUnitTest_GetAuxiliaryLabelsTest_Test::TestBody() /build/amd64-generic/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-0.0.1-r2444/work/cryptohome-0.0.1/platform2/cryptohome/sign_in_hash_tree_unittest.cc:85:18
cryptohome-0.0.1-r2444:  *     #3 0x7f37d406c678 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2402:10
cryptohome-0.0.1-r2444:  *     #4 0x7f37d406c678 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2438:0
cryptohome-0.0.1-r2444:  *     #5 0x7f37d4050cf8 in testing::Test::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2474:5
cryptohome-0.0.1-r2444:  *     #6 0x7f37d4051ffc in testing::TestInfo::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2656:11
cryptohome-0.0.1-r2444:  *     #7 0x7f37d4052896 in testing::TestCase::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2774:28
cryptohome-0.0.1-r2444:  *     #8 0x7f37d405baa6 in testing::internal::UnitTestImpl::RunAllTests() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:4649:43
cryptohome-0.0.1-r2444:  *     #9 0x7f37d406d3e8 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.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2402:10
cryptohome-0.0.1-r2444:  *     #10 0x7f37d406d3e8 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.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:2438:0
cryptohome-0.0.1-r2444:  *     #11 0x7f37d405b73e in testing::UnitTest::Run() /build/amd64-generic/tmp/portage/dev-cpp/gtest-1.8.0-r1/work/googletest-release-1.8.0/googletest-abi_x86_64.amd64/./src/gtest.cc:4257:10
cryptohome-0.0.1-r2444:  *     #12 0x7f37d63e55d7 in RUN_ALL_TESTS() /build/amd64-generic/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../usr/include/gtest/gtest.h:2233:46
cryptohome-0.0.1-r2444:  *     #13 0x7f37d63e55d7 in main /build/amd64-generic/var/cache/portage/chromeos-base/cryptohome/out/Default/../../../../../../../tmp/portage/chromeos-base/cryptohome-0.0.1-r2444/work/cryptohome-0.0.1/platform2/common-mk/testrunner.cc:16:0
cryptohome-0.0.1-r2444:  *     #14 0x7f37d14e3735 in __libc_start_main /var/tmp/portage/cross-x86_64-cros-linux-gnu/glibc-2.23-r15/work/glibc-2.23/csu/../csu/libc-start.c:289:0
cryptohome-0.0.1-r2444:  *     #15 0x7f37d52b96b8 in _start ??:0:0

 
Cc: xiy...@chromium.org derat@chromium.org manojgupta@chromium.org steve...@chromium.org cra...@chromium.org osh...@chromium.org
 Issue 809584  has been merged into this issue.
Project Member

Comment 2 by bugdroid1@chromium.org, Feb 7 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/e3a544c899e46689eef7267c3c1a4929551a3538

commit e3a544c899e46689eef7267c3c1a4929551a3538
Author: Manoj Gupta <manojgupta@google.com>
Date: Wed Feb 07 02:19:02 2018

cryptohome: Fix a memory leak.

Fix a memory leak reported by asan.
Track the memory allocated by new Platform() in a unique_ptr
so that it is auto deallocated.

BUG= chromium:809566 
TEST=USE="asan" FEATURES=test" emerge-amd64-generic cryptohome passed.

Change-Id: I3de778c7b93de54bcb7c7853884f055020164e54
Reviewed-on: https://chromium-review.googlesource.com/904802
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>

[modify] https://crrev.com/e3a544c899e46689eef7267c3c1a4929551a3538/cryptohome/sign_in_hash_tree.cc
[modify] https://crrev.com/e3a544c899e46689eef7267c3c1a4929551a3538/cryptohome/sign_in_hash_tree.h

Status: Verified (was: Untriaged)
Labels: libcxx_asan

Sign in to add a comment