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: symbol_names: unexpected DefPathData: GlobalAsm #137472

Open
matthiaskrgr opened this issue Feb 23, 2025 · 2 comments · May be fixed by #137502
Open

ICE: symbol_names: unexpected DefPathData: GlobalAsm #137472

matthiaskrgr opened this issue Feb 23, 2025 · 2 comments · May be fixed by #137502
Assignees
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) 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

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 23, 2025

Code

//@compile-flags: -C instrument-coverage
fn foo<const N: usize>() {}

core::arch::global_asm!("/* {} */", sym foo::<{
    || {};
    0
}>);

fn main() {}

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (bca5f37cb 2025-02-23)
binary: rustc
commit-hash: bca5f37cbded0db8d37414bb08c4b101a5f26d36
commit-date: 2025-02-23
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Error output


Backtrace

warning: unused closure that must be used
 --> a.rs:4:5
  |
4 |     || {};
  |     ^^^^^
  |
  = note: closures are lazy and do nothing unless called
  = note: `#[warn(unused_must_use)]` on by default

error: internal compiler error: compiler/rustc_symbol_mangling/src/v0.rs:814:17: symbol_names: unexpected DefPathData: GlobalAsm


thread 'rustc' panicked at compiler/rustc_symbol_mangling/src/v0.rs:814:17:
Box<dyn Any>
stack backtrace:
   0:     0x7f505f17d024 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hb2766718346e8914
   1:     0x7f505f8162ec - core::fmt::write::h9a1616cb06c0cb0c
   2:     0x7f5060869851 - std::io::Write::write_fmt::ha495c1f1db9a43ed
   3:     0x7f505f17ce82 - std::sys::backtrace::BacktraceLock::print::hfcfc21e91f78122e
   4:     0x7f505f17f68e - std::panicking::default_hook::{{closure}}::hdbc3741f9d3f7a84
   5:     0x7f505f17f264 - std::panicking::default_hook::hc24bc002e7741aa1
   6:     0x7f505e2de2d7 - std[aff040118bb958da]::panicking::update_hook::<alloc[67af6a9cecfd7ba8]::boxed::Box<rustc_driver_impl[301a9b8b79b48566]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f505f17ff03 - std::panicking::rust_panic_with_hook::hcb6606e9e0388155
   8:     0x7f505e319bd1 - std[aff040118bb958da]::panicking::begin_panic::<rustc_errors[ccf3a74766137fa5]::ExplicitBug>::{closure#0}
   9:     0x7f505e30dfe6 - std[aff040118bb958da]::sys::backtrace::__rust_end_short_backtrace::<std[aff040118bb958da]::panicking::begin_panic<rustc_errors[ccf3a74766137fa5]::ExplicitBug>::{closure#0}, !>
  10:     0x7f505e30dfcb - std[aff040118bb958da]::panicking::begin_panic::<rustc_errors[ccf3a74766137fa5]::ExplicitBug>
  11:     0x7f505e3235d1 - <rustc_errors[ccf3a74766137fa5]::diagnostic::BugAbort as rustc_errors[ccf3a74766137fa5]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7f505e8f4846 - rustc_middle[bff44984932adf4f]::util::bug::opt_span_bug_fmt::<rustc_span[2a04d5a35653b919]::span_encoding::Span>::{closure#0}
  13:     0x7f505e8ddd2a - rustc_middle[bff44984932adf4f]::ty::context::tls::with_opt::<rustc_middle[bff44984932adf4f]::util::bug::opt_span_bug_fmt<rustc_span[2a04d5a35653b919]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7f505e8ddb9b - rustc_middle[bff44984932adf4f]::ty::context::tls::with_context_opt::<rustc_middle[bff44984932adf4f]::ty::context::tls::with_opt<rustc_middle[bff44984932adf4f]::util::bug::opt_span_bug_fmt<rustc_span[2a04d5a35653b919]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7f505ccf9e20 - rustc_middle[bff44984932adf4f]::util::bug::bug_fmt
  16:     0x7f505ee352de - <rustc_symbol_mangling[4df9e5f33cffabe4]::v0::SymbolMangler as rustc_middle[bff44984932adf4f]::ty::print::Printer>::print_def_path
  17:     0x7f505ee35193 - <rustc_symbol_mangling[4df9e5f33cffabe4]::v0::SymbolMangler as rustc_middle[bff44984932adf4f]::ty::print::Printer>::print_def_path
  18:     0x7f505ee35193 - <rustc_symbol_mangling[4df9e5f33cffabe4]::v0::SymbolMangler as rustc_middle[bff44984932adf4f]::ty::print::Printer>::print_def_path
  19:     0x7f505ee3461c - rustc_symbol_mangling[4df9e5f33cffabe4]::v0::mangle
  20:     0x7f505ffca8c9 - rustc_symbol_mangling[4df9e5f33cffabe4]::symbol_name_provider
  21:     0x7f505ffc93ea - rustc_query_impl[5384b6942a4aabb2]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5384b6942a4aabb2]::query_impl::symbol_name::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bff44984932adf4f]::query::erase::Erased<[u8; 16usize]>>
  22:     0x7f505ffc83c1 - rustc_query_system[5043f4129a32abe7]::query::plumbing::try_execute_query::<rustc_query_impl[5384b6942a4aabb2]::DynamicConfig<rustc_query_system[5043f4129a32abe7]::query::caches::DefaultCache<rustc_middle[bff44984932adf4f]::ty::instance::Instance, rustc_middle[bff44984932adf4f]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[5384b6942a4aabb2]::plumbing::QueryCtxt, false>
  23:     0x7f505ffc801e - rustc_query_impl[5384b6942a4aabb2]::query_impl::symbol_name::get_query_non_incr::__rust_end_short_backtrace
  24:     0x7f506067e784 - rustc_middle[bff44984932adf4f]::query::plumbing::query_get_at::<rustc_query_system[5043f4129a32abe7]::query::caches::DefaultCache<rustc_middle[bff44984932adf4f]::ty::instance::Instance, rustc_middle[bff44984932adf4f]::query::erase::Erased<[u8; 16usize]>>>
  25:     0x7f505e166dcf - rustc_codegen_llvm[c101bf8584bfcdb2]::coverageinfo::mapgen::covfun::prepare_covfun_record
  26:     0x7f5060726995 - rustc_codegen_llvm[c101bf8584bfcdb2]::base::compile_codegen_unit::module_codegen
  27:     0x7f50608eb750 - <rustc_codegen_llvm[c101bf8584bfcdb2]::LlvmCodegenBackend as rustc_codegen_ssa[9aaafa5d25c08f19]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  28:     0x7f50608e7951 - <rustc_codegen_llvm[c101bf8584bfcdb2]::LlvmCodegenBackend as rustc_codegen_ssa[9aaafa5d25c08f19]::traits::backend::CodegenBackend>::codegen_crate
  29:     0x7f50606ba9db - <rustc_interface[a6a17d2a4de965ee]::queries::Linker>::codegen_and_build_linker
  30:     0x7f506094e1ef - rustc_interface[a6a17d2a4de965ee]::passes::create_and_enter_global_ctxt::<core[25dd51937c36d244]::option::Option<rustc_interface[a6a17d2a4de965ee]::queries::Linker>, rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  31:     0x7f5060941a60 - rustc_interface[a6a17d2a4de965ee]::interface::run_compiler::<(), rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}>::{closure#1}
  32:     0x7f506077eedc - std[aff040118bb958da]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_with_globals<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_pool_with_globals<rustc_interface[a6a17d2a4de965ee]::interface::run_compiler<(), rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  33:     0x7f506077f300 - <<std[aff040118bb958da]::thread::Builder>::spawn_unchecked_<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_with_globals<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_pool_with_globals<rustc_interface[a6a17d2a4de965ee]::interface::run_compiler<(), rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[25dd51937c36d244]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7f506077fceb - std::sys::pal::unix::thread::Thread::new::thread_start::h4bc285b173c402c8
  35:     0x7f505aaa370a - <unknown>
  36:     0x7f505ab27aac - <unknown>
  37:                0x0 - <unknown>

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: please attach the file at `/tmp/im2/rustc-ice-2025-02-23T09_43_35-2986648.txt` to your bug report

note: compiler flags: -C instrument-coverage

query stack during panic:
#0 [symbol_name] computing the symbol for `{global_asm#0}::{constant#0}::{closure#0}`
end of query stack
error: aborting due to 1 previous error; 1 warning emitted

@matthiaskrgr matthiaskrgr 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 Feb 23, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 23, 2025
@matthiaskrgr matthiaskrgr added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Feb 23, 2025
@Noratrieb
Copy link
Member

@matthiaskrgr what

@Noratrieb Noratrieb added the S-needs-info Status: The issue lacks details necessary to triage or act on it. label Feb 23, 2025
@matthiaskrgr
Copy link
Member Author

copied backtrace into wrong codeblock by accident :D

@matthiaskrgr matthiaskrgr removed the S-needs-info Status: The issue lacks details necessary to triage or act on it. label Feb 23, 2025
@compiler-errors compiler-errors self-assigned this Feb 23, 2025
fmease added a commit to fmease/rust that referenced this issue Feb 26, 2025
…r-body, r=oli-obk

Don't include global asm in `mir_keys`, fix error body synthesis

r? oli-obk

Fixes rust-lang#137470
Fixes rust-lang#137471
Fixes rust-lang#137472
Fixes rust-lang#137473
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 26, 2025
…body, r=<try>

Don't include global asm in `mir_keys`, fix error body synthesis

r? oli-obk

Fixes rust-lang#137470
Fixes rust-lang#137471
Fixes rust-lang#137472
Fixes rust-lang#137473

try-job: aarch64-apple
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) 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

Successfully merging a pull request may close this issue.

5 participants