Skip to content

1.98 beta regression: compiler stack overflow #160685

Closed

Description

@theemathas

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.

Activity

  1. added
    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
    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 Aug 7, 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 Aug 7, 2026
  3. theemathas commented on Aug 7, 2026

    @theemathas
    ContributorAuthor

    Oh, it also reproduces with cargo +beta check on a crate with reflect_tools = "0.4.0" as its only dependency.

  4. changed the title [-]1.98 beta regression: compiler stack overflow with `--release`[/-] [+]1.98 beta regression: compiler stack overflow[/+] on Aug 7, 2026
  5. theemathas commented on Aug 7, 2026

    @theemathas
    ContributorAuthor

    Minimized reproducer:

    pub mod axiomatic {
        use super::*; // not pub
        pub use own::*;
    
        pub mod own {
            pub use super::*;
            pub use orphan::*;
        }
    
        pub mod orphan {
            pub use super::private::CollectionDescriptor;
        }
    
        pub mod private {
            pub struct CollectionDescriptor;
        }
    }
    
    pub use axiomatic::orphan::*;

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

  6. added
    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    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 Aug 7, 2026
  7. theemathas commented on Aug 7, 2026

    @theemathas
    ContributorAuthor

    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.

  8. theemathas commented on Aug 7, 2026

    @theemathas
    ContributorAuthor

    Stack trace on MacOS:

    error: rustc interrupted by SIGBUS, printing backtrace
    
    0   librustc_driver-01842c09d75be324.dy 0x00000001065c6fdc _RNvNtCslPNyqe8Oa6D_17rustc_driver_impl14signal_handler17print_stack_trace + 140
    1   libsystem_platform.dylib            0x00000001820eb744 _sigtramp + 56
    2   librustc_driver-01842c09d75be324.dy 0x0000000107edd88c _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 3348
    3   librustc_driver-01842c09d75be324.dy 0x0000000107edd88c _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 3348
    
    ### cycle encountered after 4 frames with period 5
    0   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    1   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    2   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    3   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    4   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    ### recursed 50 times
    
    0   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    1   librustc_driver-01842c09d75be324.dy 0x0000000107edd704 _RNvMs0_NtCs5QQ3wBA2Bg1_13rustc_resolve22effective_visibilitiesNtB5_28EffectiveVisibilitiesVisitor17update_decl_chain + 2956
    
    note: maximum backtrace depth reached, frames may have been lost
    note: we would appreciate a report at https://github.com/rust-lang/rust
    error: could not compile `reflect_tools` (lib)
    

    Seems like an infinite recursion at

    fn update_decl_chain(&mut self, mut decl: Decl<'ra>, mut parent_id: ParentId<'ra>) {

    This function was last touched in #159039, so I'm guessing it probably regressed there. cc @calvinrp (author of that PR)

  9. theemathas commented on Aug 7, 2026

    @theemathas
    ContributorAuthor

    Someone else did the bisection of the reflect_tools crate 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:

    cargo bisect-rustc --start=1.97.0 -- check 

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

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

    @rustbot
    Collaborator

    Assigning P-high (discussion on Zulip).

  12. apiraino commented on Aug 12, 2026

    @apiraino
    Contributor

    also cc @calvinrp since author of #159039

  13. calvinrp commented on Aug 12, 2026

    @calvinrp
    Contributor

    I submitted #159039. I think I might root cause identified. I'll see if I can come up with a solution.

  14. added this to the 1.98.0 milestone on Aug 14, 2026
  15. added a commit that references this issue on Aug 18, 2026
    5868ef5
  16. added a commit that references this issue on Aug 18, 2026
    bdc5bbf
  17. added a commit that references this issue on Aug 19, 2026
    7fae79c
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-resolveArea: Name/path resolution done by `rustc_resolve` specificallyA-visibilityArea: Visibility / privacyC-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-highHigh 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-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions