Skip to content
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

Cargo hangs with no output, consuming 100% CPU #4833

Closed
uranusjr opened this issue Dec 18, 2017 · 8 comments
Closed

Cargo hangs with no output, consuming 100% CPU #4833

uranusjr opened this issue Dec 18, 2017 · 8 comments

Comments

@uranusjr
Copy link

uranusjr commented Dec 18, 2017

Fresh installation with rustup-init (rustup 1.7.0) on macOS High Sierra.

Any invocation of cargo results in a hang with 100% CPU, and I can’t get any output either with RUST_LOG=debug or --verbose. It doesn’t fail, even if I give it gibberish arguments, but hangs until you ctrl-c. I have no idea what else I can provide; there is just… nothing. I suspect this is something wrong with my environment, but have no idea what on earth can be happening here.

@alexcrichton
Copy link
Member

Thanks for the report! Could you try out with nightly Cargo and see if it helps with logging? (some progress bars were added)

@uranusjr
Copy link
Author

Cargo from nightly works fine. It seems this is a consequence from rust-lang/rust#34674. That ticket has been closed for a while, and with nightly working fine I assume this is fixed, just unreleased to stable?

@alexcrichton
Copy link
Member

Ok! In that case I'm going to close.

Are you installing an older version of Rust? That bugfix should long be in stable at this point

@uranusjr
Copy link
Author

I did rustup uninstall self and install rustup + stable-x86_64-apple-darwin before reporting, so I’m fairly sure I was on the latest stable. But I have removed it so I guess there’s not way to find out… :(

@alexcrichton
Copy link
Member

@uranusjr in theory rustup should print out the version it's installing, did you see that on the console as rustup was downloading rustc?

@andrecp
Copy link

andrecp commented Oct 26, 2022

I have the exact same problem, it's impossible to get any output..

It just sits there forever.

ENV CARGO_HTTP_DEBUG=true
ENV CARGO_LOG=cargo::ops::registry=debug
RUN /root/.cargo/bin/cargo install dump_syms -j 10 --verbose --verbose

Doesn't show anything too weird. And the HTTP connection works fine.

This is from inside docker

@weihanglo
Copy link
Member

@andrecp
Which version of rust are you using (cargo -vV to show the info)? Could you try nightly to see if it still happens? A more detailed reproducible steps and environment information would be helpful!

@andrecp
Copy link

andrecp commented Oct 27, 2022

cargo -Vv
cargo 1.63.0 (fd9c4297c 2022-07-01)
release: 1.63.0
commit-hash: fd9c4297ccbee36d39e9a79067edab0b614edb5a
commit-date: 2022-07-01
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1n)
os: Ubuntu 22.04 (jammy) [64-bit]

It's happening inside a docker container.

I'm installing like below..

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN rm -rf  "$HOME/.cargo/.package-cache"
RUN rm -rf  "$HOME/.cargo/registry"

ENV CARGO_HTTP_DEBUG=true
ENV CARGO_LOG=cargo::ops::registry=debug
RUN /root/.cargo/bin/cargo install dump_syms -j 10 --verbose --verbose
RUN cp /root/.cargo/bin/dump_syms /usr/bin/

It feels like it gets stuck after github saying it's all good, but before doing anything else.

The trace looks something like

github get request
github replies

above happens a couple of times

5 minutes without anything happening
build starts

no errors

and thanks @weihanglo , perhaps it would be helpful if --verbose by itself gave a lot more information without having to play with CARGO_ envvars, which are a bit hard to find.

I can also see that when I don't run from a docker container I get an interactive bar [||| ] showing progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants