Skip to content

Stack overflow on large doctests in edition 2024 on Windows #138248

Closed
@ehuss

Description

@ehuss

Over in #138162 I am trying to update the standard library to Rust 2024. I'm running into a problem where core's doctests are failing on x86_64-pc-windows-msvc.

The behavior is:

  1. Rustdoc prints thread 'main' has overflowed its stack
  2. It then starts running the tests: running 1672 tests
  3. After they are all done, it prints test result: ok. 1671 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 109.68s
  4. After all the tests complete, it exits 101.

From what I can tell, there is a const TESTS: [test::TestDescAndFn; 3641] array in the combined test code. When calling test::test_main, it fails somewhere in there. I'm struggling a bit figuring out a good way to debug exactly where the stack is overflowing.

There are a few issues here:

  1. Obviously it shouldn't overflow its stack.
  2. The "has overflowed its stack" message has no context, and doesn't explain where it is coming from (it is coming from executing the combined suite, but for some reason I guess rustdoc continues to run the uncombined tests?).
  3. The error is at the beginning of the output, but there is no summary at the end to explain what has happened (like the normal test runner would do if an individual test would fail). In fact, it prints a summary that says "everything was okay" when it was not.

I haven't put together an isolated repro. I wonder if just creating something with 4,000 doctests would suffice? So far, I've been using --persist-doctests to get a copy of core's combined suite, and then running rustc directly on that.

cc @notriddle @GuillaumeGomez

Metadata

Metadata

Assignees

Labels

A-doctestsArea: Documentation tests, run by rustdocA-edition-2024Area: The 2024 editionC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions