Skip to content

Commit 4b1d1eb

Browse files
authored
donate_cpu_lib.py: fixed potential hang in timeout handling (#3155)
1 parent fef956f commit 4b1d1eb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tools/donate_cpu_lib.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
1717
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
1818
# changes)
19-
CLIENT_VERSION = "1.3.9"
19+
CLIENT_VERSION = "1.3.10"
2020

2121
# Timeout for analysis with Cppcheck in seconds
2222
CPPCHECK_TIMEOUT = 30 * 60
@@ -269,7 +269,11 @@ def run_command(cmd):
269269
if len(child_procs) > 0:
270270
for child in child_procs:
271271
child.terminate()
272-
comm = p.communicate()
272+
try:
273+
# call with timeout since it might get stuck e.g. gcc-arm-none-eabi
274+
comm = p.communicate(timeout=5)
275+
except subprocess.TimeoutExpired:
276+
pass
273277
p = None
274278
finally:
275279
if p:

0 commit comments

Comments
 (0)