Skip to content

Commit

Permalink
Revert "Fix crash in FilePathWatcherKQueue."
Browse files Browse the repository at this point in the history
This reverts commit 8cb19ba.

Reason for revert: Not the right fix.

Original change's description:
> Fix crash in FilePathWatcherKQueue.
>
> It's possible that FileDescriptorWatcher may have a task queued up to
> run FilePathWatcherKQueue::OnKQueueReadable after a call to
> FilePathWatcherKQueue::Cancel. In this case, OnKQueueReadable would find
> that its events_ vector is empty and the queue file descriptor is
> -1. This here fix invalidates outstanding WeakPtrs in Cancel so that any
> queued tasks don't run.
>
> Bug: 1156603
> Change-Id: Ia3b644db49bea1a145cb0da91451f563f057d824
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2661337
> Auto-Submit: Greg Thompson <grt@chromium.org>
> Commit-Queue: Wez <wez@chromium.org>
> Reviewed-by: Wez <wez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#848881}

TBR=wez@chromium.org,gab@chromium.org,grt@chromium.org,jdoerrie@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1156603
Change-Id: I0b68dcc938b6be9ce10dde752418226a3d1ae15f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2668931
Reviewed-by: Greg Thompson <grt@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#849791}
  • Loading branch information
GregTho authored and Chromium LUCI CQ committed Feb 2, 2021
1 parent 794f716 commit bbbc968
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions base/files/file_path_watcher_kqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,6 @@ void FilePathWatcherKQueue::Cancel() {
if (!is_cancelled()) {
set_cancelled();
kqueue_watch_controller_.reset();
// There may be pending tasks on this sequence to handle previously-observed
// changes on the queue's file descriptor. Invalidate them so that they
// never run.
weak_factory_.InvalidateWeakPtrs();
if (IGNORE_EINTR(close(kqueue_)) != 0) {
DPLOG(ERROR) << "close kqueue";
}
Expand Down

0 comments on commit bbbc968

Please sign in to comment.