-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICEs caused by new fcntl
call in jobserver dependency on Linux
#88091
Comments
The small crater run we just did here ran into a large number of errors due to this. @alexcrichton What do you think about temporarily reverting the jobserver change until we have a better handle on how to approach this issue? |
Oh dear, thanks for cc'ing me on this! For some background, the motivation for this change to the Now as for solving this bug, I think there's a few possible routes:
I had most of this comment written up before I saw the crater report, but I think that for now I'll revert this and we can just deal with it later if we really need to. |
this isn't quite right. the pipe fix was backported back to 4.4 (the earliest kernel still supported upstream), so you need only upgrade to the latest kernel on your branch, which you should do anyways (see gkh "All users must upgrade"). |
this is probably a good idea. pipes are much slower than shm futexes; the only reason to use pipes as semaphores is to maintain compatibility with GNU make or with platforms that don't support shared semaphores. |
Yeah if it's showing up in crater then my assumption about being limited to use outside of cargo might have been incorrect. Appreciate the revert, I also filed #88117 as a possible follow-up that might remove this scaling factor entirely. EDIT: jinx! |
We're currently unable to update Fuchsia's toolchain to the latest nightly with builds failing due to this ICE:
We think that this error is occurring on our builders due to many concurrent instances of
rustc
exhausting/proc/sys/fs/pipe-user-pages-soft
which limits the number of pipe pages a user is allowed to have:It seems that the failure started with e62cd40 which updated the cargo subtree, causing the jobserver dependency for rustc to update to
0.1.23
. That release contains rust-lang/jobserver-rs#34 by @alexcrichton which on Linux attempts to reserve necessary space in the pipe forClient::new
, returning anio::Error
for client creation if that reservation fails.When accessing the jobserver for internal concurrency control, by default
rustc
attempts to read the path to a pipe from an environment variable. If no jobserver has been configured, it creates its own pipe via the jobserver crate where the newfcntl
call was added.This fallback is likely never exercised in builds driven by
cargo
ormake
because they both provide a jobserver to their subprocesses. On Fuchsia, we invokerustc
usingninja
, which does not support the jobserver protocol, so every instance ofrustc
ends up creating its own pipe. I think based on reading the code that each "fallback pipe" needs the default 2 pages, so we'd be able to run 512rustc
s if no other processes for the user were creating pipes. In practice our build machines are quite large and they also run some other processes which create pipes, so we seem to be able to hit this limit pretty often.We're considering workarounds including a static limit on concurrent
rustc
invocations in our build or implementing the jobserver protocol ourselves somehow, but it does seem like it should be possible to invokerustc
concurrently many times without make's protocol. Both of these solutions would come with significant downsides, though.Is it possible for
rustc
to work without access to a jobserver client? Could the fallback case be made to use an in-process stub instead of creating an actual jobserver client?Alternatively, it seems that even though the pipe resizing is failing that the pipe creation itself has not been previously failing in our build. Perhaps we could find a way for
rustc
to ignore the error from the resizing since it only ever asks for space to schedule32
tasks in the fallback configuration?These are the options that came up in a brief internal discussion but other ideas would be welcome!
cc @tmandry @jamuraa
The text was updated successfully, but these errors were encountered: