diff --git a/build_tools/pexpect_helper.py b/build_tools/pexpect_helper.py index 68d14ba62..d8c705949 100644 --- a/build_tools/pexpect_helper.py +++ b/build_tools/pexpect_helper.py @@ -22,6 +22,7 @@ import re import sys import time import pexpect +from signal import Signals # Default timeout for failing to match. TIMEOUT_SECS = 5 @@ -246,8 +247,15 @@ class SpawnedProc(object): Report it to stdout, along with the offending call site. If 'unmatched' is set, print it to stdout. """ + # Close the process so we can get the status + self.spawn.close() colors = self.colors() failtype = pexpect_error_type(err) + # If we get an EOF, we check if the process exited with a signal. + # This shows us e.g. if it crashed + if failtype == 'EOF' and self.spawn.signalstatus != 0: + failtype = "SIGNAL " + Signals(self.spawn.signalstatus).name + fmtkeys = {"failtype": failtype, "pat": escape(pat)} fmtkeys.update(**colors)