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

Issue 614489 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

AVDA doesn't free shm handles all the time, causing leaked fds.

Project Member Reported by liber...@chromium.org, May 24 2016

Issue description

AVDA::Reset clears bitstream buffers, but doesn't close any shm file descriptor that it has.  same for ::ActualDestroy and ~AVDA.  seeking, at least, leaks in ::Reset.

 
Project Member

Comment 1 by bugdroid1@chromium.org, May 25 2016

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

commit 6e41c76f8bb74142e5a484f3ee6f6a87119b12fb
Author: liberato <liberato@chromium.org>
Date: Wed May 25 20:52:24 2016

Close bitstream buffer shared memory handles on Android.

AndroidVideoDecodeAccelerator would clear references to pending
bitstream buffers in ::Reset and, implicitly, in the destructor.
However, each of those may have a file descriptor for shared memory
that isn't closed.  During a seek, for example, this can cause leaks.

This CL wraps the queue of pending bitstream buffers with a new
BitstreamRecord type, which has a unique_ptr to the (unmapped)
shared memory region, if any.  This will automatically close the
underlying handle when the unique_ptr is released.  Note that no
expensive operation is performed in creating the shared memory
region.  Unless it is later mapped, it just keeps the handle
and ::close()s it on destruction.

BUG= 614489 
TEST=observed /proc/fd/[gpu process] while seeking in a video

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

[modify] https://crrev.com/6e41c76f8bb74142e5a484f3ee6f6a87119b12fb/media/gpu/android_video_decode_accelerator.cc
[modify] https://crrev.com/6e41c76f8bb74142e5a484f3ee6f6a87119b12fb/media/gpu/android_video_decode_accelerator.h

Labels: Merge-Request-52
Status: Started (was: Assigned)
requesting merge to m-52.

Comment 3 by tin...@google.com, May 25 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Project Member

Comment 4 by bugdroid1@chromium.org, May 25 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cb8aa934298c0b9d72da0f5c519b1b4f1cd4e66a

commit cb8aa934298c0b9d72da0f5c519b1b4f1cd4e66a
Author: liberato <liberato@chromium.org>
Date: Wed May 25 21:54:27 2016

[M-52] Close bitstream buffer shared memory handles on Android.

AndroidVideoDecodeAccelerator would clear references to pending
bitstream buffers in ::Reset and, implicitly, in the destructor.
However, each of those may have a file descriptor for shared memory
that isn't closed.  During a seek, for example, this can cause leaks.

This CL wraps the queue of pending bitstream buffers with a new
BitstreamRecord type, which has a unique_ptr to the (unmapped)
shared memory region, if any.  This will automatically close the
underlying handle when the unique_ptr is released.  Note that no
expensive operation is performed in creating the shared memory
region.  Unless it is later mapped, it just keeps the handle
and ::close()s it on destruction.

This is a merge of https://codereview.chromium.org/2011653002 .

BUG= 614489 
TEST=observed /proc/fd/[gpu process] while seeking in a video
NOPRESUBMIT=true
NOTRY=true
TBR=dalecurtis@chromium.org

Review-Url: https://codereview.chromium.org/2008373003
Cr-Commit-Position: refs/branch-heads/2743@{#60}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/cb8aa934298c0b9d72da0f5c519b1b4f1cd4e66a/media/gpu/android_video_decode_accelerator.cc
[modify] https://crrev.com/cb8aa934298c0b9d72da0f5c519b1b4f1cd4e66a/media/gpu/android_video_decode_accelerator.h

Status: Fixed (was: Started)

Sign in to add a comment