Skip to content
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

ICE: panicked at /rust/deps/stacker-0.1.17/src/lib.rs:197:21, The ICE message has not ended. #133903

Closed
wxie7 opened this issue Dec 5, 2024 · 6 comments
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@wxie7
Copy link

wxie7 commented Dec 5, 2024

I tried this code:

# ! [ feature ( type_alias_impl_trait ) ]
trait Id {
type Assoc ;
}
impl < T > T {
Assoc = T ;
}
type Ty
where
Ty : Id < Assoc = Ty > ,
= impl Sized ;
fn define ( ) -> Ty { }
fn main ( ) { }

It mutates from the following file, but the following code will not cause a ICE.

Also, I used type_alias_impl_trait and Assoc as search keywords but didn’t find any related issues with open.

#![feature(type_alias_impl_trait)]

trait Id {
    type Assoc;
}
impl<T> Id for T {
    type Assoc = T;
}

type Ty
where
    Ty: Id<Assoc = Ty>,
= impl Sized;
fn define() -> Ty {}
fn main() {}

Meta

rustc --version --verbose:

rustc 1.85.0-nightly (acabb5248 2024-12-04)
binary: rustc
commit-hash: acabb5248231987ae1f0c215208d1005a5db402d
commit-date: 2024-12-04
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5

Part of the ICE information is as follows:

Backtrace

   |
2  | trait Id {
   | ^^^^^^^^
note: required by a bound on the type alias `Ty`
  --> mutant.rs:10:6
   |
10 | Ty : Id < Assoc = Ty > ,
   |      ^^^^^^^^^^^^^^^^^ required by this bound

error[E0118]: no nominal type found for inherent implementation
 --> mutant.rs:5:1
  |
5 | impl < T > T {
  | ^^^^^^^^^^^^ impl requires a nominal type
  |
  = note: either implement a trait on it or create a newtype to wrap it instead

thread 'rustc' panicked at /rust/deps/stacker-0.1.17/src/lib.rs:197:21:
setting stack permissions failed with: Cannot allocate memory (os error 12)
stack backtrace:
   0:     0x7dbef8b3c5ba - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h0ab6de9a9b46b
   1:     0x7dbef9213e66 - core::fmt::write::h786572316278241a
   2:     0x7dbefa1d1a51 - std::io::Write::write_fmt::h253c21bff6dc1068
   3:     0x7dbef8b3c412 - std::sys::backtrace::BacktraceLock::print::h72ad191a9e5c3f0c
   4:     0x7dbef8b3e93a - std::panicking::default_hook::{{closure}}::h697ead15ac8858f2
   5:     0x7dbef8b3e783 - std::panicking::default_hook::h36df36946face91c
   6:     0x7dbef7cb9318 - std[72a4a0de9fece711]::panicking::update_hook::<alloc[272e4c5910fec5b6]::boxed::Box<rustc_driver_impl[e7
   7:     0x7dbef8b3f0f8 - std::panicking::rust_panic_with_hook::h66ac57f6f29fdfbd
   8:     0x7dbef8b3edea - std::panicking::begin_panic_handler::{{closure}}::h44ac1fccfa946230
   9:     0x7dbef8b3ca79 - std::sys::backtrace::__rust_end_short_backtrace::ha74a12e03dbbea79
  10:     0x7dbef8b3eaad - rust_begin_unwind
  11:     0x7dbef57ae100 - core::panicking::panic_fmt::hed29c46432bb0866
  12:     0x7dbef7666836 - stacker[b47ad8164a60aea4]::_grow
  13:     0x7dbefa695a33 - rustc_trait_selection[8a5c83665fe794d1]::traits::normalize::normalize_with_depth_to::<rustc_type_ir[b72b
  14:     0x7dbef9cbdad3 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  15:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursiv
  16:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  17:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursiv
  18:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  19:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursiv
  20:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  21:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursiv
  22:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  23:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursiv
  24:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  25:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursiv
  26:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_re
  27:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursively
  28:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
  29:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursively
  30:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
  31:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursively
  32:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
  33:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursively
  34:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively
  35:     0x7dbef9caf015 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_predicate_recursively
  36:     0x7dbef9cbf344 - <rustc_trait_selection[8a5c83665fe794d1]::traits::select::SelectionContext>::evaluate_trait_predicate_recursively

@wxie7 wxie7 added the C-bug Category: This is a bug. label Dec 5, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 5, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Dec 5, 2024

setting stack permissions failed with: Cannot allocate memory (os error 12)

@jieyouxu

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Dec 5, 2024

Feature not required, parse error removed, seems to hang on stable too

trait Id {
    type Assoc;
}

impl<T> T {
    type Assoc = T ;
}

type Ty where Ty: Id<Assoc = Ty> = impl Sized;

fn define() -> Ty {}

fn main() {}

However this seems to still involve TAIT, even though the feature gate was not active.

@jieyouxu jieyouxu added F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 5, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Dec 5, 2024

This is a duplicate of an issue you already reported at #132797.

@jieyouxu jieyouxu closed this as completed Dec 5, 2024
@jieyouxu jieyouxu added I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 5, 2024
@wxie7
Copy link
Author

wxie7 commented Dec 5, 2024

Maybe I should modify the search strategy...

@jieyouxu
Copy link
Member

jieyouxu commented Dec 5, 2024

@wxie7 It can be hard to find the exact issues sometimes, some things you can try include:

  • Searching for the key parts of the backtrace
  • Looking for open issues labeled with the same F-*
  • Looking for the relevant A-* labels, but this may require some compiler knowledge

I didn't find the original issue either without having produced the MCVE, which is why having a smaller yet still repro-ing example is so important.

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. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. 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

3 participants