Skip to content

stack overflow in trait selection #141772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
matthiaskrgr opened this issue May 30, 2025 · 2 comments
Open

stack overflow in trait selection #141772

matthiaskrgr opened this issue May 30, 2025 · 2 comments
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

fn foo() -> typeof(foo) {}

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (1bbd62e54 2025-05-29)
binary: rustc
commit-hash: 1bbd62e547ba5cc08ccb44c27def3d33195d2dd5
commit-date: 2025-05-29
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Error output

error[E0516]: `typeof` is a reserved keyword but unimplemented
 --> a.rs:1:13
  |
1 | fn foo() -> typeof(foo) {}
  |             ^^^^^^^^^^^ reserved keyword
Backtrace

error: rustc interrupted by SIGSEGV, printing backtrace

/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(+0x3b31b7f) [0x732055d31b7f]
/usr/lib/libc.so.6(+0x3def0) [0x73205204def0]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsh5ZT284fzFU_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsl3MoBsZilMd_13rustc_type_ir5visit11TypeVisitorNtNtNtCsl8oLuWw2NAI_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x41) [0x732057ad3d9b]

### cycle encountered after 3 frames with period 4
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsh5ZT284fzFU_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsl3MoBsZilMd_13rustc_type_ir5visit11TypeVisitorNtNtNtCsl8oLuWw2NAI_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x384e) [0x732057ad75a8]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsh5ZT284fzFU_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsl3MoBsZilMd_13rustc_type_ir5visit11TypeVisitorNtNtNtCsl8oLuWw2NAI_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x384e) [0x732057ad75a8]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsh5ZT284fzFU_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsl3MoBsZilMd_13rustc_type_ir5visit11TypeVisitorNtNtNtCsl8oLuWw2NAI_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x384e) [0x732057ad75a8]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsh5ZT284fzFU_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsl3MoBsZilMd_13rustc_type_ir5visit11TypeVisitorNtNtNtCsl8oLuWw2NAI_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x384e) [0x732057ad75a8]
### recursed 63 times

/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-ef85d6b35b33584e.so(_RNvXs_NtNtCsh5ZT284fzFU_21rustc_trait_selection6traits2wfNtB4_12WfPredicatesINtNtCsl3MoBsZilMd_13rustc_type_ir5visit11TypeVisitorNtNtNtCsl8oLuWw2NAI_12rustc_middle2ty7context6TyCtxtE8visit_ty+0x384e) [0x732057ad75a8]

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
[1]    835817 segmentation fault  RUST_BACKTRACE=full rustc a.rs --crate-type lib

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 30, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 30, 2025
@matthiaskrgr matthiaskrgr added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 30, 2025
@matthiaskrgr
Copy link
Member Author

bisects to nightly-2024-01-11

commit[0] 2024-01-09: Auto merge of #116846 - krtab:slice_compare_no_memcmp_opt, r=the8472
commit[1] 2024-01-09: Auto merge of #117449 - oli-obk:query_merge_immobile_game, r=matthewjasper
commit[2] 2024-01-10: Auto merge of #119794 - weihanglo:update-cargo, r=weihanglo
commit[3] 2024-01-10: Auto merge of #119797 - matthiaskrgr:rollup-nn2lt39, r=matthiaskrgr
commit[4] 2024-01-10: Auto merge of #119751 - nnethercote:error-api-fixes, r=oli-obk

@matthiaskrgr
Copy link
Member Author

maybe #117449 since the pr also caused a bunch of other ICEs 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants