Commit fde604a7 authored by robliao@chromium.org's avatar robliao@chromium.org

Revert of Revert "Revert of Telemetry: Last ditch effort to dump symbols on...

Revert of Revert "Revert of Telemetry: Last ditch effort to dump symbols on tab crashes if none are found (ht… (https://codereview.chromium.org/444453002/)

Reason for revert:
Macbots are getting stuck here:
[       OK ] page_runner_unittest.PageRunnerTests.testDiscardFirstResult (10464 ms)
[ RUN      ] page_runner_unittest.PageRunnerTests.testHandlingOfCrashedTab
[ RUN      ] chrome://crash

http://build.chromium.org/p/chromium.mac/waterfall?builder=Mac10.6%20Tests%20(3)
http://build.chromium.org/p/chromium.mac/waterfall?builder=Mac10.7%20Tests%20(3)

Original issue's description:
> Revert "Revert of Telemetry: Last ditch effort to dump symbols on tab crashes if none are found (https://codereview.chromium.org/318123002/)"
> 
> This reverts https://codereview.chromium.org/320693002/
> 
> The original regression this caused (PageRunnerTests.testHandlingOfCrashedTab in telemetry_unittests) does not seem to be happening anymore (locally or on trybots), but please revert and let me know if it happens on the main waterfall.
> 
> TBR=tonyg,dtu
> BUG=
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287612

TBR=tonyg@chromium.org,dtu@chromium.org,oysteine@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/446743002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287652 0039d316-1c4b-4281-b951-d872f2087c98
parent 8aca9332
......@@ -269,47 +269,31 @@ class DesktopBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
logging.warning('minidump_stackwalk binary not found.')
return None
symbols = glob.glob(os.path.join(self._browser_directory, '*.breakpad*'))
if not symbols:
logging.warning('No breakpad symbols found.')
return None
with open(minidump, 'rb') as infile:
minidump += '.stripped'
with open(minidump, 'wb') as outfile:
outfile.write(''.join(infile.read().partition('MDMP')[1:]))
symbols_path = os.path.join(self._tmp_minidump_dir, 'symbols')
symbols = glob.glob(os.path.join(self._browser_directory, '*.breakpad*'))
if symbols:
for symbol in sorted(symbols, key=os.path.getmtime, reverse=True):
if not os.path.isfile(symbol):
for symbol in sorted(symbols, key=os.path.getmtime, reverse=True):
if not os.path.isfile(symbol):
continue
with open(symbol, 'r') as f:
fields = f.readline().split()
if not fields:
continue
with open(symbol, 'r') as f:
fields = f.readline().split()
if not fields:
continue
sha = fields[3]
binary = ' '.join(fields[4:])
symbol_path = os.path.join(symbols_path, binary, sha)
if os.path.exists(symbol_path):
continue
os.makedirs(symbol_path)
shutil.copyfile(symbol, os.path.join(symbol_path, binary + '.sym'))
else:
logging.info('Dumping breakpad symbols')
generate_breakpad_symbols_path = os.path.join(
util.GetChromiumSrcDir(), "components", "breakpad",
"tools", "generate_breakpad_symbols.py")
cmd = [
sys.executable,
generate_breakpad_symbols_path,
'--binary=%s' % self._executable,
'--symbols-dir=%s' % symbols_path,
'--build-dir=%s' % self._browser_directory,
]
try:
subprocess.check_output(cmd, stderr=open(os.devnull, 'w'))
except subprocess.CalledProcessError:
logging.warning('Failed to execute "%s"' % ' '.join(cmd))
return None
sha = fields[3]
binary = ' '.join(fields[4:])
symbol_path = os.path.join(symbols_path, binary, sha)
if os.path.exists(symbol_path):
continue
os.makedirs(symbol_path)
shutil.copyfile(symbol, os.path.join(symbol_path, binary + '.sym'))
return subprocess.check_output([stackwalk, minidump, symbols_path],
stderr=open(os.devnull, 'w'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment