Bug 1524280 - Add logging for crash reports to help diagnose why the buffer is missing. r=kats
authorAndrew Osmond <aosmond@mozilla.com>
Fri, 03 May 2019 11:10:14 -0400
changeset 531396 5d9d5394671f06885abdd48267fe00359daf5181
parent 531395 215c2693d28175e3d2a51cc0441f3f17da08096b
child 531397 7d2ca22948eb6810bce546348436971713420ea8
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1524280
milestone68.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 1524280 - Add logging for crash reports to help diagnose why the buffer is missing. r=kats Differential Revision: https://phabricator.services.mozilla.com/D29829
gfx/layers/ipc/SharedSurfacesParent.cpp
--- a/gfx/layers/ipc/SharedSurfacesParent.cpp
+++ b/gfx/layers/ipc/SharedSurfacesParent.cpp
@@ -50,29 +50,31 @@ void SharedSurfacesParent::Shutdown() {
   sInstance = nullptr;
 }
 
 /* static */
 already_AddRefed<DataSourceSurface> SharedSurfacesParent::Get(
     const wr::ExternalImageId& aId) {
   StaticMutexAutoLock lock(sMutex);
   if (!sInstance) {
+    gfxCriticalNote << "SSP:Get " << aId.mHandle << " shtd";
     return nullptr;
   }
 
   RefPtr<SourceSurfaceSharedDataWrapper> surface;
   sInstance->mSurfaces.Get(wr::AsUint64(aId), getter_AddRefs(surface));
   return surface.forget();
 }
 
 /* static */
 already_AddRefed<DataSourceSurface> SharedSurfacesParent::Acquire(
     const wr::ExternalImageId& aId) {
   StaticMutexAutoLock lock(sMutex);
   if (!sInstance) {
+    gfxCriticalNote << "SSP:Acq " << aId.mHandle << " shtd";
     return nullptr;
   }
 
   RefPtr<SourceSurfaceSharedDataWrapper> surface;
   sInstance->mSurfaces.Get(wr::AsUint64(aId), getter_AddRefs(surface));
 
   if (surface) {
     DebugOnly<bool> rv = surface->AddConsumer();
@@ -106,16 +108,17 @@ bool SharedSurfacesParent::Release(const
 
 /* static */
 void SharedSurfacesParent::AddSameProcess(const wr::ExternalImageId& aId,
                                           SourceSurfaceSharedData* aSurface) {
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
   StaticMutexAutoLock lock(sMutex);
   if (!sInstance) {
+    gfxCriticalNote << "SSP:Ads " << aId.mHandle << " shtd";
     return;
   }
 
   // If the child bridge detects it is in the combined UI/GPU process, then it
   // will insert a wrapper surface holding the shared memory buffer directly.
   // This is good because we avoid mapping the same shared memory twice, but
   // still allow the original surface to be freed and remove the wrapper from
   // the table when it is no longer needed.
@@ -163,24 +166,26 @@ void SharedSurfacesParent::DestroyProces
 /* static */
 void SharedSurfacesParent::Add(const wr::ExternalImageId& aId,
                                const SurfaceDescriptorShared& aDesc,
                                base::ProcessId aPid) {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   MOZ_ASSERT(aPid != base::GetCurrentProcId());
   StaticMutexAutoLock lock(sMutex);
   if (!sInstance) {
+    gfxCriticalNote << "SSP:Add " << aId.mHandle << " shtd";
     return;
   }
 
   // Note that the surface wrapper maps in the given handle as read only.
   RefPtr<SourceSurfaceSharedDataWrapper> surface =
       new SourceSurfaceSharedDataWrapper();
   if (NS_WARN_IF(!surface->Init(aDesc.size(), aDesc.stride(), aDesc.format(),
                                 aDesc.handle(), aPid))) {
+    gfxCriticalNote << "SSP:Add " << aId.mHandle << " init";
     return;
   }
 
   uint64_t id = wr::AsUint64(aId);
   MOZ_ASSERT(!sInstance->mSurfaces.Contains(id));
 
   RefPtr<wr::RenderSharedSurfaceTextureHost> texture =
       new wr::RenderSharedSurfaceTextureHost(surface);