Closed
Description
cargo
and rustc
(and other tools using jobserver
) will fail with a "failed to acquire jobserver token: early EOF on jobserver pipe" error in the next scenario reported in rust-lang/rust#46981 (comment) as ICE in rustc
:
make
executes a subprocess (e.g. shell) with the jobserver pipe closed (marked withFD_CLOEXEC
), but theMAKEFLAGS
env var will still contain--jobserver-auth=3,4
(or some other pair of integers) in the subprocess.
This is wheremake
is wrong, if it closes the descriptors for a subprocess, then it should probably clean upMAKEFLAGS
for it as well, but it doesn't, so we have to live withmake
possibly providing garbage descriptors.- the subprocess (e.g. shell) opens some files so descriptors
3
and4
are taken again now, but refer to entirely unrelated files. - the shell runs
cargo
, which sees that3
and4
are open, concludes that they refer to a jobserver, and fails when trying to read from them.
jobserver
could be more resilient in the face of garbage descriptors if it checked not only that the descriptors are valid, but also that they actually refer to a pipe rather than random unrelated files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels