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: b.index() < self.live_nodes #121623

Open
matthiaskrgr opened this issue Feb 26, 2024 · 4 comments · May be fixed by #121682
Open

ICE: b.index() < self.live_nodes #121623

matthiaskrgr opened this issue Feb 26, 2024 · 4 comments · May be fixed by #121682
Labels
A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

fn main() {
    match () {
        _ => 'b: {
            continue 'b;
        }
    }
}

original:

fn main() {
    struct Foo { x: isize }
    match (Foo { x: 10 }) {
        Foo { ref x: ref x } => {}, //~ ERROR expected `,`
        _ => {
    'b: {
        continue 'b; //~ ERROR `continue` pointing to a labeled block
    }
}
    }
}

Version information

rustc 1.78.0-nightly (26cd5d862 2024-02-25)
binary: rustc
commit-hash: 26cd5d862e22c013ecb3396b177d3af80e95c836
commit-date: 2024-02-25
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0696]: `continue` pointing to a labeled block
 --> /tmp/icemaker_global_tempdir.5rkJyKlhWneU/rustc_testrunner_tmpdir_reporting.DS0B2iBa0Zdm/mvce.rs:4:13
  |
3 |           _ => 'b: {
  |  ______________-
4 | |             continue 'b;
  | |             ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
5 | |         }
  | |_________- labeled block the `continue` points to

thread 'rustc' panicked at compiler/rustc_passes/src/liveness/rwu_table.rs:62:9:
assertion failed: b.index() < self.live_nodes
stack backtrace:
   0:     0x7f1597b8ca06 - std::backtrace_rs::backtrace::libunwind::trace::h2b754d54d1bde505
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f1597b8ca06 - std::backtrace_rs::backtrace::trace_unsynchronized::h543e1ca101948fd5
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1597b8ca06 - std::sys_common::backtrace::_print_fmt::h530a113cbf476cc2
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f1597b8ca06 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdaaebae0c7e457dd
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f1597bdd98c - core::fmt::rt::Argument::fmt::h986a5c541218a991
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/core/src/fmt/rt.rs:142:9
   5:     0x7f1597bdd98c - core::fmt::write::h0480b093981ac277
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f1597b813cf - std::io::Write::write_fmt::he3dd140cfd4aef89
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/io/mod.rs:1846:15
   7:     0x7f1597b8c7b4 - std::sys_common::backtrace::_print::hdac374456098a97e
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f1597b8c7b4 - std::sys_common::backtrace::print::ha7f20ab884506926
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f1597b8f4fb - std::panicking::default_hook::{{closure}}::h300a405277525f5d
  10:     0x7f1597b8f249 - std::panicking::default_hook::hde1c193b2da6a81c
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/panicking.rs:292:9
  11:     0x7f159aa8892c - std[555420183d371a7f]::panicking::update_hook::<alloc[b9bf11d30073d6dd]::boxed::Box<rustc_driver_impl[633500a3532990b7]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f1597b8fc60 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h68a9e4d741c266fd
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/alloc/src/boxed.rs:2030:9
  13:     0x7f1597b8fc60 - std::panicking::rust_panic_with_hook::h8ba518db0741b55a
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/panicking.rs:783:13
  14:     0x7f1597b8f969 - std::panicking::begin_panic_handler::{{closure}}::ha55fc9dde68cbcf7
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/panicking.rs:649:13
  15:     0x7f1597b8cee6 - std::sys_common::backtrace::__rust_end_short_backtrace::h6838138199d9ac3e
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f1597b8f6d4 - rust_begin_unwind
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/panicking.rs:645:5
  17:     0x7f1597bd9ea5 - core::panicking::panic_fmt::hb9e36ea683b16cf8
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/core/src/panicking.rs:72:14
  18:     0x7f1597bd9f63 - core::panicking::panic::h7d14ca7420fbd005
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/core/src/panicking.rs:144:5
  19:     0x7f159c6ea24a - <rustc_passes[c523e52c217c408]::liveness::Liveness>::propagate_through_expr
  20:     0x7f159c6e710b - <rustc_passes[c523e52c217c408]::liveness::Liveness>::propagate_through_block
  21:     0x7f159c64cfe6 - rustc_passes[c523e52c217c408]::liveness::check_liveness
  22:     0x7f159c64c727 - rustc_query_impl[2c9e1b0525c9d953]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2c9e1b0525c9d953]::query_impl::check_liveness::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 0usize]>>
  23:     0x7f159c64b888 - rustc_query_system[dfd6c8aac03f3724]::query::plumbing::try_execute_query::<rustc_query_impl[2c9e1b0525c9d953]::DynamicConfig<rustc_query_system[dfd6c8aac03f3724]::query::caches::VecCache<rustc_span[dc6b5ece0d38defd]::def_id::LocalDefId, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2c9e1b0525c9d953]::plumbing::QueryCtxt, false>
  24:     0x7f159c64b4bf - rustc_query_impl[2c9e1b0525c9d953]::query_impl::check_liveness::get_query_non_incr::__rust_end_short_backtrace
  25:     0x7f159c49ba5a - rustc_mir_build[e37b6b80862e17d9]::build::mir_built
  26:     0x7f159c49b7ab - rustc_query_impl[2c9e1b0525c9d953]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2c9e1b0525c9d953]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 8usize]>>
  27:     0x7f159c10e570 - rustc_query_system[dfd6c8aac03f3724]::query::plumbing::try_execute_query::<rustc_query_impl[2c9e1b0525c9d953]::DynamicConfig<rustc_query_system[dfd6c8aac03f3724]::query::caches::VecCache<rustc_span[dc6b5ece0d38defd]::def_id::LocalDefId, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[2c9e1b0525c9d953]::plumbing::QueryCtxt, false>
  28:     0x7f159c10dfcc - rustc_query_impl[2c9e1b0525c9d953]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  29:     0x7f159c291b5b - rustc_mir_build[e37b6b80862e17d9]::check_unsafety::check_unsafety
  30:     0x7f159c291977 - rustc_query_impl[2c9e1b0525c9d953]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2c9e1b0525c9d953]::query_impl::check_unsafety::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 0usize]>>
  31:     0x7f159c64b80a - rustc_query_system[dfd6c8aac03f3724]::query::plumbing::try_execute_query::<rustc_query_impl[2c9e1b0525c9d953]::DynamicConfig<rustc_query_system[dfd6c8aac03f3724]::query::caches::VecCache<rustc_span[dc6b5ece0d38defd]::def_id::LocalDefId, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[2c9e1b0525c9d953]::plumbing::QueryCtxt, false>
  32:     0x7f159c64b54f - rustc_query_impl[2c9e1b0525c9d953]::query_impl::check_unsafety::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7f159ca05bab - rustc_interface[27abfdff6e6b27c2]::passes::analysis
  34:     0x7f159ca05619 - rustc_query_impl[2c9e1b0525c9d953]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[2c9e1b0525c9d953]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 1usize]>>
  35:     0x7f159cb1f8e5 - rustc_query_system[dfd6c8aac03f3724]::query::plumbing::try_execute_query::<rustc_query_impl[2c9e1b0525c9d953]::DynamicConfig<rustc_query_system[dfd6c8aac03f3724]::query::caches::SingleCache<rustc_middle[73325823477bd615]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[2c9e1b0525c9d953]::plumbing::QueryCtxt, false>
  36:     0x7f159cb1f649 - rustc_query_impl[2c9e1b0525c9d953]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7f159cb2eb16 - rustc_interface[27abfdff6e6b27c2]::interface::run_compiler::<core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>, rustc_driver_impl[633500a3532990b7]::run_compiler::{closure#0}>::{closure#0}
  38:     0x7f159cdc8cc5 - std[555420183d371a7f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[27abfdff6e6b27c2]::util::run_in_thread_with_globals<rustc_interface[27abfdff6e6b27c2]::util::run_in_thread_pool_with_globals<rustc_interface[27abfdff6e6b27c2]::interface::run_compiler<core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>, rustc_driver_impl[633500a3532990b7]::run_compiler::{closure#0}>::{closure#0}, core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>>::{closure#0}, core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>>
  39:     0x7f159cdc8af2 - <<std[555420183d371a7f]::thread::Builder>::spawn_unchecked_<rustc_interface[27abfdff6e6b27c2]::util::run_in_thread_with_globals<rustc_interface[27abfdff6e6b27c2]::util::run_in_thread_pool_with_globals<rustc_interface[27abfdff6e6b27c2]::interface::run_compiler<core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>, rustc_driver_impl[633500a3532990b7]::run_compiler::{closure#0}>::{closure#0}, core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>>::{closure#0}, core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[421030ac42e8f54b]::result::Result<(), rustc_span[dc6b5ece0d38defd]::ErrorGuaranteed>>::{closure#1} as core[421030ac42e8f54b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7f1597b99635 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h176656733d324092
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/alloc/src/boxed.rs:2016:9
  41:     0x7f1597b99635 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h2cb067df8c4b40c7
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/alloc/src/boxed.rs:2016:9
  42:     0x7f1597b99635 - std::sys::pal::unix::thread::Thread::new::thread_start::h9c4fa792b58c770f
                               at /rustc/26cd5d862e22c013ecb3396b177d3af80e95c836/library/std/src/sys/pal/unix/thread.rs:108:17
  43:     0x7f159798155a - <unknown>
  44:     0x7f15979fea3c - <unknown>
  45:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.78.0-nightly (26cd5d862 2024-02-25) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_liveness] checking liveness of variables in `main`
#1 [mir_built] building MIR for `main`
#2 [check_unsafety] unsafety-checking `main`
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0696`.

@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 Feb 26, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 26, 2024
@jieyouxu jieyouxu added A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 26, 2024
@What42Pizza
Copy link

I've also gotten this error, and I've found another way to get it:

fn main() {
    'a: {
        for _ in 0..0 {
            continue 'a;
        }
    }
}

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 15, 2024
@dotjpg3141
Copy link

Got the same panic for this code:

fn main() {
    let i = 5;
    'a: {
        continue 'a;
    }
}

@jieyouxu
Copy link
Member

Looks like improper error tainting

@jieyouxu
Copy link
Member

AAnother case: #127362.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants