Bug 1485463 - Part 2 - use IPC errors to handle an attempt to allocate too many PCompositorBridgeParent; r=aosmond
authorAlex Gaynor <agaynor@mozilla.com>
Wed, 23 Jan 2019 14:32:39 +0000
changeset 455168 5f1830b621aa67dedf3a9da4e8311b732a0bde97
parent 455167 08a365b043d71ff7f2c0cd08bce4469151296f7e
child 455169 a77e9c7eabb535d9d114ae4f1733f1d954132f14
push id76672
push userrvandermeulen@mozilla.com
push dateWed, 23 Jan 2019 22:44:39 +0000
treeherderautoland@5f1830b621aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1485463
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1485463 - Part 2 - use IPC errors to handle an attempt to allocate too many PCompositorBridgeParent; r=aosmond This cannot actually happen in the real world because this path is specific to when the compositor process is also the parent process, and thus is not actually IPC. However, the fuzzer can trigger this case. Depends on D14587 Differential Revision: https://phabricator.services.mozilla.com/D14588
gfx/layers/ipc/CompositorManagerParent.cpp
--- a/gfx/layers/ipc/CompositorManagerParent.cpp
+++ b/gfx/layers/ipc/CompositorManagerParent.cpp
@@ -225,17 +225,19 @@ PCompositorBridgeParent* CompositorManag
       if (NS_WARN_IF(OtherPid() != base::GetCurrentProcId())) {
         MOZ_ASSERT_UNREACHABLE("Child cannot create same process compositor!");
         break;
       }
 
       // Note that the static mutex not only is used to protect sInstance, but
       // also mPendingCompositorBridges.
       StaticMutexAutoLock lock(sMutex);
-      MOZ_ASSERT(!mPendingCompositorBridges.IsEmpty());
+      if (mPendingCompositorBridges.IsEmpty()) {
+        break;
+      }
 
       CompositorBridgeParent* bridge = mPendingCompositorBridges[0];
       bridge->AddRef();
       mPendingCompositorBridges.RemoveElementAt(0);
       return bridge;
     }
     default:
       break;