Backed out changeset 6fafce03df13 (bug 1460989) for causing the Galaxy S8 crash rate to spike.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 06 Jun 2018 21:31:08 -0400
changeset 473640 275a429f33cfddd08ad302cbf096740daa793f0b
parent 473639 4395ffa81ea0bb9b8e3b0f40f19b636c9aa183cc
child 473641 503f6513c77449052b85f705023af99ec1b57b9d
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1460989
milestone61.0
backs out6fafce03df13c69f759abf2931f92e79c4e87b07
Backed out changeset 6fafce03df13 (bug 1460989) for causing the Galaxy S8 crash rate to spike.
mozglue/linker/ElfLoader.cpp
--- a/mozglue/linker/ElfLoader.cpp
+++ b/mozglue/linker/ElfLoader.cpp
@@ -906,31 +906,21 @@ public:
 
     if (prot & PROT_WRITE) {
       success = true;
       return;
     }
 
     page = firstPage;
     int ret = mprotect(page, length, prot | PROT_WRITE);
-    if (ret != 0) {
-      success = false;
-      WARN("mprotect(%p, %zu, %o) = %d (errno=%d; %s)",
-           page, length, prot | PROT_WRITE, ret, errno, strerror(errno));
-      return;
-    }
-
-    // XXX bug 1460989: on some devices, mprotect appears to return 0 for
-    // success even after _failing_ to make the page writable. Therefore, check
-    // for write access again instead of relying on the mprotect return value.
-    int newProt = getProt(start, &end);
-    success = (newProt != -1) && (newProt & PROT_WRITE);
+    success = ret == 0;
     if (!success) {
-      WARN("mprotect(%p, %zu, %o) returned 0 but page is not writable: %o",
-           page, length, prot | PROT_WRITE, newProt);
+      ERROR("mprotect(%p, %zu, %d) = %d (errno=%d; %s)",
+            page, length, prot | PROT_WRITE, ret,
+            errno, strerror(errno));
     }
   }
 
   bool IsWritable() const {
     return success;
   }
 
   ~EnsureWritable()