Skip to content

Commit 1ddb909

Browse files
committed
remote-exec: Detect and propagate signal death in the remote process.
If the remote process died with a signal, this will be exposed by ssh as an exit code in the range 128 < rc < 160. We may be running under `not --crash` which will expect us to also die with a signal, so send the signal to ourselves so that wait4() in `not` will detect the signal. Speculative fix for failing buildbot: https://lab.llvm.org/buildbot/#/builders/193/builds/9070
1 parent 14dc3e3 commit 1ddb909

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

llvm/utils/remote-exec.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,13 @@ def main():
165165

166166

167167
if __name__ == "__main__":
168-
exit(main())
168+
rc = main()
169+
170+
# If the remote process died with a signal, this will be exposed by ssh as
171+
# an exit code in this range. We may be running under `not --crash` which
172+
# will expect us to also die with a signal, so send the signal to ourselves
173+
# so that wait4() in `not` will detect the signal.
174+
if rc > 128 and rc < 160:
175+
os.kill(os.getpid(), rc - 128)
176+
177+
exit(rc)

0 commit comments

Comments
 (0)