Bug 951431 - Don't get stacks during profiler runs on Linux. r=BenWa, a=lsblakk
authorJim Chen <nchen@mozilla.com>
Tue, 14 Jan 2014 10:33:32 -0600
changeset 175810 36dfb491674debf9dcc443fb8f01e0cb4992acea
parent 175809 73f3ce609c233a063b355d949a3fa02658df7c9b
child 175811 b936a1b706ee52630e291e16a8f6a5362981d8c9
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa, lsblakk
bugs951431
milestone28.0a2
Bug 951431 - Don't get stacks during profiler runs on Linux. r=BenWa, a=lsblakk
xpcom/threads/ThreadStackHelper.cpp
--- a/xpcom/threads/ThreadStackHelper.cpp
+++ b/xpcom/threads/ThreadStackHelper.cpp
@@ -84,16 +84,20 @@ ThreadStackHelper::GetStack(Stack& aStac
 {
   // Always run PrepareStackBuffer first to clear aStack
   if (!PrepareStackBuffer(aStack)) {
     // Skip and return empty aStack
     return;
   }
 
 #if defined(XP_LINUX)
+  if (profiler_is_active()) {
+    // Profiler can interfere with our Linux signal handling
+    return;
+  }
   if (!sInitialized) {
     MOZ_ASSERT(false);
     return;
   }
   sCurrent = this;
   struct sigaction sigact = {};
   sigact.sa_sigaction = SigAction;
   sigemptyset(&sigact.sa_mask);