Bug 1519355 - [Wayland] Produce better error message when mozilla::widget::WaylandShmPool::CreateTemporaryFile() fails, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Fri, 11 Jan 2019 15:15:10 +0000
changeset 510592 2087dafb1eacbff427122c0b146f9c903658fafc
parent 510591 fe5073e21dc50bd582c0e73c0585ea379f403134
child 510593 f65c31506e4994b8492444585670a6031744c610
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1519355
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 1519355 - [Wayland] Produce better error message when mozilla::widget::WaylandShmPool::CreateTemporaryFile() fails, r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D16297
widget/gtk/WindowSurfaceWayland.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -163,26 +163,30 @@ int WaylandShmPool::CreateTemporaryFile(
   }
 
 #ifdef HAVE_POSIX_FALLOCATE
   do {
     ret = posix_fallocate(fd, 0, aSize);
   } while (ret == EINTR);
   if (ret != 0) {
     close(fd);
+    MOZ_CRASH_UNSAFE_PRINTF(
+        "posix_fallocate() fails on %s size %d error code %d\n", filename,
+        aSize, ret);
   }
 #else
   do {
     ret = ftruncate(fd, aSize);
   } while (ret < 0 && errno == EINTR);
   if (ret < 0) {
     close(fd);
+    MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
+                            filename, aSize, ret);
   }
 #endif
-  MOZ_RELEASE_ASSERT(ret == 0, "Mapping file allocation failed.");
 
   return fd;
 }
 
 WaylandShmPool::WaylandShmPool(nsWaylandDisplay* aWaylandDisplay, int aSize)
     : mAllocatedSize(aSize) {
   mShmPoolFd = CreateTemporaryFile(mAllocatedSize);
   mImageData = mmap(nullptr, mAllocatedSize, PROT_READ | PROT_WRITE, MAP_SHARED,