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 453505 2087dafb1eacbff427122c0b146f9c903658fafc
parent 453504 fe5073e21dc50bd582c0e73c0585ea379f403134
child 453506 f65c31506e4994b8492444585670a6031744c610
push id75879
push userrvandermeulen@mozilla.com
push dateFri, 11 Jan 2019 16:29:50 +0000
treeherderautoland@2087dafb1eac [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,