Commit 9cdf0cc6 authored by Matthew Cary's avatar Matthew Cary Committed by Commit Bot

webkit_layout_test: Harden stack encoding

The stack returned from _get_stack_from_dump can be None. This hardens
against this case, and hopefully another other unforseen issues around
the stack encoding, by transforming the stack to ascii inside a try
block.

Bug: 880246
Change-Id: I498b5929dab811a2ccc5e69bb51b930c8547179c
TBR: dpranke@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/1218842
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590258}
parent dc72e09f
......@@ -790,10 +790,14 @@ class ChromiumAndroidDriver(driver.Driver):
crashes = self._pull_crash_dumps_from_device()
for crash in crashes:
stack = self._port._dump_reader._get_stack_from_dump(crash) # pylint: disable=protected-access
try:
stack_str = stack.encode('ascii', 'replace')
except Exception as e:
stack_str = '<No Stack> (%s)' % e
stderr += '********* [%s] breakpad minidump %s:\n%s' % (
self._port.host.filesystem.basename(crash),
self._device.serial,
stack.encode('ascii', 'replace'))
stack_str)
return super(ChromiumAndroidDriver, self)._get_crash_log(
stdout, stderr, newer_than)
......
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