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

Issue 796742 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

LeakSanitizer: detected memory leaks in chromeos-base/smbprovider

Project Member Reported by rahulchaudhry@chromium.org, Dec 20 2017

Issue description

UnitTest is failing for chromeos-base/smbprovider on the ASAN builder: https://uberchromegw.corp.google.com/i/chromiumos/builders/amd64-generic-asan/builds/22485

smbprovider-0.0.1-r126:  * ==17==ERROR: LeakSanitizer: detected memory leaks
smbprovider-0.0.1-r126:  * 
smbprovider-0.0.1-r126:  * Direct leak of 16 byte(s) in 1 object(s) allocated from:
smbprovider-0.0.1-r126:  *     #0 0x7fd9f4bc8032  (/var/cache/portage/chromeos-base/smbprovider/out/Default/smbprovider_test+0x13b032)
smbprovider-0.0.1-r126:  *     #1 0x7fd9f4bd3e8c  (/var/cache/portage/chromeos-base/smbprovider/out/Default/smbprovider_test+0x146e8c)
smbprovider-0.0.1-r126:  *     #2 0x7fd9f4bceae3  (/var/cache/portage/chromeos-base/smbprovider/out/Default/smbprovider_test+0x141ae3)
smbprovider-0.0.1-r126:  *     #3 0x7fd9f4be8e12  (/var/cache/portage/chromeos-base/smbprovider/out/Default/smbprovider_test+0x15be12)
smbprovider-0.0.1-r126:  *     #4 0x7fd9f4a63a48  (/usr/lib64/libgtest.so.0+0x47a48)
smbprovider-0.0.1-r126:  *     #5 0x7fd9f4a42e08  (/usr/lib64/libgtest.so.0+0x26e08)
smbprovider-0.0.1-r126:  *     #6 0x7fd9f4a4437c  (/usr/lib64/libgtest.so.0+0x2837c)
smbprovider-0.0.1-r126:  *     #7 0x7fd9f4a44bb6  (/usr/lib64/libgtest.so.0+0x28bb6)
smbprovider-0.0.1-r126:  *     #8 0x7fd9f4a4f1c6  (/usr/lib64/libgtest.so.0+0x331c6)
smbprovider-0.0.1-r126:  *     #9 0x7fd9f4a647b8  (/usr/lib64/libgtest.so.0+0x487b8)
smbprovider-0.0.1-r126:  *     #10 0x7fd9f4a4ee51  (/usr/lib64/libgtest.so.0+0x32e51)
smbprovider-0.0.1-r126:  *     #11 0x7fd9f4c08173  (/var/cache/portage/chromeos-base/smbprovider/out/Default/smbprovider_test+0x17b173)
smbprovider-0.0.1-r126:  *     #12 0x7fd9f3378735  (/lib64/libc.so.6+0x20735)
smbprovider-0.0.1-r126:  *     #13 0x7fd9f4afade8  (/var/cache/portage/chromeos-base/smbprovider/out/Default/smbprovider_test+0x6dde8)
...

smbprovider-0.0.1-r126:  * SUMMARY: AddressSanitizer: 4256 byte(s) leaked in 114 allocation(s).

 
Cc: baileyberro@chromium.org benchan@chromium.org
Owner: allenvic@chromium.org
benchan@, baileyberro@, and allenvic@ submitted changes to smbprovider recently, with allenvic@ being the most recent.
It seems that it first started appearing on https://uberchromegw.corp.google.com/i/chromiumos/builders/amd64-generic-asan/builds/22473 which was ran on 12:46 AM on 12/20.

Its possible that this change that was merged at 12:34 on 12/20 may have caused it: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/826423

For now I will discuss with baileyberro@ to try to figure out what is happening.
This change was also merged at the same time: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/833404 

Although that is only changing the usage of base::MakeUnique to std::make_unique.

For visibility, SmbProvider caused an ASAN error before, so it may be related:
https://bugs.chromium.org/p/chromium/issues/detail?id=793068
Cc: zentaro@chromium.org
The issue was introduced by https://chromium-review.googlesource.com/c/chromiumos/platform2/+/826423, where FakeEntry is missing a virtual destructor to allow proper destruction through the base class pointer.

Here's a simple fix: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/838426
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 21 2017

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

commit 581fc2ccd24fb98f4177315e8ad981bce07421bd
Author: Ben Chan <benchan@chromium.org>
Date: Thu Dec 21 21:14:24 2017

smbprovider: add missing virtual destructor for FakeEntry

|FakeDirectory::entries| holds FakeFile, FakeDirectory and FakeEntry
instances via their FakeEntry base class pointer. The destructor of
FakeEntry thus needs to be virtual to allow proper destruction of an
instance of its derived class through the base class pointer.

BUG= chromium:796742 
TEST=`USE=asan FEATURES=test emerge-$BOARD smbprovider`

Change-Id: Ibfbd9be3458c6395fd4a8906558e10789cb5ba82

[modify] https://crrev.com/581fc2ccd24fb98f4177315e8ad981bce07421bd/smbprovider/fake_samba_interface.h

Cc: allenvic@chromium.org
Owner: benchan@chromium.org
Status: Fixed (was: Untriaged)
Status: Archived (was: Fixed)

Sign in to add a comment