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
This commit is contained in:
Peter Collingbourne 2025-07-14 18:48:11 -07:00
parent 14dc3e3d5f
commit 1ddb909a42

View File

@ -165,4 +165,13 @@ def main():
if __name__ == "__main__":
exit(main())
rc = main()
# If the remote process died with a signal, this will be exposed by ssh as
# an exit code in this range. 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.
if rc > 128 and rc < 160:
os.kill(os.getpid(), rc - 128)
exit(rc)