Skip to content

1.95 beta regression: stack overflow inside parser #153854

Open

Description

@theemathas

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

Activity

  1. added
    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
    A-parserArea: The lexing & parsing of Rust source code to an AST
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Mar 14, 2026
  2. 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 Mar 14, 2026
  3. jieyouxu commented on Mar 14, 2026

    @jieyouxu
    Member

    This one I suspect is probably a case of just-over-recursion-threshold

  4. theemathas commented on Mar 14, 2026

    @theemathas
    ContributorAuthor

    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.

  5. added
    S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.
    and removed
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Mar 14, 2026
  6. 7 remaining items

  7. theemathas commented on Mar 14, 2026

    @theemathas
    ContributorAuthor

    Given that this also had a similar stack overflow in the rustdoc crater run for rmk-types itself 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.

  8. removed
    S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.
    on Mar 14, 2026
  9. JayanAXHF commented on Mar 14, 2026

    @JayanAXHF
    Member

    @jieyouxu I can reliably reproduce the stack overflow on my computer by adding rmk-types as a dependency of an otherwise empty crate.

    Never mind. I got the same stack overflow on stable.

    @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)?

  10. theemathas commented on Mar 14, 2026

    @theemathas
    ContributorAuthor

    @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.

  11. added this to the 1.95.0 milestone on Mar 17, 2026
  12. apiraino commented on May 7, 2026

    @apiraino
    Contributor

    I can always reproduce on stable (on Linux) by just running cargo check on an empty rust project and importing the rmk-types crate. 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

  13. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on May 11, 2026
  14. rustbot commented on May 11, 2026

    @rustbot
    Collaborator

    Assigning P-medium (discussion on Zulip).

  15. scgtrp commented on Jun 23, 2026

    @scgtrp

    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:

    • It seems to specifically be triggered by #[derive(postcard::experimental::max_size::MaxSize)] (source) on a large enum.
    • I can reproduce outside of rmk-types by extracting the KeyCode enum (source) from rmk-types and throwing it in main.rs of an empty project (with cargo add postcard -F experimental-derive) with just that one attribute on it.
    • 1.95 stable crashes. 1.94 stable works with the enum as written in 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).
  16. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    on Jun 23, 2026
  17. added
    regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.
    and removed on Jul 3, 2026
  18. workingjubilee commented on Jul 7, 2026

    @workingjubilee
    Member

    the postcard case is tracked as jamesmunns/postcard#286

  19. workingjubilee commented on Jul 7, 2026

    @workingjubilee
    Member

    an improvement PR is at jamesmunns/postcard#299

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

    A-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.E-needs-bisectionCall 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.P-mediumMedium priorityS-has-mcveStatus: 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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions