LorgnetteManagerClientImpl::ScanImageToString has race. |
||||
Issue descriptionIf ScanImageToString is called, it sends a D-Bus Call to LorgnetteManager service, and in parallel, it starts to read the data from pipe, whose write side is sent to the service via the D-Bus call. Periodically, PipeReaderForString's OnDataReady() callback is called, per buffer full. On completion, the callback for D-Bus is called. There's no guarantee of the order, so D-Bus's callback can be called before pending PipeReaderForString::OnDataReady(). In such a case, OnDataReady(-1) is manually called, though it means pending data in the buffer will be simply discarded. It is necessary to wait until the data is processed, at least on success case.
,
Nov 10 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/870cb9538a6929f4ca45ae6582be21638b26452f commit 870cb9538a6929f4ca45ae6582be21638b26452f Author: Hidehiko Abe <hidehiko@chromium.org> Date: Fri Nov 10 02:07:22 2017 Fix race issue in LorgnetteManagerClientImpl. There was no guarantee between data read completion on a blocking thread and the D-Bus reply. If D-Bus reply is earlier than the data read, the data would be lost. This CL fixes it by waiting both data read completion and D-Bus reply. BUG= 776310 TEST=Ran documentscan_AppTestWithFakeLorgnette on DUT. Change-Id: If887acf77b9451e52021d06d27f90852f961285f Reviewed-on: https://chromium-review.googlesource.com/754149 Reviewed-by: Steven Bennetts <stevenjb@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> Commit-Queue: Hidehiko Abe <hidehiko@chromium.org> Cr-Commit-Position: refs/heads/master@{#515418} [modify] https://crrev.com/870cb9538a6929f4ca45ae6582be21638b26452f/chromeos/dbus/lorgnette_manager_client.cc
,
Nov 10 2017
,
Jan 22 2018
,
Jan 23 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by bugdroid1@chromium.org
, Oct 30 2017