Repository navigation
1.95 beta regression: stack overflow inside parser #153854
Copy link
Copy link
Open
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-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-mediumMedium priorityMedium 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-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Description
Regression found by the 1.95 beta crater run.
[INFO] [stderr] error: rustc interrupted by SIGSEGV, printing backtrace
[INFO] [stderr]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x3b6096c)[0x7aeebb56096c]
[INFO] [stderr] /lib/x86_64-linux-gnu/libc.so.6(+0x45330)[0x7aeeb7833330]
[INFO] [stderr] /lib/x86_64-linux-gnu/libc.so.6(pthread_mutex_trylock+0xc)[0x7aeeb788eefc]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/bin/rustc(+0x24d7f)[0x6307552fbd7f]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/bin/rustc(+0x14b54)[0x6307552ebb54]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x5480d10)[0x7aeebce80d10]
[INFO] [stderr]
[INFO] [stderr] ### cycle encountered after 6 frames with period 10
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(_RNvMNtNtCs1gAZ6foNq5q_11rustc_parse6parser4exprNtB4_6Parser21parse_expr_assoc_with+0x45)[0x7aeebce79d85]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x54261b0)[0x7aeebce261b0]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(_RNvMNtNtCs1gAZ6foNq5q_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0xd46)[0x7aeebce3ac5e]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x5442772)[0x7aeebce42772]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x5481149)[0x7aeebce81149]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(_RNvMNtNtCs1gAZ6foNq5q_11rustc_parse6parser4exprNtB4_6Parser21parse_expr_assoc_with+0x45)[0x7aeebce79d85]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x54261b0)[0x7aeebce261b0]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(_RNvMNtNtCs1gAZ6foNq5q_11rustc_parse6parser4stmtNtB4_6Parser27parse_stmt_without_recovery+0xd46)[0x7aeebce3ac5e]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x5442772)[0x7aeebce42772]
[INFO] [stderr] /opt/rustwide/rustup-home/toolchains/1.95.0-beta.3-x86_64-unknown-linux-gnu/lib/librustc_driver-c1a4ee0be8fb5b4c.so(+0x5481149)[0x7aeebce81149]
[INFO] [stderr] ### recursed 25 times
[INFO] [stderr]
[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] note: backtrace dumped due to SIGSEGV! resuming signal
[INFO] [stderr] error: could not compile `rmk-types` (lib)
https://crater-reports.s3.amazonaws.com/beta-1.95-3/1.95.0-beta.3/reg/rmk-types-0.2.2/log.txt
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-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-mediumMedium priorityMedium 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-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Activity
jieyouxu commentedon Mar 14, 2026
This one I suspect is probably a case of just-over-recursion-threshold
theemathas commentedon Mar 14, 2026
Notably, zenpzero on the community discord has previously reported seeing a similar crash on stable rust with a small program on the playground. Nobody else was able to reproduce the crash. We were guessing that it was probably a playground cacheing thing.
7 remaining items
theemathas commentedon Mar 14, 2026
Given that this also had a similar stack overflow in the rustdoc crater run for
rmk-typesitself and two of its dependents, I would say that the regression reproduces consistently enough in crater's environment.Given that the compiler also crashed on my computer (windows) on stable, that would support the theory that something went just above the stack limit in the beta version of rustc.
JayanAXHF commentedon Mar 14, 2026
@theemaths Can you post a mcve? I can try to get a bisection going if its needed. Or is it exactly like what you wrote (literally just an empty crate)?
theemathas commentedon Mar 14, 2026
@JayanAXHF Yes. Just an empty crate with a dependency. I just compiled it on windows, which I've heard has a smaller stack than linux.
apiraino commentedon May 7, 2026
I can always reproduce on stable (on Linux) by just running
cargo checkon an empty rust project and importing thermk-typescrate. So I have a attempted a bisection but I am unsure which one commit could be.In any case, it seems this could be a stable regression (as @theemathas pointed out).
Regression in nightly-2025-10-28
get_commits_between returning commits, len: 7
commit[0] 2025-10-26: Auto merge of #147890 - tmiasko:deduce-captures-none, r=cjgillot
commit[1] 2025-10-26: Auto merge of #147914 - petrochenkov:oosmc-used, r=fmease
commit[2] 2025-10-27: Auto merge of #146069 - camsteffen:range-desugar-span, r=SparrowLii
commit[3] 2025-10-27: Auto merge of #148163 - lnicola:sync-from-ra, r=lnicola
commit[4] 2025-10-27: Auto merge of #148040 - saethlin:trivial-consts, r=oli-obk
commit[5] 2025-10-27: Auto merge of #148167 - Zalathar:rollup-njf167h, r=Zalathar
commit[6] 2025-10-27: Auto merge of #148035 - bjorn3:check_skip_codegen_crate, r=madsmtm
ERROR: no CI builds available between f37aa99 and adaa838 within last 167 days
rustbot commentedon May 11, 2026
Assigning P-medium (discussion on Zulip).
scgtrp commentedon Jun 23, 2026
Hi, I just ran into this and spent some time whittling down a minimal repro case before seeing it had already been reported. Results, in case this saves someone a few minutes:
#[derive(postcard::experimental::max_size::MaxSize)](source) on a large enum.rmk-typesby extracting theKeyCodeenum (source) fromrmk-typesand throwing it inmain.rsof an empty project (withcargo add postcard -F experimental-derive) with just that one attribute on it.rmk-types, but crashes in the same way if I add another 100 values to the enum (so yeah, seems like it was just under the threshold before).workingjubilee commentedon Jul 7, 2026
the postcard case is tracked as jamesmunns/postcard#286
workingjubilee commentedon Jul 7, 2026
an improvement PR is at jamesmunns/postcard#299