Skip to content

the rust compiler unexpectedly panicked randomly (deadlock detected) #118206

Open
@zhengcan

Description

@zhengcan

Command Line

> cargo clean
> RUSTFLAGS="-Z threads=8" cargo build -p my-package --timings         <<-- crash

Meta

rustc --version --verbose:

rustc 1.74.0 (79e9716c9 2023-11-13)
binary: rustc
commit-hash: 79e9716c980570bfd1f666e3b16ac583f0168962
commit-date: 2023-11-13
host: x86_64-unknown-linux-gnu
release: 1.74.0
LLVM version: 17.0.4

Error output

   Compiling static_assertions v1.1.0
   Compiling data-url v0.3.1
   Compiling crossbeam v0.8.2
   Compiling serde_repr v0.1.17
   Compiling humansize v2.1.3
   Compiling murmur3 v0.5.2
   Compiling bitvec v1.0.1
   Compiling strum v0.25.0
   Compiling xoroshiro128 v0.3.0
   Compiling darling v0.20.3
   Compiling serde_with_macros v3.4.0
   Compiling moveit v0.6.0
   Compiling sea-orm-macros v0.12.6
   Compiling ouroboros v0.17.2
   Compiling lz4 v1.24.0
   Compiling nix v0.26.4
   Compiling clap v4.4.8
   Compiling atoi v2.0.0
   Compiling v_frame v0.3.6
   Compiling chrono v0.4.31
   Compiling ordered-float v2.10.1
   Compiling ffmpeg-sys-next v6.0.1
thread '<unnamed>' panicked at compiler/rustc_query_system/src/query/job.rs:543:9:
deadlock detected
stack backtrace:
   0:     0x7f52bda5dafc - std::backtrace_rs::backtrace::libunwind::trace::ha13ad5af2864723a
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f52bda5dafc - std::backtrace_rs::backtrace::trace_unsynchronized::h9ec83e12bce3f2af
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f52bda5dafc - std::sys_common::backtrace::_print_fmt::hfb5b1986e5659ad5
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f52bda5dafc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he7b174185da70188
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f52bdab0c80 - core::fmt::rt::Argument::fmt::h32caebed6a027e31
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/core/src/fmt/rt.rs:142:9
   5:     0x7f52bdab0c80 - core::fmt::write::h8865dbd4446d81c4
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f52bda5191f - std::io::Write::write_fmt::h5106c7776eeeb011
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/io/mod.rs:1762:15
   7:     0x7f52bda5d8e4 - std::sys_common::backtrace::_print::h3da1332de103e40c
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f52bda5d8e4 - std::sys_common::backtrace::print::h647fca63756d2bb0
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f52bda60577 - std::panicking::default_hook::{{closure}}::h98008999358dde2f
  10:     0x7f52bda602df - std::panicking::default_hook::h10c8a0f39dfb424e
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/panicking.rs:292:9
  11:     0x7f52c07c7d60 - std[784e7d3054e1c5d1]::panicking::update_hook::<alloc[59eb96c7d53c301c]::boxed::Box<rustc_driver_impl[2d47774899d242a1]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f52bda60cb8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hba1727fc5205e656
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/alloc/src/boxed.rs:2021:9
  13:     0x7f52bda60cb8 - std::panicking::rust_panic_with_hook::haea349bf162a87bc
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/panicking.rs:783:13
  14:     0x7f52bda609d9 - std::panicking::begin_panic_handler::{{closure}}::h07580733b83c6ea5
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/panicking.rs:649:13
  15:     0x7f52bda5dfc6 - std::sys_common::backtrace::__rust_end_short_backtrace::hef1a1edd057da159
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f52bda60772 - rust_begin_unwind
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/panicking.rs:645:5
  17:     0x7f52bdaad365 - core::panicking::panic_fmt::h04cb63dd824eff00
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/core/src/panicking.rs:72:14
  18:     0x7f52c1093f45 - rustc_query_system[a12f560dcc0755ea]::query::job::deadlock
  19:     0x7f52c07c33fc - std[784e7d3054e1c5d1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[8d3f997819e82330]::util::run_in_thread_pool_with_globals<rustc_interface[8d3f997819e82330]::interface::run_compiler<core[268d37448c5330ed]::result::Result<(), rustc_span[ec7335e6c24654e5]::ErrorGuaranteed>, rustc_driver_impl[2d47774899d242a1]::run_compiler::{closure#0}>::{closure#0}, core[268d37448c5330ed]::result::Result<(), rustc_span[ec7335e6c24654e5]::ErrorGuaranteed>>::{closure#2}::{closure#1}, ()>
  20:     0x7f52c07c9fb1 - <<std[784e7d3054e1c5d1]::thread::Builder>::spawn_unchecked_<rustc_interface[8d3f997819e82330]::util::run_in_thread_pool_with_globals<rustc_interface[8d3f997819e82330]::interface::run_compiler<core[268d37448c5330ed]::result::Result<(), rustc_span[ec7335e6c24654e5]::ErrorGuaranteed>, rustc_driver_impl[2d47774899d242a1]::run_compiler::{closure#0}>::{closure#0}, core[268d37448c5330ed]::result::Result<(), rustc_span[ec7335e6c24654e5]::ErrorGuaranteed>>::{closure#2}::{closure#1}, ()>::{closure#1} as core[268d37448c5330ed]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:     0x7f52bda6ab75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcbf706cf4845eb28
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/alloc/src/boxed.rs:2007:9
  22:     0x7f52bda6ab75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha6849ff8413dfb0a
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/alloc/src/boxed.rs:2007:9
  23:     0x7f52bda6ab75 - std::sys::unix::thread::Thread::new::thread_start::h5b547c86f6817b85
                               at /rustc/1e9dda77b5b8e690c7e21871bbd2dcf182e1a841/library/std/src/sys/unix/thread.rs:108:17
  24:     0x7f52bd38d1ca - start_thread
  25:     0x7f52bcff8e73 - clone
  26:                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 attach the file at `/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v_frame-0.3.6/rustc-ice-2023-11-23T09_15_17-3498272.txt` to your bug report

note: compiler flags: --crate-type rlib -C embed-bitcode=no -C debuginfo=2 -C strip=debuginfo -Z threads=8

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

query stack during panic:
end of query stack
deadlock handler panicked, aborting process
sccache: Compiler killed by signal 6
error: could not compile `v_frame` (lib)

Caused by:
  process didn't exit successfully: `/root/.cargo/bin/sccache /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name v_frame --edition=2021 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/v_frame-0.3.6/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=240 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=36b370f59488b816 -C extra-filename=-36b370f59488b816 --out-dir xxx/target/debug/deps -C strip=debuginfo -L dependency=xxx/target/debug/deps --extern cfg_if=xxx/target/debug/deps/libcfg_if-b01775ae23b7536b.rmeta --extern noop_proc_macro=xxx/target/debug/deps/libnoop_proc_macro-0cfdd97779753a04.so --extern num_derive=xxx/target/debug/deps/libnum_derive-6a111fed4ede966d.so --extern num_traits=xxx/target/debug/deps/libnum_traits-0459f3fed28f5465.rmeta --extern rust_hawktracer=xxx/target/debug/deps/librust_hawktracer-80b6e497558e88b6.rmeta --cap-lints allow -Z threads=8` (exit status: 254)
Backtrace

n/a
(hard to reproduce)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parallel-compilerArea: parallel compilerC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions