Bug 1546546: Part 1 - Never unhook DLL-intercepted functions upon VMSharingPolicyShared destruction r=aklotz
authorDavid Parks <dparks@mozilla.com>
Wed, 08 May 2019 00:25:35 +0000
changeset 534870 e06739cc67cd05d41d37d9f20ea66fe3e4351cb2
parent 534869 791dcf072a98c3524c79d9b765c812b82920869d
child 534871 8f80e7afef7c35617f3637e7cb49246e647d391a
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1546546
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 1546546: Part 1 - Never unhook DLL-intercepted functions upon VMSharingPolicyShared destruction r=aklotz This patch fixes a static destructor order dependency between WindowsDllInterceptor and VMSharingPolicyUnique by telling VMSharingPolicyShared not to access the VMSharingPolicyUnique at destruction. This means that the behavior of intercepted functions is no longer restored in the given process at policy shutdown time. Differential Revision: https://phabricator.services.mozilla.com/D28764
mozglue/misc/interceptor/VMSharingPolicies.h
--- a/mozglue/misc/interceptor/VMSharingPolicies.h
+++ b/mozglue/misc/interceptor/VMSharingPolicies.h
@@ -100,18 +100,19 @@ class VMSharingPolicyShared<MMPolicyInPr
   }
 
   operator const MMPolicyInProcess&() const {
     AutoCriticalSection lock(&sCS);
     return sUniqueVM;
   }
 
   bool ShouldUnhookUponDestruction() const {
-    AutoCriticalSection lock(&sCS);
-    return sUniqueVM.ShouldUnhookUponDestruction();
+    // Unhooking on destruction has issues with static destructor order.
+    // See bug 1546546.
+    return false;
   }
 
   bool Reserve(uint32_t aCount, const ReservationFlags aFlags) {
     AutoCriticalSection lock(&sCS);
     return sUniqueVM.Reserve(aCount, aFlags);
   }
 
   bool IsPageAccessible(void* aVAddress) const {