Skip to content

Commit

Permalink
Bug 1602717 - Re-enable stackwalking on local macOS builds. r=erahm
Browse files Browse the repository at this point in the history
Now that `fix_stacks.py` is being used instead of `fix_macosx_stack.py`,
stack-fixing time has dropped from about 14 minutes to about 30 seconds on my
new MacBook Pro.

Also, print a warning about stacks not being fixed if `MOZ_DISABLE_STACK_FIX`
is set. This warning shows up at the start of the test run.

Also, print a warning about stack fixing slowness, because 30 seconds is long
enough to possibly be surprising. This warning shows up just before the first
stack frame is fixed, like this:
```
Assertion failure: false (BEEP BOOP), at /home/njn/moz/au3/dom/base/nsGlobalWindowOuter.cpp:1342
Initializing stack-fixing for the first stack frame, this may take a while...
#1: nsGlobalWindowOuter::nsGlobalWindowOuter(unsigned long) (/home/njn/moz/au3/dom/base/nsGlobalWindowOuter.cpp:1342)
#2: ...
```

Differential Revision: https://phabricator.services.mozilla.com/D65676

UltraBlame original commit: 9d6c366e7cde369c65ddb85b258dbacbf396e65e
  • Loading branch information
marco-c committed Mar 13, 2020
1 parent 4a51509 commit 30b9e4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions testing/mozbase/mozrunner/mozrunner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ def get_stack_fixer_function(utilityPath, symbolsPath):
return None

if os.getenv('MOZ_DISABLE_STACK_FIX', 0):
return None

if mozinfo.isMac and not mozinfo.automation:
print("WARNING: No stack-fixing will occur because MOZ_DISABLE_STACK_FIX is set")
return None

def import_stack_fixer_module(module_name):
Expand All @@ -265,7 +263,7 @@ def stack_fixer_function(line):
stack_fixer_module = import_stack_fixer_module('fix_stacks')

def stack_fixer_function(line):
return stack_fixer_module.fixSymbols(line)
return stack_fixer_module.fixSymbols(line, slowWarning=True)

else:
return None
Expand Down
7 changes: 5 additions & 2 deletions tools/rb/fix_stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@



from __future__ import absolute_import
from __future__ import absolute_import, print_function
from subprocess import Popen, PIPE
import os
import platform
Expand All @@ -21,7 +21,7 @@
fix_stacks = None


def fixSymbols(line, jsonMode=False):
def fixSymbols(line, jsonMode=False, slowWarning=False):
global fix_stacks

result = line_re.search(line)
Expand Down Expand Up @@ -52,6 +52,9 @@ def fixSymbols(line, jsonMode=False):

fix_stacks = Popen(args, stdin=PIPE, stdout=PIPE, stderr=None)

if slowWarning:
print("Initializing stack-fixing for the first stack frame, this may take a while...")




Expand Down

0 comments on commit 30b9e4f

Please sign in to comment.