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

toolchain nightly 12-06-2024 introduces crash on compile of crate imgui #134345

Closed
catvir opened this issue Dec 15, 2024 · 4 comments · Fixed by #134357
Closed

toolchain nightly 12-06-2024 introduces crash on compile of crate imgui #134345

catvir opened this issue Dec 15, 2024 · 4 comments · Fixed by #134357
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@catvir
Copy link

catvir commented Dec 15, 2024

Code

This happens when compiling imgui crate. I have no minimal sample, really sorry about that. Happens in nightly-2024-12-06-x86_64-unknown-linux-gnu, but not in nightly-2024-12-05-x86_64-unknown-linux-gnu. Cross-compiling to windows via x86_64-pc-windows-msvc in release mode.

Meta

rustc --version --verbose:

rustc 1.85.0-nightly (c94848c04 2024-12-05)
binary: rustc
commit-hash: c94848c046d29f9a80c09aae758e27e418a289f2
commit-date: 2024-12-05
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5
rustc version: 1.85.0-nightly (c94848c04 2024-12-05)
platform: x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C linker=lld-link -C strip=debuginfo -C linker-flavor=lld-link

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `imgui` (lib)

Caused by:
  process didn't exit successfully: `$HOME/.rustup/toolchains/nightly-2024-12-06-x86_64-unknown-linux-gnu/bin/rustc --crate-name imgui --edition=2021 $HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imgui-0.12.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=430 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("docking", "freetype", "tables-api", "wasm"))' -C metadata=a703dd8ddd6f681d -C extra-filename=-a703dd8ddd6f681d --out-dir $HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps --target x86_64-pc-windows-msvc -C linker=lld-link -C strip=debuginfo -L dependency=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps -L dependency=$HOME/...edited.../target/release/deps --extern bitflags=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps/libbitflags-2742a12e7b6ada23.rmeta --extern cfg_if=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps/libcfg_if-56ec8c9b8d3288d7.rmeta --extern imgui_sys=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps/libimgui_sys-8dbcf6caa732dece.rmeta --extern mint=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps/libmint-7e410dd043d3309e.rmeta --extern parking_lot=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/deps/libparking_lot-6e5d60e5f4cc318f.rmeta --cap-lints allow -C linker-flavor=lld-link -Lnative=$HOME/.cache/cargo-xwin/xwin/crt/lib/x86_64 -Lnative=$HOME/.cache/cargo-xwin/xwin/sdk/lib/um/x86_64 -Lnative=$HOME/.cache/cargo-xwin/xwin/sdk/lib/ucrt/x86_64 -L native=$HOME/...edited.../target/x86_64-pc-windows-msvc/release/build/imgui-sys-4828f03d529e05b4/out -L native=$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/windows_x86_64_msvc-0.52.6/lib` (exit status: 101)

Error output

thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:642:17:
`trimmed_def_paths` called, diagnostics were expected but none were emitted. Use `with_no_trimmed_paths` for debugging. This happened in the following `must_produce_diag` call's backtrace:
   0: <rustc_errors::DiagCtxtHandle>::set_must_produce_diag
   1: <rustc_session::session::Session>::record_trimmed_def_paths
   2: rustc_middle::ty::print::pretty::trimmed_def_paths
   3: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::trimmed_def_paths::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
   4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
   5: rustc_query_impl::query_impl::trimmed_def_paths::get_query_non_incr::__rust_end_short_backtrace
   6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
   7: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
   8: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
   9: <rustc_type_ir::binder::Binder<rustc_middle::ty::context::TyCtxt, rustc_type_ir::ty_kind::FnSig<rustc_middle::ty::context::TyCtxt>> as core::fmt::Display>::fmt
  10: core::fmt::write
  11: alloc::fmt::format::format_inner
  12: rustc_lint::types::lint_fn_pointer
  13: <rustc_lint::BuiltinCombinedModuleLateLintPass as rustc_lint::passes::LateLintPass>::check_expr
  14: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  15: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  16: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  17: rustc_hir::intravisit::walk_block::<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  18: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  19: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_body
  20: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  21: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  22: rustc_hir::intravisit::walk_block::<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  23: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  24: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_body
  25: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
  26: rustc_lint::lint_mod
  27: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::lint_mod::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
  28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
  29: rustc_query_impl::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
  30: rustc_lint::late::check_crate::{closure#1}
  31: rustc_lint::late::check_crate
  32: rustc_interface::passes::analysis
  33: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
  34: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
  35: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  37: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  38: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39: std::sys::pal::unix::thread::Thread::new::thread_start
  40: start_thread
             at ./nptl/pthread_create.c:447:8
  41: clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Backtrace

stack backtrace:
   0:     0x758a885e19e5 - std::backtrace::Backtrace::create::hc9f8062bf3c77f3f
   1:     0x758a86b2a2f5 - std::backtrace::Backtrace::force_capture::hcc0245ef259ad413
   2:     0x758a85cb97ce - std[339c42a0e0e1cbc8]::panicking::update_hook::<alloc[4b645d2b808d60e5]::boxed::Box<rustc_driver_impl[a450451a1b077cae]::install_ice_hook::{closure#0}>>::{closure#0}
   3:     0x758a86b41c28 - std::panicking::rust_panic_with_hook::hadbdcb738271374d
   4:     0x758a86b4191a - std::panicking::begin_panic_handler::{{closure}}::hf015953bfb7b98c8
   5:     0x758a86b3f5a9 - std::sys::backtrace::__rust_end_short_backtrace::h8eb8f61d86c09a66
   6:     0x758a86b415dd - rust_begin_unwind
   7:     0x758a837afd10 - core::panicking::panic_fmt::h8558f71ff16f773d
   8:     0x758a880e3338 - <rustc_errors[62adf55eef5ae9ae]::DiagCtxtInner as core[a08a8da589f49b02]::ops::drop::Drop>::drop
   9:     0x758a880e3ff8 - core[a08a8da589f49b02]::ptr::drop_in_place::<rustc_errors[62adf55eef5ae9ae]::DiagCtxt>
  10:     0x758a882995da - core[a08a8da589f49b02]::ptr::drop_in_place::<rustc_session[b09893f5153b3f1a]::parse::ParseSess>
  11:     0x758a8829a560 - core[a08a8da589f49b02]::ptr::drop_in_place::<rustc_interface[b7068c2f67f9e538]::interface::Compiler>
  12:     0x758a88291887 - rustc_interface[b7068c2f67f9e538]::interface::run_compiler::<core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>, rustc_driver_impl[a450451a1b077cae]::run_compiler::{closure#0}>::{closure#1}
  13:     0x758a880dc387 - std[339c42a0e0e1cbc8]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[b7068c2f67f9e538]::util::run_in_thread_with_globals<rustc_interface[b7068c2f67f9e538]::util::run_in_thread_pool_with_globals<rustc_interface[b7068c2f67f9e538]::interface::run_compiler<core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>, rustc_driver_impl[a450451a1b077cae]::run_compiler::{closure#0}>::{closure#1}, core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>>::{closure#0}, core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>>
  14:     0x758a880dc022 - <<std[339c42a0e0e1cbc8]::thread::Builder>::spawn_unchecked_<rustc_interface[b7068c2f67f9e538]::util::run_in_thread_with_globals<rustc_interface[b7068c2f67f9e538]::util::run_in_thread_pool_with_globals<rustc_interface[b7068c2f67f9e538]::interface::run_compiler<core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>, rustc_driver_impl[a450451a1b077cae]::run_compiler::{closure#0}>::{closure#1}, core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>>::{closure#0}, core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a08a8da589f49b02]::result::Result<(), rustc_span[cf656b7144c9c5c5]::ErrorGuaranteed>>::{closure#1} as core[a08a8da589f49b02]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  15:     0x758a880db76b - std::sys::pal::unix::thread::Thread::new::thread_start::hc40c233155f425ee
  16:     0x758a8229ca94 - start_thread
                               at ./nptl/pthread_create.c:447:8
  17:     0x758a82329c3c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
  18:                0x0 - <unknown>

@catvir catvir 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 Dec 15, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 15, 2024
@saethlin
Copy link
Member

Does this still crash on the latest nightly? The relevant code has been changed recently.

@catvir
Copy link
Author

catvir commented Dec 15, 2024

Unluckily yes,

rustc 1.85.0-nightly (0aeaa5eb2 2024-12-14)
binary: rustc
commit-hash: 0aeaa5eb22180fdf12a8489e63c4daa18da6f236
commit-date: 2024-12-14
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5

Here is backtrace:

thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:646:17:
`trimmed_def_paths` called, diagnostics were expected but none were emitted. Use `with_no_trimmed_paths` for debugging. This happened in the following `must_produce_diag` call's backtrace:
   0: <rustc_errors::DiagCtxtHandle>::set_must_produce_diag
   1: <rustc_session::session::Session>::record_trimmed_def_paths
   2: rustc_middle::ty::print::pretty::trimmed_def_paths
   3: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::trimmed_def_paths::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
   4: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
   5: rustc_query_impl::query_impl::trimmed_def_paths::get_query_non_incr::__rust_end_short_backtrace
   6: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::Printer>::print_def_path
   7: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
   8: <rustc_middle::ty::print::pretty::FmtPrinter as rustc_middle::ty::print::pretty::PrettyPrinter>::pretty_print_type
   9: <rustc_type_ir::binder::Binder<rustc_middle::ty::context::TyCtxt, rustc_type_ir::ty_kind::FnSig<rustc_middle::ty::context::TyCtxt>> as core::fmt::Display>::fmt
  10: core::fmt::write
  11: alloc::fmt::format::format_inner
  12: rustc_lint::types::lint_fn_pointer
  13: <rustc_lint::BuiltinCombinedModuleLateLintPass as rustc_lint::passes::LateLintPass>::check_expr
  14: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  15: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  16: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  17: rustc_hir::intravisit::walk_block::<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  18: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  19: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_body
  20: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  21: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr
  22: rustc_hir::intravisit::walk_block::<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  23: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}
  24: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_body
  25: <rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass> as rustc_hir::intravisit::Visitor>::visit_nested_item
  26: rustc_lint::lint_mod
  27: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::lint_mod::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
  28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
  29: rustc_query_impl::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
  30: rustc_lint::late::check_crate::{closure#1}
  31: rustc_lint::late::check_crate
  32: rustc_interface::passes::analysis
  33: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
  34: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
  35: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  37: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  38: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39: std::sys::pal::unix::thread::Thread::new::thread_start
  40: start_thread
             at ./nptl/pthread_create.c:447:8
  41: clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

stack backtrace:
   0:     0x7a7fadf96aaa - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h57c8c3925ce49724
   1:     0x7a7fae813d26 - core::fmt::write::hd591db34e8fefc49
   2:     0x7a7faf8132d1 - std::io::Write::write_fmt::hafb13061963e9b6c
   3:     0x7a7fadf96902 - std::sys::backtrace::BacktraceLock::print::hd6817bcf0b2f34da
   4:     0x7a7fadf98dfa - std::panicking::default_hook::{{closure}}::h63ea7ef0f18efe7e
   5:     0x7a7fadf98c43 - std::panicking::default_hook::h2cff96b5f1f11a61
   6:     0x7a7fad0f0138 - std[1b8edffc354b3989]::panicking::update_hook::<alloc[b79a629e2207f6f2]::boxed::Box<rustc_driver_impl[9fa7216c7b2fdf15]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7a7fadf995b8 - std::panicking::rust_panic_with_hook::h7fa9a8f224b9d5b8
   8:     0x7a7fadf992aa - std::panicking::begin_panic_handler::{{closure}}::h3d3287d2b656a3fc
   9:     0x7a7fadf96f59 - std::sys::backtrace::__rust_end_short_backtrace::hc4e874dc2f50ca08
  10:     0x7a7fadf98f6d - rust_begin_unwind
  11:     0x7a7faabcde00 - core::panicking::panic_fmt::hac5ac125fcb13ef7
  12:     0x7a7faf729eb1 - <rustc_errors[19dd547f96515d19]::DiagCtxtInner as core[83eb7458e699dd0c]::ops::drop::Drop>::drop
  13:     0x7a7faf72b0dc - core[83eb7458e699dd0c]::ptr::drop_in_place::<rustc_errors[19dd547f96515d19]::DiagCtxt>
  14:     0x7a7faf8abdda - core[83eb7458e699dd0c]::ptr::drop_in_place::<rustc_session[8471c9ddb0eceece]::parse::ParseSess>
  15:     0x7a7faf8acd60 - core[83eb7458e699dd0c]::ptr::drop_in_place::<rustc_interface[685a71190dde8c4]::interface::Compiler>
  16:     0x7a7faf8a404c - rustc_interface[685a71190dde8c4]::interface::run_compiler::<(), rustc_driver_impl[9fa7216c7b2fdf15]::run_compiler::{closure#0}>::{closure#1}
  17:     0x7a7faf72ca11 - std[1b8edffc354b3989]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[685a71190dde8c4]::util::run_in_thread_with_globals<rustc_interface[685a71190dde8c4]::util::run_in_thread_pool_with_globals<rustc_interface[685a71190dde8c4]::interface::run_compiler<(), rustc_driver_impl[9fa7216c7b2fdf15]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  18:     0x7a7faf72d448 - <<std[1b8edffc354b3989]::thread::Builder>::spawn_unchecked_<rustc_interface[685a71190dde8c4]::util::run_in_thread_with_globals<rustc_interface[685a71190dde8c4]::util::run_in_thread_pool_with_globals<rustc_interface[685a71190dde8c4]::interface::run_compiler<(), rustc_driver_impl[9fa7216c7b2fdf15]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[83eb7458e699dd0c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  19:     0x7a7faf72ea01 - std::sys::pal::unix::thread::Thread::new::thread_start::hcf95b8a74a5f5cfe
  20:     0x7a7fa969ca94 - start_thread
                               at ./nptl/pthread_create.c:447:8
  21:     0x7a7fa9729c3c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
  22:                0x0 - <unknown>

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

@saethlin saethlin added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. O-windows-msvc Toolchain: MSVC, Operating system: Windows and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 15, 2024
@saethlin
Copy link
Member

cc @Urgau I'm pretty sure the root cause is this line:

format!(" as {fn_sig}")

Doing formatting eagerly like this anywhere in the compiler is usually a time bomb, because if formatting happens then is ignored, there's a mechanism you can see in the backtraces to ensure that the compiler crashes.

@Urgau Urgau self-assigned this Dec 15, 2024
@bors bors closed this as completed in 551de16 Dec 16, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 16, 2024
Rollup merge of rust-lang#134357 - Urgau:fn-ptr-134345, r=compiler-errors

Fix `trimmed_def_paths` ICE in the function ptr comparison lint

This PR fixes an ICE with `trimmed_def_paths` ICE in the function ptr comparison lint, specifically when pretty-printing user types but then not using the resulting pretty-printing.

Fixes rust-lang#134345
r? `@saethlin`
@catvir
Copy link
Author

catvir commented Dec 17, 2024

Confirmed. Issue is gone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-windows-msvc Toolchain: MSVC, Operating system: Windows 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.

4 participants