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

Issue 752441 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

[Missing tests]: Break out platform-specific discardable paging into Lock/UnlockPages.

Project Member Reported by msrchandra@chromium.org, Aug 4 2017

Issue description

Automated tests for the below commit have been missing.Would it be possible to add test coverage to avoid regressions in future?

CL: 
===
https://chromium.googlesource.com/chromium/src.git/+/42e65bf2e23d5d36994677dd630d2cf1b5fb86e0

Ref Bug: 
========
https://bugs.chromium.org/p/chromium/issues/detail?id=716205

Thank you!
 

Comment 1 by w...@chromium.org, Aug 5 2017

Status: Started (was: Assigned)
The only change in visible behaviour from that CL is that we can now report FAILED from Lock() operations.  I'll see if I can provoke that by closing the handle before trying to re-Lock() a region, or something. :)
Components: -Tests Tests>Missing

Comment 3 by w...@chromium.org, Aug 15 2017

Cc: nyquist@chromium.org
I'm unable to coax the OS API into failing, so I can't really construct a test for this :-/

nyquist: Any suggestions?

Comment 4 by w...@chromium.org, Aug 15 2017

Labels: -OS-Windows OS-Android

Comment 5 by w...@chromium.org, Aug 15 2017

Summary: [Missing tests]: Break out platform-specific discardable paging into Lock/UnlockPages. (was: [Missing tests]: Try using Windows Offer/ReclaimVirtualMemory APIs in DiscardableMemory lock/unlock impls)
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 31 2017

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

commit 97dd531b30a7089ee1d69da22ab4bacaf4883ac3
Author: Wez <wez@chromium.org>
Date: Thu Aug 31 01:26:51 2017

Add test that Lock() returns failed if ashmem_pin_region() fails.

To cause ashmem_pin_region() to fail, we arrange for it to be called with
an invalid file-descriptor, which requires a valid-looking fd (i.e. we
can't just Close() |memory|), but one on which the operation is invalid.

We can overwrite the |memory| fd with a handle to a different file using
dup2(), which has the nice properties that |memory| still has a valid fd
that it can close, etc without errors, but on which ashmem_pin_region()
will fail.

dup2() will close the ashmem file description before duplicating our
dummy file into the |memory| fd.

Bug:  752441 
Change-Id: I4c6ecced69a2817ec7d86da0e783b9f6e1d238f0
Reviewed-on: https://chromium-review.googlesource.com/602395
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498706}
[modify] https://crrev.com/97dd531b30a7089ee1d69da22ab4bacaf4883ac3/base/memory/discardable_shared_memory_unittest.cc

Comment 7 by w...@chromium.org, Aug 31 2017

Status: Fixed (was: Started)

Sign in to add a comment