If you use the nightly Rust toolchain, please be aware the current nightly has a bug that can cause Cargo to enter an infinite loop, causing the build either to hang forever or to eventually get killed for using up all of the system's memory. This should be fixed in the next nightly build:
opened 05:20AM - 28 Jan 20 UTC
closed 08:17AM - 30 Jan 20 UTC
C-bug
P-high
Cargo is randomly entering an infinite loop in some rare cases. Noticed in CI:
…
* https://github.com/rust-lang/cargo/pull/7836#issuecomment-578529146 — [azure](https://dev.azure.com/rust-lang/cargo/_build/results?buildId=19415&view=logs&jobId=a5e52b91-c83f-5429-4a68-c246fc63a4f7&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=d4864165-4be3-5e34-b483-a6b05303aa68)
* https://github.com/rust-lang/rust/pull/68580#issuecomment-578996407 — [azure](https://dev.azure.com/rust-lang/rust/_build/results?buildId=19498&view=logs&j=34a2f069-38a6-567f-c087-79a147504c7a&t=bc5564b7-719c-565b-a0f0-03fa5ba953c5)
I've been able to reproduce it locally by putting Cargo's own test suite into a loop (`while cargo test; do :; done` after about 30 minutes on my machine). It seems to randomly affect different tests. Attaching with a debugger, I see it caught in [this loop](https://github.com/rust-lang/rust/blame/08594515926df9b23b912628d9f8c814a30edcb7/src/libstd/sync/mpsc/shared.rs#L390-L405), where dropping an mpsc receiver seems to be confused.
I strongly suspect this is caused by some change in #7731. Perhaps there is some odd interaction between crossbeam's scope() and mpsc? The only relevant change that I see is that `DrainState` is now *moved* into the crossbeam scope, and thus dropped inside the scope, whereas previously the mpsc channels residing inside `JobQueue` were dropped much later.
@Mark-Simulacrum Are you very familiar with mpsc or crossbeam's scope? mpsc seems wildly complex, and I don't know where to start trying to figure out what's wrong.
I might try removing `FinishOnDrop` and see if I can repro again, as that seems a little fishy.
6 Likes
mbrubeck
Closed
April 27, 2020, 5:01pm
2
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.