Bug 1641605 - Install SIGXCPU handler even if sandbox is disabled. r=padenot
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 03 Jun 2020 12:18:56 +0000
changeset 533700 06a51605468f3591b3c43cdcaaf4754946f59270
parent 533699 39b78f58aec6a2f75488def075687234f14ee857
child 533701 a759f9651479268edf3eefa302ddbcb648826ea6
push id37476
push userccoroiu@mozilla.com
push dateWed, 03 Jun 2020 21:49:22 +0000
treeherdermozilla-central@66d3efe9fc7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1641605
milestone79.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 1641605 - Install SIGXCPU handler even if sandbox is disabled. r=padenot Differential Revision: https://phabricator.services.mozilla.com/D78019
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1615,28 +1615,27 @@ mozilla::ipc::IPCResult ContentChild::Re
 
 #  ifdef MOZ_USING_WASM_SANDBOXING
   mozilla::ipc::PreloadSandboxedDynamicLibraries();
 #  endif
 
   bool sandboxEnabled = true;
 #  if defined(XP_LINUX)
   // On Linux, we have to support systems that can't use any sandboxing.
-  if (!SandboxInfo::Get().CanSandboxContent()) {
-    sandboxEnabled = false;
-  } else {
+  sandboxEnabled = SandboxInfo::Get().CanSandboxContent();
+
+  if (StaticPrefs::media_cubeb_sandbox()) {
+    // This needs to happen regardless of whether sandboxing is enabled.
+    if (atp_set_real_time_limit(0, 48000)) {
+      NS_WARNING("could not set real-time limit at process startup");
+    }
+    InstallSoftRealTimeLimitHandler();
+  } else if (sandboxEnabled) {
     // Pre-start audio before sandboxing; see bug 1443612.
-    if (StaticPrefs::media_cubeb_sandbox()) {
-      if (atp_set_real_time_limit(0, 48000)) {
-        NS_WARNING("could not set real-time limit at process startup");
-      }
-      InstallSoftRealTimeLimitHandler();
-    } else {
-      Unused << CubebUtils::GetCubebContext();
-    }
+    Unused << CubebUtils::GetCubebContext();
   }
 
   if (sandboxEnabled) {
     sandboxEnabled = SetContentProcessSandbox(
         ContentProcessSandboxParams::ForThisProcess(aBroker));
   }
 #  elif defined(XP_WIN)
   mozilla::SandboxTarget::Instance()->StartSandbox();