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

Issue 779500 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Closed: Sep 4
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-08-31
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Leak of eventfd descriptor when closing AudioContext on ChromeOs

Project Member Reported by mnilsson@chromium.org, Oct 30 2017

Issue description

Chrome Version: 61.0.3163.123
OS: ChromeOs 9765.85.0

What steps will reproduce the problem?
(1) Put a ChromeOs device in dev mode.
(2) In a ssh session (or on console), check the growth of the number of eventfd file descriptors in the chrome browser process:
pid=`ps -ef | grep chrome | grep use-cras | awk '{ print $2 }'`
while true; do ls -l /proc/$pid/fd | grep eventfd | wc -l; sleep 5; done
(3) Load this script into chrome: https://paste.googleplex.com/5382781253189632 https://jsfiddle.net/jo6kus4t/1/
Click on the button next to the Repro label.

What is the expected result?
The number of open eventfd file descriptors remain constant as the script allocates and closes AudioContexts.

What happens instead?
One eventfd descriptor leaked per allocated AudioContext.
Depending on frequency, chrome eventually runs out of filehandles with lots of secondary issues.

 

Comment 1 by guidou@chromium.org, Oct 30 2017

Cc: guidou@chromium.org
Components: -Blink>Media>Audio Blink>WebAudio
Owner: ----

Comment 2 by felixe@chromium.org, Oct 30 2017

Cc: felixe@chromium.org

Comment 3 by kerl@google.com, Oct 31 2017

Cc: kerl@google.com dtosic@chromium.org malmnas@google.com
Cc: -malmnas@google.com malmnas@chromium.org rtoy@chromium.org
Cc: -malmnas@chromium.org malmnas@google.com
Owner: rtoy@chromium.org
Cc: maxmorin@chromium.org

Comment 8 by olka@chromium.org, Nov 1 2017

Cc: olka@chromium.org

Comment 9 by olka@chromium.org, Nov 1 2017

Cc: dgreid@chromium.org
+dgreid for CrOS specifics
Labels: Needs-Feedback
NextAction: 2018-04-16
From WebAudio's perspective, we don't have anything like `eventfd` in our codebase. Shouldn't this be assigned to someone else who is familiar with ChromeOS system?
The NextAction date has arrived: 2018-04-16
Status: Assigned (was: Untriaged)
This bug has an owner, thus, it's been triaged. Changing status to "assigned".
Labels: -Needs-Feedback -M-60 -M-61
NextAction: 2018-08-31
dgreid@ Dylan, could you help us find a right owner for this issue? This doesn't seem to be a problem that can be fixed in Blink layer.
Labels: -Pri-1 M-70 Pri-2
Owner: paulhsia@chromium.org
Paul, can you check if this is still an issue? CRAS doesn't use an eventfd to my memories.
We do create a eventfd in cras_client_create for cras_client and forget to close it... (Added by this CL: crrev.com/c/359938)
Just sent out a CL to resolve this issue (crrev.com/c/1192605). 
Status: Started (was: Assigned)
Project Member

Comment 17 by bugdroid1@chromium.org, Aug 30

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/adhd/+/b6d7df60b4a4973922689fbd4d109d586151f93c

commit b6d7df60b4a4973922689fbd4d109d586151f93c
Author: paulhsia <paulhsia@chromium.org>
Date: Thu Aug 30 16:53:11 2018

CRAS: close server_event_fd in cras_client

Close server_event_fd when destroying a cras_client, which is created
by cras_client_create.

BUG= chromium:779500 
TEST=Open multiple playback stream tabs in chrome and run command
     $ pid=`ps -ef | grep chrome | grep use-cras | awk '{ print $2}'`
     $ while true; do ls -l /proc/$pid/fd | grep eventfd | wc -l; sleep
       5; done
     to check if the number will decrease after closing a playback stream
     tab in chrome

Change-Id: I34ff31396e4b0089b53d6a32d9b1742f2c10a115
Reviewed-on: https://chromium-review.googlesource.com/1192605
Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>

[modify] https://crrev.com/b6d7df60b4a4973922689fbd4d109d586151f93c/cras/src/libcras/cras_client.c

The NextAction date has arrived: 2018-08-31
Status: Verified (was: Started)
The change fixed the leaking problem. Let's close the issue.

Sign in to add a comment