Commit d5a923d3 authored by Wez's avatar Wez Committed by Commit Bot

[fuchsia] Distinguish exit-by-signal from normal exit in runner scripts.

Negative |Popen.returncode| values indicate that the process was
terminated by a signal (e.g. SIGSEGV) under POSIX systems.

Check for -ve |returncode| values and report them with a different
message text, to make it clearer when things are crashing.

Change-Id: I84a3e30d5babea9d630347e10fbd5b21df5f0706
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213539
Auto-Submit: Wez <wez@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772028}
parent 4ae1ea63
...@@ -92,15 +92,18 @@ class EmuTarget(target.Target): ...@@ -92,15 +92,18 @@ class EmuTarget(target.Target):
logging.error('%s did not start' % (self._GetEmulatorName())) logging.error('%s did not start' % (self._GetEmulatorName()))
return return
returncode = self._emu_process.poll() returncode = self._emu_process.poll()
if returncode: if returncode == None:
logging.error('%s quit unexpectedly with exit code %d' % logging.info('Shutting down %s' % (self._GetEmulatorName()))
(self._GetEmulatorName(), returncode)) self._emu_process.kill()
elif returncode == 0: elif returncode == 0:
logging.info('%s quit unexpectedly without errors' % logging.info('%s quit unexpectedly without errors' %
self._GetEmulatorName()) self._GetEmulatorName())
elif returncode < 0:
logging.error('%s was terminated by signal %d' %
(self._GetEmulatorName(), -returncode))
else: else:
logging.info('Shutting down %s' % (self._GetEmulatorName())) logging.error('%s quit unexpectedly with exit code %d' %
self._emu_process.kill() (self._GetEmulatorName(), returncode))
def _IsEmuStillRunning(self): def _IsEmuStillRunning(self):
if not self._emu_process: if not self._emu_process:
......
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