Skip to content

cargo doc freezes on libc with nightly-2026-08-03 #160439

Description

@LusterSourav

View all comments

Starting on the nightly build from August 3rd, 2026, cargo doc has been freezing when trying to build documentation for large projects.

To see this happen, try running cargo +nightly-2026-08-03 doc --workspace --no-deps on a project like rust-lang/libc. This is especially noticeable if the project has a lot of items that are re-exported or modules marked with #[doc(hidden)].

It should finish without issues, just like it did on the nightly build from August 2nd. Instead, the rustdoc/rustc process gets stuck, uses a ton of CPU and memory, and is eventually killed after about 3.5 minutes with a SIGTERM signal (exit code 143). This problem is also causing the libc continuous integration tests to fail: https://github.com/rust-lang/libc/actions/runs/30800111327/job/91642485751

The documentation build worked fine with:
nightly-2026-08-02 (1.99.0-nightly, commit 73dc916)

The issue started with:
rustc --version --verbose: rustc 1.99.0-nightly (11177f2 2026-08-02)

I can't provide a backtrace because the process just hangs; it doesn't crash.

I suspect the problem might be related to pull request #159881. This change modified how the visible_parent_map uses a Breadth-First Search (BFS) to go into children of #[doc(hidden)] modules. However, it seems fallback items are never marked as "visited." This means they get added back into the queue from every parent path, causing a huge increase in processing, especially with libc's module structure. I confirmed this by looking at the nightly build manifests:

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 3, 2026
  2. LusterSourav commented on Aug 3, 2026

    @LusterSourav
    Author

    @rustbot claim

  3. LusterSourav commented on Aug 3, 2026

    @LusterSourav
    Author
  4. LusterSourav commented on Aug 3, 2026

    @LusterSourav
    Author

    I've got a fix ready for that visible_parent_map BFS hang. Should I just do a quick check, which should take about 20 minutes and doesn't need a full build, or would you rather I do a full stage1 build and run the #159881 UI suite and libc repro? That would take about 1 to 3 hours. Also, should I include a stress test with the fix?

  5. tgross35 commented on Aug 3, 2026

    @tgross35
    Member

    @zalanlevai @fee1-dead it looks like #159881 broke documenting libc and presumably others. If there isn't a quick fix, would we be able to revert it for now?

  6. tgross35 commented on Aug 3, 2026

    @tgross35
    Member

    Also @LusterSourav #160439 (comment) is pretty confusing. Always copy+paste code rather than using screenshots, wrap it in ``` ... ```, and there's no need to show the rustup commands or run via python (rustc -Vv then running the command directly is fine)

  7. LusterSourav commented on Aug 3, 2026

    @LusterSourav
    Author

    Also @LusterSourav #160439 (comment) is pretty confusing. Always copy+paste code rather than using screenshots, wrap it in ``` ... ```, and there's no need to show the rustup commands or run via python (rustc -Vv then running the command directly is fine)

    okee

  8. zalanlevai commented on Aug 3, 2026

    @zalanlevai
    Contributor

    If there isn't a quick fix, would we be able to revert it for now?

    @tgross35 I think I could get a quick fix together for this within the next couple of hours.

  9. LusterSourav commented on Aug 3, 2026

    @LusterSourav
    Author

    If there isn't a quick fix, would we be able to revert it for now?

    @tgross35 I think I could get a quick fix together for this within the next couple of hours.

    already fixed

  10. LusterSourav commented on Aug 3, 2026

    @LusterSourav
    Author

    I've got a fix ready for that visible_parent_map BFS hang. Should I just do a quick check, which should take about 20 minutes and doesn't need a full build, or would you rather I do a full stage1 build and run the #159881 UI suite and libc repro? That would take about 1 to 3 hours. Also, should I include a stress test with the fix?

    just want to ask...

  11. tgross35 commented on Aug 3, 2026

    @tgross35
    Member

    Just put up a PR that will run it for you? A test case that reproduces the issue would be great to have, yes

  12. 37 remaining items

  13. added a commit that references this issue on Aug 6, 2026
  14. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions