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

rustdoc overflows stack on latest nightly #59502

Closed
benesch opened this issue Mar 28, 2019 · 9 comments
Closed

rustdoc overflows stack on latest nightly #59502

benesch opened this issue Mar 28, 2019 · 9 comments
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@benesch
Copy link
Contributor

benesch commented Mar 28, 2019

To reproduce:

$ git clone git@github.com:rust-num/num-traits.git
# Check out a known bad commit, just in case.
$ git checkout 8915b74ae4f4fe42fae329852a2e24934c0623d5
$ cargo +nightly doc
thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: Could not document `num-traits`.

Caused by:
  process didn't exit successfully: `rustdoc --crate-name num_traits src/lib.rs --color always -o /Users/benesch/Sites/materialize/num-traits/target/doc --cfg 'feature="default"' --cfg 'feature="std"' -L dependency=/Users/benesch/Sites/materialize/num-traits/target/debug/deps --cfg has_i128` (signal: 6, SIGABRT: process abort signal)

Rustdoc version:

rustdoc 1.35.0-nightly (33ef0bad2 2019-03-27)

I can reproduce on both macOS and Linux. Let me know if there's anything else I can provide!

@jonas-schievink jonas-schievink added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. labels Mar 28, 2019
@akinnane
Copy link

I'm getting the same error on Linux using the same rustdoc version.

@jonas-schievink
Copy link
Contributor

Can you try obtaining a backtrace with gdb or lldb?

@eddyb
Copy link
Member

eddyb commented Mar 28, 2019

Someone on IRC got this in a backtrace:

get_real_types () at src/librustdoc/clean/mod.rs:1820

I'm trying to do a review of #59004, I suspect it needs a bit more work to be robust.

@GuillaumeGomez
Copy link
Member

@eddyb I let you take care of it?

@eddyb
Copy link
Member

eddyb commented Mar 29, 2019

@GuillaumeGomez @QuietMisdreavus Can you revert #59004 entirely until I have the time to look into another minor refactor of rustdoc? It might be a few days (and that if I don't forget about it).

Or at least comment out the calls to the recursive functions that cause the stack overflow.

@GuillaumeGomez
Copy link
Member

Sure.

@GuillaumeGomez
Copy link
Member

I sent a PR and answered a few of your questions. The main point of what I added was to generate a list of names, not of types. Therefore, I don't care if I have two types with the same name. It doesn't matter. :)

@Alexendoo
Copy link
Member

Fixed by #59539

camelid added a commit to camelid/rust that referenced this issue Dec 28, 2021
This issue was fixed using a hacky recursion "fuel" argument, but the
issue was never minimized nor was a regression test added. The
underlying bug is still unfixed, so this test should help with fixing it
and removing the `recurse` hack.
@camelid
Copy link
Member

camelid commented Jan 4, 2022

Note: I have added a regression test for this issue (none was originally added), in 908a9d4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants