From d023da3f77306882389a2d8a09a7125815a00b31 Mon Sep 17 00:00:00 2001 From: Achuith Bhandarkar Date: Tue, 14 Jun 2016 12:41:36 -0700 Subject: [PATCH] Fix for sync filesystem app crash. Previously removing the SafePointScope had a risk of producing a dead lock if the following scenario happens: 1) The main thread starts a GC and tries to stop all other threads. 2) The worker thread is waiting on a signal without entering the SafePointScope. The main thread cannot stop the worker thread forever and thus cannot make progress. Dead lock. However, (to avoid this kind of dead lock) code has been added to timeout the GC if the GCing thread fails at stopping other threads within 100 ms. So not entering SafePointScope will just cause the timeout -- it won't cause a dead lock. This fixes a hard-to-reproduce timing bug that's been a big concern of one of our partners. BUG=592124,608603 TEST=manual Review-Url: https://codereview.chromium.org/2009093002 Cr-Commit-Position: refs/heads/master@{#399265} (cherry picked from commit f466a07e32ce1c8083dc726c7391e68b2ff2e7b0) Review URL: https://codereview.chromium.org/2065823003 . Cr-Commit-Position: refs/branch-heads/2743@{#353} Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939} --- content/child/fileapi/webfilesystem_impl.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/content/child/fileapi/webfilesystem_impl.cc b/content/child/fileapi/webfilesystem_impl.cc index 848079f09ae63..640e57fa8749d 100644 --- a/content/child/fileapi/webfilesystem_impl.cc +++ b/content/child/fileapi/webfilesystem_impl.cc @@ -25,7 +25,6 @@ #include "third_party/WebKit/public/platform/WebFileSystemCallbacks.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebHeap.h" #include "url/gurl.h" using base::MakeTuple; @@ -52,10 +51,7 @@ class WebFileSystemImpl::WaitableCallbackResults } void WaitAndRun() { - { - blink::WebHeap::SafePointScope safe_point; - results_available_event_.Wait(); - } + results_available_event_.Wait(); Run(); }