rust-lang / rust-lang/rust

mgca: stack overflow

Open
#141,882 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug F-min_generic_const_args I-crash T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code
#![feature(min_generic_const_args)]

fn combinator<T, const S: usize>() -> [T; combinator] {}

fn main() {}
Meta

rustc --version --verbose:

rustc 1.89.0-nightly (99e7c15e8 2025-06-01)
binary: rustc
commit-hash: 99e7c15e81385b38a8186b51edc4577d5d7b5bdd
commit-date: 2025-06-01
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5
Backtrace

warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
 --> a.rs:1:12
  |
1 | #![feature(min_generic_const_args)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: rustc interrupted by SIGSEGV, printing backtrace

/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(+0x3c1dfff) [0x717a1ae1dfff]
/usr/lib/libc.so.6(+0x3def0) [0x717a1704def0]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvMs4_NtNtCsc3QC8KlvVjh_12rustc_middle2ty7contextNtB5_13CtxtInterners9intern_ty+0x11) [0x717a1c435ca1]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(+0x534ab88) [0x717a1c54ab88]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(+0x5385ca1) [0x717a1c585ca1]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x3851) [0x717a1cd3bbd5]

### cycle encountered after 6 frames with period 7
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
### recursed 35 times

/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsa00mjtcx9Fe_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsY8QKBXQKI2_13rustc_type_ir5visit11TypeVisitorNtNtNtCsc3QC8KlvVjh_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x386e) [0x717a1cd3bbf2]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
note: backtrace dumped due to SIGSEGV! resuming signal
[2]    3965178 segmentation fault  rustc a.rs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the minimal a.rs example with the reported nightly rustc and review the stack-overflow backtrace, especially the min_generic_const_args feature and well-formedness checking frames. The issue is resolved when this input no longer overflows the compiler stack or segfaults, with behavior covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.