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

Issue 757921 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Last visit 15 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

cryptohome ASAN failure: detected memory leaks in libchaps (cryptohome_testrunner)

Project Member Reported by xiaoyinh@chromium.org, Aug 22 2017

Issue description

The amd64-generic-tot-asan-informational builder[1] has been failing for a long time. One of the failures is memory leaks in cryptohome.

[1]: https://build.chromium.org/p/chromiumos.chromium/builders/amd64-generic-tot-asan-informational/builds/14025

+Sherrif briannorris@ and apronin@: Could you help to triage/reroute to proper owners?

The most recent failures can be found here:
https://luci-logdog.appspot.com/v/?s=chromiumos%2Fbb%2Fchromiumos.chromium%2Famd64-generic-tot-asan-informational%2F14025%2F%2B%2Frecipes%2Fsteps%2FUnitTest%2F0%2Fstdout


Log snippet:
cryptohome-0.0.1-r1981:  * ASAN error detected:
cryptohome-0.0.1-r1981:  * 
cryptohome-0.0.1-r1981:  * =================================================================
cryptohome-0.0.1-r1981:  * ==17==ERROR: LeakSanitizer: detected memory leaks
cryptohome-0.0.1-r1981:  * 
cryptohome-0.0.1-r1981:  * Indirect leak of 1888 byte(s) in 4 object(s) allocated from:
cryptohome-0.0.1-r1981:  *     #0 0x7f1d6c561b82  (/tmp/portage/chromeos-base/cryptohome-0.0.1-r1981/work/build/out/Default/cryptohome_testrunner+0x11efb82)
cryptohome-0.0.1-r1981:  *     #1 0x7f1d6ad8684b  (/usr/lib64/libchaps.so+0xff84b)
cryptohome-0.0.1-r1981:  *     #2 0x7f1d6ad9adf7  (/usr/lib64/libchaps.so+0x113df7)
cryptohome-0.0.1-r1981:  *     #3 0x7f1d6ad9ab2f  (/usr/lib64/libchaps.so+0x113b2f)
cryptohome-0.0.1-r1981:  *     #4 0x7f1d69f526e1  (/usr/lib64/libbase-core-395517.so+0x886e1)
cryptohome-0.0.1-r1981:  *     #5 0x7f1d69f768f9  (/usr/lib64/libbase-core-395517.so+0xac8f9)
cryptohome-0.0.1-r1981:  *     #6 0x7f1d69f76b5a  (/usr/lib64/libbase-core-395517.so+0xacb5a)
cryptohome-0.0.1-r1981:  *     #7 0x7f1d69f770cd  (/usr/lib64/libbase-core-395517.so+0xad0cd)
cryptohome-0.0.1-r1981:  *     #8 0x7f1d69f7c03e  (/usr/lib64/libbase-core-395517.so+0xb203e)
cryptohome-0.0.1-r1981:  *     #9 0x7f1d69f764f0  (/usr/lib64/libbase-core-395517.so+0xac4f0)
cryptohome-0.0.1-r1981:  *     #10 0x7f1d69fa91cf  (/usr/lib64/libbase-core-395517.so+0xdf1cf)
cryptohome-0.0.1-r1981:  *     #11 0x7f1d69f75716  (/usr/lib64/libbase-core-395517.so+0xab716)
cryptohome-0.0.1-r1981:  *     #12 0x7f1d69fd6706  (/usr/lib64/libbase-core-395517.so+0x10c706)
cryptohome-0.0.1-r1981:  *     #13 0x7f1d69fce4ce  (/usr/lib64/libbase-core-395517.so+0x1044ce)
cryptohome-0.0.1-r1981:  *     #14 0x7f1d6af352b7  (/lib64/libpthread.so.0+0x72b7)
cryptohome-0.0.1-r1981:  * 
cryptohome-0.0.1-r1981:  * Indirect leak of 960 byte(s) in 4 object(s) allocated from:
cryptohome-0.0.1-r1981:  *     #0 0x7f1d6c561b82  (/tmp/portage/chromeos-base/cryptohome-0.0.1-r1981/work/build/out/Default/cryptohome_testrunner+0x11efb82)
cryptohome-0.0.1-r1981:  *     #1 0x7f1d68bb98aa  (/usr/lib64/libbase-dbus-395517.so+0x278aa)
cryptohome-0.0.1-r1981:  *     #2 0x7f1d6ad86a2e  (/usr/lib64/libchaps.so+0xffa2e)
cryptohome-0.0.1-r1981:  *     #3 0x7f1d6ad9adf7  (/usr/lib64/libchaps.so+0x113df7)
cryptohome-0.0.1-r1981:  *     #4 0x7f1d6ad9ab2f  (/usr/lib64/libchaps.so+0x113b2f)
cryptohome-0.0.1-r1981:  *     #5 0x7f1d69f526e1  (/usr/lib64/libbase-core-395517.so+0x886e1)
cryptohome-0.0.1-r1981:  *     #6 0x7f1d69f768f9  (/usr/lib64/libbase-core-395517.so+0xac8f9)
cryptohome-0.0.1-r1981:  *     #7 0x7f1d69f76b5a  (/usr/lib64/libbase-core-395517.so+0xacb5a)
cryptohome-0.0.1-r1981:  *     #8 0x7f1d69f770cd  (/usr/lib64/libbase-core-395517.so+0xad0cd)
cryptohome-0.0.1-r1981:  *     #9 0x7f1d69f7c03e  (/usr/lib64/libbase-core-395517.so+0xb203e)
cryptohome-0.0.1-r1981:  *     #10 0x7f1d69f764f0  (/usr/lib64/libbase-core-395517.so+0xac4f0)
cryptohome-0.0.1-r1981:  *     #11 0x7f1d69fa91cf  (/usr/lib64/libbase-core-395517.so+0xdf1cf)
cryptohome-0.0.1-r1981:  *     #12 0x7f1d69f75716  (/usr/lib64/libbase-core-395517.so+0xab716)
cryptohome-0.0.1-r1981:  *     #13 0x7f1d69fd6706  (/usr/lib64/libbase-core-395517.so+0x10c706)
cryptohome-0.0.1-r1981:  *     #14 0x7f1d69fce4ce  (/usr/lib64/libbase-core-395517.so+0x1044ce)
cryptohome-0.0.1-r1981:  *     #15 0x7f1d6af352b7  (/lib64/libpthread.so.0+0x72b7)
 
