Skip to content

Cargo is entering an infinite loop #7840

Closed
@ehuss

Description

@ehuss

Cargo is randomly entering an infinite loop in some rare cases. Noticed in CI:

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, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugP-highPriority: High

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions