Skip to content

[ICE]: Both stable and nightly crash at compiler/rustc_passes/src/liveness/rwu_table.rs:52:9 #135131

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

Closed
2 of 4 tasks
wangbo15 opened this issue Jan 5, 2025 · 5 comments
Closed
2 of 4 tasks
Labels
C-bug Category: This is a bug. 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.

Comments

@wangbo15
Copy link

wangbo15 commented Jan 5, 2025

Code

async fn continue_labeled() {
    'b: {
        continue 'b;
    }
}
pub fn main() {}

Affected release channels

  • Previous Stable
  • Current Stable
  • Current Beta
  • Current Nightly

Rust Version

$ rustc --version --verbose
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1

Current error output

$ rustc --edition=2021 3.rs
error[E0696]: `continue` pointing to a labeled block
 --> 3.rs:3:9
  |
2 | /     'b: {
3 | |         continue 'b;
  | |         ^^^^^^^^^^^ labeled blocks cannot be `continue`'d
4 | |     }
  | |_____- labeled block the `continue` points to

Backtrace

thread 'rustc' panicked at compiler/rustc_passes/src/liveness/rwu_table.rs:52:9:
assertion failed: ln.index() < self.live_nodes
stack backtrace:
   0:     0x7f528eddc12a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h5b6bd5631a6d1f6b
   1:     0x7f528f5bd8f8 - core::fmt::write::h7550c97b06c86515
   2:     0x7f52907f4b91 - std::io::Write::write_fmt::h7b09c64fe0be9c84
   3:     0x7f528eddbf82 - std::sys::backtrace::BacktraceLock::print::h2395ccd2c84ba3aa
   4:     0x7f528edde456 - std::panicking::default_hook::{{closure}}::he19d4c7230e07961
   5:     0x7f528edde2a0 - std::panicking::default_hook::hf614597d3c67bbdb
   6:     0x7f528dea0556 - std[c6eb78587944e35c]::panicking::update_hook::<alloc[148a978a4a62f5d]::boxed::Box<rustc_driver_impl[4c2d2ad79fb810ac]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7f528eddeb68 - std::panicking::rust_panic_with_hook::h8942133a8b252070
   8:     0x7f528edde906 - std::panicking::begin_panic_handler::{{closure}}::hb5f5963570096b29
   9:     0x7f528eddc5d9 - std::sys::backtrace::__rust_end_short_backtrace::h6208cedc1922feda
  10:     0x7f528edde5fc - rust_begin_unwind
  11:     0x7f528c857160 - core::panicking::panic_fmt::h0c3082644d1bf418
  12:     0x7f528c3a628c - core::panicking::panic::h957f98c65a3b3074
  13:     0x7f528fcddbb1 - rustc_passes[5b8fd23388a41abc]::liveness::check_liveness
  14:     0x7f528fcdbc77 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::check_liveness::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 0usize]>>
  15:     0x7f528fcdaf94 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  16:     0x7f528fcdad17 - rustc_query_impl[db795c774d495014]::query_impl::check_liveness::get_query_non_incr::__rust_end_short_backtrace
  17:     0x7f528fed9e50 - rustc_mir_build[3e3bbc0efa041e77]::build::mir_build
  18:     0x7f528f5a083a - rustc_mir_transform[b36c87ceb4bb9a8e]::mir_built
  19:     0x7f528f5a07f3 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::mir_built::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
  20:     0x7f528f88fe68 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  21:     0x7f528f88f9cd - rustc_query_impl[db795c774d495014]::query_impl::mir_built::get_query_non_incr::__rust_end_short_backtrace
  22:     0x7f528f5c366e - rustc_mir_transform[b36c87ceb4bb9a8e]::ffi_unwind_calls::has_ffi_unwind_calls
  23:     0x7f528f5c309d - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::has_ffi_unwind_calls::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>
  24:     0x7f528fecba81 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  25:     0x7f528fecb6c1 - rustc_query_impl[db795c774d495014]::query_impl::has_ffi_unwind_calls::get_query_non_incr::__rust_end_short_backtrace
  26:     0x7f528cb8c730 - rustc_mir_transform[b36c87ceb4bb9a8e]::mir_promoted
  27:     0x7f528fb664a0 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::mir_promoted::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 16usize]>>
  28:     0x7f528fb66708 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  29:     0x7f52904f9ed6 - rustc_query_impl[db795c774d495014]::query_impl::mir_promoted::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7f52904f9f9c - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7f528f88fe68 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  32:     0x7f528f88f915 - rustc_query_impl[db795c774d495014]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7f5290092a2f - <rustc_borrowck[43debc0fca897831]::type_check::TypeChecker>::prove_closure_bounds
  34:     0x7f528f7ae76f - <rustc_borrowck[43debc0fca897831]::type_check::TypeChecker>::typeck_mir
  35:     0x7f529048609f - rustc_borrowck[43debc0fca897831]::type_check::type_check
  36:     0x7f528f5f8b9a - rustc_borrowck[43debc0fca897831]::nll::compute_regions
  37:     0x7f5290509d2f - rustc_borrowck[43debc0fca897831]::do_mir_borrowck
  38:     0x7f52904fa03c - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
  39:     0x7f528f88fe68 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  40:     0x7f528f88f915 - rustc_query_impl[db795c774d495014]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7f52904151de - rustc_hir_analysis[218fc6d5a11024b0]::collect::type_of::type_of_opaque
  42:     0x7f5290414f25 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
  43:     0x7f528f5c0b2d - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::DefIdCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  44:     0x7f529068bb44 - rustc_query_impl[db795c774d495014]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  45:     0x7f528c7efb13 - rustc_hir_analysis[218fc6d5a11024b0]::collect::type_of::type_of
  46:     0x7f528f5c192d - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>
  47:     0x7f528f5c0b2d - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::DefIdCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  48:     0x7f528f5c06ff - rustc_query_impl[db795c774d495014]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  49:     0x7f5290420473 - rustc_hir_analysis[218fc6d5a11024b0]::check::check::check_item_type
  50:     0x7f528cabbb60 - rustc_hir_analysis[218fc6d5a11024b0]::check::wfcheck::check_well_formed
  51:     0x7f528fecb831 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>
  52:     0x7f528fecba8f - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::VecCache<rustc_span[3e5cf3424d44936d]::def_id::LocalDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  53:     0x7f528fecb810 - rustc_query_impl[db795c774d495014]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  54:     0x7f528fecc19d - rustc_hir_analysis[218fc6d5a11024b0]::check::wfcheck::check_mod_type_wf
  55:     0x7f528fecbfa1 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>
  56:     0x7f52903d8979 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::DefaultCache<rustc_span[3e5cf3424d44936d]::def_id::LocalModDefId, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  57:     0x7f52903d876d - rustc_query_impl[db795c774d495014]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  58:     0x7f528f88c81c - rustc_hir_analysis[218fc6d5a11024b0]::check_crate
  59:     0x7f528fe8c1c3 - rustc_interface[88a02114bbdb2383]::passes::run_required_analyses
  60:     0x7f528fe832e5 - rustc_interface[88a02114bbdb2383]::passes::analysis
  61:     0x7f528fe832c9 - rustc_query_impl[db795c774d495014]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[db795c774d495014]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>
  62:     0x7f529038e662 - rustc_query_system[b2bb6e43dd6b7fda]::query::plumbing::try_execute_query::<rustc_query_impl[db795c774d495014]::DynamicConfig<rustc_query_system[b2bb6e43dd6b7fda]::query::caches::SingleCache<rustc_middle[a886f61dbc61428a]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[db795c774d495014]::plumbing::QueryCtxt, false>
  63:     0x7f529038e38f - rustc_query_impl[db795c774d495014]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  64:     0x7f52902fe0bb - rustc_interface[88a02114bbdb2383]::interface::run_compiler::<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}
  65:     0x7f52902ef3d9 - std[c6eb78587944e35c]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[88a02114bbdb2383]::util::run_in_thread_with_globals<rustc_interface[88a02114bbdb2383]::interface::run_compiler<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>
  66:     0x7f52903befac - <<std[c6eb78587944e35c]::thread::Builder>::spawn_unchecked_<rustc_interface[88a02114bbdb2383]::util::run_in_thread_with_globals<rustc_interface[88a02114bbdb2383]::interface::run_compiler<core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>, rustc_driver_impl[4c2d2ad79fb810ac]::run_compiler::{closure#0}>::{closure#1}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[c06ff78fa456ca03]::result::Result<(), rustc_span[3e5cf3424d44936d]::ErrorGuaranteed>>::{closure#1} as core[c06ff78fa456ca03]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  67:     0x7f52903bfa6b - std::sys::pal::unix::thread::Thread::new::thread_start::hcc78f3943333fa94
  68:     0x7f528a95a609 - start_thread
                               at /build/glibc-LcI20x/glibc-2.31/nptl/pthread_create.c:477:8
  69:     0x7f528a87f353 - clone
                               at /build/glibc-LcI20x/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  70:                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.83.0 (90b35a623 2024-11-26) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_liveness] checking liveness of variables in `continue_labeled::{closure#0}`
#1 [mir_built] building MIR for `continue_labeled::{closure#0}`
end of query stack
error: aborting due to 1 previous error

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

Anything else?

No response

@wangbo15 wangbo15 added C-bug Category: This is a bug. 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. labels Jan 5, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 5, 2025
@matthiaskrgr
Copy link
Member

duplicate of #113379

Please make sure to check for duplicates!

@wangbo15
Copy link
Author

wangbo15 commented Jan 5, 2025

@matthiaskrgr Sorry, I tried checking based on the crash location but couldn't find a match. I would greatly appreciate any recommendations you might have for confirming duplicates.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 5, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Jan 5, 2025

@wangbo15 Usually searching for parts of the crash backtrace, e.g.

assertion failed: ln.index() < self.live_nodes

or

compiler/rustc_passes/src/liveness/rwu_table.rs

will lead you to similar issues, but you'll still have to eyeball the older issues to see if they are actually dupes.

Example search query:

https://github.com/rust-lang/rust/issues?q=is%3Aissue%20is%3Aopen%20%22assertion%20failed%3A%20ln.index()%20%3C%20self.live_nodes%22%20

@wangbo15
Copy link
Author

wangbo15 commented Jan 5, 2025

Thank you so much, @jieyouxu. Apologies for the inconvenience, and I will make sure to follow the tips and guidelines to avoid duplicates. As a newcomer, I look forward to contributing more effectively to the community. Thanks again.

@jieyouxu
Copy link
Member

jieyouxu commented Jan 5, 2025

To add, if you're not sure if an older issue is a duplicate even though it looks quite similar, leaving a comment to link to the older issue as something like "possibly duplicate of #xxxx" helps a lot.

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-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.
Projects
None yet
Development

No branches or pull requests

4 participants