Repository navigation
1.98 beta regression: compiler stack overflow #160685
Copy link
Copy link
Closed
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Description
This regression was found by the 1.98 --release crater run in #159230
[INFO] [stderr] error: rustc interrupted by SIGSEGV, printing backtrace
[INFO] [stderr]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x3ab521c) [0x71125f0b521c]
[INFO] [stderr] /usr/lib/x86_64-linux-gnu/libc.so.6(+0x45cb0) [0x71125b424cb0]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x590d398) [0x711260f0d398]
[INFO] [stderr]
[INFO] [stderr] ### cycle encountered after 3 frames with period 4
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x590f21f) [0x711260f0f21f]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x590f21f) [0x711260f0f21f]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x590f21f) [0x711260f0f21f]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x590f21f) [0x711260f0f21f]
[INFO] [stderr] ### recursed 63 times
[INFO] [stderr]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.98.0-beta.6-x86_64-unknown-linux-gnu/lib/librustc_driver-b53851df8ed457aa.so(+0x590f21f) [0x711260f0f21f]
[INFO] [stderr]
[INFO] [stderr] note: rustc unexpectedly overflowed its stack! this is a bug
[INFO] [stderr] note: maximum backtrace depth reached, frames may have been lost
[INFO] [stderr] note: we would appreciate a report at https://github.com/rust-lang/rust
[INFO] [stderr] help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
[INFO] [stderr] error: could not compile `reflect_tools` (lib)
Reproducible with cargo +beta --release on a crate with reflect_tools = "0.4.0" as its only dependency.
Metadata
Metadata
Assignees
Labels
A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyArea: Visibility / privacyC-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
--releasefor 1.98 #159230theemathas commentedon Aug 7, 2026
Oh, it also reproduces with
cargo +beta checkon a crate withreflect_tools = "0.4.0"as its only dependency.[-]1.98 beta regression: compiler stack overflow with `--release`[/-][+]1.98 beta regression: compiler stack overflow[/+]theemathas commentedon Aug 7, 2026
Minimized reproducer:
cc @petrochenkov, since this seems like your kind of thing
(I'm currently having networking issues that's preventing me from doing bisection myself, so I'd appreciate someone else doing it.)
theemathas commentedon Aug 7, 2026
Note: The author of this crate is the same as the crate previously affected by #157406. This author appears to really like convoluted module setups.
theemathas commentedon Aug 7, 2026
Stack trace on MacOS:
Seems like an infinite recursion at
rust/compiler/rustc_resolve/src/effective_visibilities.rs
Line 140 in 65bcac4
This function was last touched in #159039, so I'm guessing it probably regressed there. cc @calvinrp (author of that PR)
theemathas commentedon Aug 7, 2026
Someone else did the bisection of the
reflect_toolscrate and got this output:searched nightlies: from nightly-2026-05-22 to nightly-2026-08-07
regressed nightly: nightly-2026-07-15
searched commit range: daf2e5e...da80ed0
regressed commit: da80ed0
bisected with cargo-bisect-rustc v0.6.11
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
(Edit: Bisecting the minimal reproducer pointed to the same PR.)
So, my guess that this regressed in #159039 seems correct. Note that this PR was backported to 1.98.0 in #159384.
rustbot commentedon Aug 11, 2026
Assigning P-high (discussion on Zulip).
apiraino commentedon Aug 12, 2026
also cc @calvinrp since author of #159039
calvinrp commentedon Aug 12, 2026
I submitted #159039. I think I might root cause identified. I'll see if I can come up with a solution.
Rollup merge of rust-lang#161024 - calvinrp:fix/pub-visibility, r=pet…
Unrolled build for #161024
Rollup merge of #161024 - calvinrp:fix/pub-visibility, r=petrochenkov