Labels: -Pri-3 OS-Chrome Pri-1
Cc: ejcaruso@chromium.org
+ejcaruso. It may be related to the recent chaps initialization/termination refactoring, like https://chromium-review.googlesource.com/c/chromiumos/platform2/+/537957 and https://chromium-review.googlesource.com/c/chromiumos/platform2/+/614121

Summary: cryptohome ASAN failure: detected memory leaks in libchaps (cryptohome_testrunner) (was: cryptohome ASAN failure: detected memory leaks)
Aside from libchaps memory leaks, there is also
AddressSanitizer: global-buffer-overflow /build/amd64-generic/tmp/portage/net-wireless/bluez-5.44-r105/work/bluez-5.44/src/log.c:276:13

Will check for duplicates and file a separate bug on that.
Let's keep this one focused on libchaps memory leaks.
Components: OS>Systems
Owner: ejcaruso@chromium.org
Status: Assigned (was: Untriaged)
1) Already have issue 748216 for bluez-buffer-overflow. Not filing new.
2) Eric, assigning this one to you for now. Feel free to re-assign to me if it doesn't seem related to those chaps proxy changes, I'll pick up after the sheriff week.
Cc: xiaoyinh@chromium.org

Comment 6 Deleted

Unfortunately amd64-generic-tot-asan-informational has been broken for a very long time for one reason or another, so a proper bisect may need to go back quite a ways :(
 
Owner: ejcaruso@chromium.org
Never mind, I forgot to emerge chaps again :( This does seem like my fault.
Project Member

Comment 9 by bugdroid1@chromium.org, Aug 26 2017

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

commit 6f40928a0b2ee41b28b6417c4646bee4eedd480c
Author: Eric Caruso <ejcaruso@chromium.org>
Date: Sat Aug 26 02:54:09 2017

chaps: refactor D-Bus/threading utilities

dbus::Bus is held as a scoped_refptr by dbus::ObjectProxy, and
dbus::Bus holds a reference to a dbus::ObjectProxy. Since we get
an ObjectProxy as a weak pointer, we have to make sure the bus
gets rid of it when we no longer need it anymore.

We know we want everything to be cleaned up when our reference
to dbus::Bus goes out of scope, so introduce a wrapper which
calls ShutdownAndBlock on the correct thread when that reference
is cleaned up.

On top of that, since this threading code can be a bit confusing,
split some of these utilities out so they can be tested.

BUG= chromium:757921 
TEST=FEATURES=test USE="asan clang" emerge-cyan cryptohome, tests
  on DUT with p11_replay

Change-Id: I5b3e888e5b0b88a5c706563a23ba998ef5aab090
Reviewed-on: https://chromium-review.googlesource.com/627035
Commit-Ready: Andrey Pronin <apronin@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>

[add] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/dbus/scoped_bus.h
[add] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/dbus/scoped_bus.cc
[modify] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/chaps.gyp
[add] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/dbus/dbus_proxy_wrapper.h
[add] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/dbus/dbus_proxy_wrapper.cc
[add] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/dbus/dbus_proxy_wrapper_test.cc
[modify] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/chaps_proxy.cc
[add] https://crrev.com/6f40928a0b2ee41b28b6417c4646bee4eedd480c/chaps/dbus/scoped_bus_test.cc

Status: Fixed (was: Assigned)

Comment 11 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment