Skip to content

ICE: symbol: assertion left != right failed #140884

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 10, 2025 · 2 comments
Open

ICE: symbol: assertion left != right failed #140884

matthiaskrgr opened this issue May 10, 2025 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way 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):

unsafe fn setup_boostrap_code<A>(args: &A) {
    extern "" {}
}

original:

unsafe fn setup_boostrap_code<A>(args: &A) {
    extern "" {
        static xxx: *const u64
    }
    // Arguments
    let arg1_pointer_new: *const A = core::mem::transmute::transmute(&xxx);
}

fn main() {}

Version information

rustc 1.89.0-nightly (dcecb9917 2025-05-09)
binary: rustc
commit-hash: dcecb99176edf2eec51613730937d21cdd5c8f6e
commit-date: 2025-05-09
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.4

Possibly related line of code:

}
impl Ident {
#[inline]
/// Constructs a new identifier from a symbol and a span.
pub fn new(name: Symbol, span: Span) -> Ident {
assert_ne!(name, kw::Empty);
Ident { name, span }
}
/// Constructs a new identifier with a dummy span.
#[inline]
pub fn with_dummy_span(name: Symbol) -> Ident {

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

Program output


thread 'rustc' panicked at compiler/rustc_span/src/symbol.rs:2355:9:
assertion `left != right` failed
  left: ""
 right: ""
stack backtrace:
   0:     0x7f9791b5d8b3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hc5cbdf8d27100af3
   1:     0x7f9792205c07 - core::fmt::write::h863d3bbf4c00e6b0
   2:     0x7f9793300ad1 - std::io::Write::write_fmt::h912feb91ff6a0610
   3:     0x7f9791b5d712 - std::sys::backtrace::BacktraceLock::print::hd1d99a58bb496c4c
   4:     0x7f9791b6130a - std::panicking::default_hook::{{closure}}::h0ae138d3e765f04d
   5:     0x7f9791b60e8f - std::panicking::default_hook::h197fce4b22dcc9b4
   6:     0x7f9790b90093 - std[7b29bb91ebdb57c9]::panicking::update_hook::<alloc[a0860bb7f030fe8a]::boxed::Box<rustc_driver_impl[b019fded3476e915]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f9791b61b83 - std::panicking::rust_panic_with_hook::hc11797ac2ff063c3
   8:     0x7f9791b6187a - std::panicking::begin_panic_handler::{{closure}}::h629cd41fb69152ef
   9:     0x7f9791b5dd89 - std::sys::backtrace::__rust_end_short_backtrace::hc4d9aeb15faa7765
  10:     0x7f9791b6153d - __rustc[3da6fc54cdd59cb4]::rust_begin_unwind
  11:     0x7f978e486d20 - core::panicking::panic_fmt::h0e2a987d4942fb3a
  12:     0x7f979050961a - core::panicking::assert_failed_inner::h17f3e3254adaa208
  13:     0x7f97904456f8 - core[d6ce3f6d63d0f33a]::panicking::assert_failed::<rustc_span[38259b213a6a0c93]::symbol::Symbol, rustc_span[38259b213a6a0c93]::symbol::Symbol>
  14:     0x7f9792b3311a - <rustc_span[38259b213a6a0c93]::symbol::Symbol>::to_ident_string
  15:     0x7f9790718157 - <rustc_errors[1cd13ce2e937c1a0]::diagnostic::Diag>::arg::<&str, rustc_span[38259b213a6a0c93]::symbol::Symbol>
  16:     0x7f979273d766 - <rustc_ast_lowering[19179cac93daefe0]::LoweringContext>::lower_abi
  17:     0x7f97933f412b - <rustc_ast_lowering[19179cac93daefe0]::LoweringContext>::lower_item_kind
  18:     0x7f9792754145 - <rustc_ast_lowering[19179cac93daefe0]::item::ItemLowerer>::lower_node
  19:     0x7f9792752ca5 - rustc_ast_lowering[19179cac93daefe0]::lower_to_hir
  20:     0x7f9793098eaa - rustc_query_impl[e2aea24a209ecfad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e2aea24a209ecfad]::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9f3ff6a4a17a20f0]::query::erase::Erased<[u8; 8usize]>>
  21:     0x7f979318ae01 - rustc_query_system[bd0c30a71f71891a]::query::plumbing::try_execute_query::<rustc_query_impl[e2aea24a209ecfad]::DynamicConfig<rustc_query_system[bd0c30a71f71891a]::query::caches::SingleCache<rustc_middle[9f3ff6a4a17a20f0]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[e2aea24a209ecfad]::plumbing::QueryCtxt, false>
  22:     0x7f979318a408 - rustc_query_impl[e2aea24a209ecfad]::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
  23:     0x7f979250699c - rustc_interface[e50761f90850a00f]::passes::run_required_analyses
  24:     0x7f97931f8a9e - rustc_interface[e50761f90850a00f]::passes::analysis
  25:     0x7f97931f8a75 - rustc_query_impl[e2aea24a209ecfad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e2aea24a209ecfad]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9f3ff6a4a17a20f0]::query::erase::Erased<[u8; 0usize]>>
  26:     0x7f97931888fa - rustc_query_system[bd0c30a71f71891a]::query::plumbing::try_execute_query::<rustc_query_impl[e2aea24a209ecfad]::DynamicConfig<rustc_query_system[bd0c30a71f71891a]::query::caches::SingleCache<rustc_middle[9f3ff6a4a17a20f0]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[e2aea24a209ecfad]::plumbing::QueryCtxt, false>
  27:     0x7f97931885cf - rustc_query_impl[e2aea24a209ecfad]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7f9793471f87 - rustc_interface[e50761f90850a00f]::passes::create_and_enter_global_ctxt::<core[d6ce3f6d63d0f33a]::option::Option<rustc_interface[e50761f90850a00f]::queries::Linker>, rustc_driver_impl[b019fded3476e915]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  29:     0x7f979333c5e6 - rustc_interface[e50761f90850a00f]::interface::run_compiler::<(), rustc_driver_impl[b019fded3476e915]::run_compiler::{closure#0}>::{closure#1}
  30:     0x7f97932f777e - std[7b29bb91ebdb57c9]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e50761f90850a00f]::util::run_in_thread_with_globals<rustc_interface[e50761f90850a00f]::util::run_in_thread_pool_with_globals<rustc_interface[e50761f90850a00f]::interface::run_compiler<(), rustc_driver_impl[b019fded3476e915]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  31:     0x7f97932f7bf4 - <<std[7b29bb91ebdb57c9]::thread::Builder>::spawn_unchecked_<rustc_interface[e50761f90850a00f]::util::run_in_thread_with_globals<rustc_interface[e50761f90850a00f]::util::run_in_thread_pool_with_globals<rustc_interface[e50761f90850a00f]::interface::run_compiler<(), rustc_driver_impl[b019fded3476e915]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[d6ce3f6d63d0f33a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  32:     0x7f97932f8feb - std::sys::pal::unix::thread::Thread::new::thread_start::h0908bf6e72bc0de5
  33:     0x7f978d0a370a - <unknown>
  34:     0x7f978d127aac - <unknown>
  35:                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: please make sure that you have updated to the latest nightly

note: rustc 1.89.0-nightly (dcecb9917 2025-05-09) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [hir_crate] getting the crate HIR
#1 [analysis] running analysis passes on this crate
end of query stack

@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 10, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 10, 2025
@matthiaskrgr
Copy link
Member Author

mvce

fn a() {
    extern "" {}
}

#140252 cc @nnethercote

@matthiaskrgr
Copy link
Member Author

adding label because of #140880 which will land soon-ish

@matthiaskrgr matthiaskrgr added the requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way label May 10, 2025
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 10, 2025
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) ❄️ requires-debug-assertions This issue requires a build of rustc or tooling with debug-assertions in some way 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