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: deadlock detected without any query #120759

Open
matthiaskrgr opened this issue Feb 7, 2024 · 1 comment
Open

ICE: deadlock detected without any query #120759

matthiaskrgr opened this issue Feb 7, 2024 · 1 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. WG-compiler-parallel Working group: Parallelizing the compiler

Comments

@matthiaskrgr
Copy link
Member

Code

mod assert {
    use std::mem::{Assume, BikeshedIntrinsicFrom};
    pub struct Context;

    pub fn is_maybe_transmutable<Src, Dst>(&self, cpu: &mut CPU)
    where
        Dst: BikeshedIntrinsicFrom<Src, Context>,
    {
    }
}

fn should_pad_explicitly_packed_field() {
    #[repr(C)]
    struct ExplicitlyPadded(ExplicitlyPadded);

    assert::is_maybe_transmutable::<ExplicitlyPadded, ()>();
}

Meta

rustc --version --verbose:

rustc 1.78.0-nightly (256b6fb19 2024-02-06)
binary: rustc
commit-hash: 256b6fb19a2c018eaad4806d2369d1f6a71fc6ec
commit-date: 2024-02-06
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 17.0.6

Error output

rustc file.rs -Zthreads=50 --crate-type lib -Zcrate-attr="feature(transmutability)"

error: `self` parameter is only allowed in associated functions
 --> /home/matthias/vcs/github/glacier2/fixed/icemaker_omni/387A0B1B386A8EE1E6E89CAE9A6D505E849992C352BC3BCFDCBE4700E3140D7A.rs:5:44
  |
5 |     pub fn is_maybe_transmutable<Src, Dst>(&self, cpu: &mut CPU)
  |                                            ^^^^^ not semantically valid as function parameter
  |
  = note: associated functions are those in `impl` or `trait` definitions

error[E0412]: cannot find type `CPU` in this scope
 --> /home/matthias/vcs/github/glacier2/fixed/icemaker_omni/387A0B1B386A8EE1E6E89CAE9A6D505E849992C352BC3BCFDCBE4700E3140D7A.rs:5:61
  |
5 |     pub fn is_maybe_transmutable<Src, Dst>(&self, cpu: &mut CPU)
  |                                                             ^^^ not found in this scope

warning: unused import: `Assume`
 --> /home/matthias/vcs/github/glacier2/fixed/icemaker_omni/387A0B1B386A8EE1E6E89CAE9A6D505E849992C352BC3BCFDCBE4700E3140D7A.rs:2:20
  |
2 |     use std::mem::{Assume, BikeshedIntrinsicFrom};
  |                    ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0072]: recursive type `ExplicitlyPadded` has infinite size
  --> /home/matthias/vcs/github/glacier2/fixed/icemaker_omni/387A0B1B386A8EE1E6E89CAE9A6D505E849992C352BC3BCFDCBE4700E3140D7A.rs:14:5
   |
14 |     struct ExplicitlyPadded(ExplicitlyPadded);
   |     ^^^^^^^^^^^^^^^^^^^^^^^ ---------------- recursive without indirection
   |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
   |
14 |     struct ExplicitlyPadded(Box<ExplicitlyPadded>);
   |                             ++++                +
Backtrace

thread '<unnamed>' panicked at compiler/rustc_query_system/src/query/job.rs:543:13:
deadlock detected without any query!
stack backtrace:
   0:     0x7f5ac918bdd6 - std::backtrace_rs::backtrace::libunwind::trace::h22f05e58caa9ff59
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f5ac918bdd6 - std::backtrace_rs::backtrace::trace_unsynchronized::h7906e327863d4861
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5ac918bdd6 - std::sys_common::backtrace::_print_fmt::h776159615a49cfcd
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f5ac918bdd6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf2c228a340a82885
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f5ac91de830 - core::fmt::rt::Argument::fmt::he6c0cd9f6c3278a7
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/core/src/fmt/rt.rs:142:9
   5:     0x7f5ac91de830 - core::fmt::write::h5303f05f4c809b64
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f5ac917f6df - std::io::Write::write_fmt::hd183c8fcfd5e6b45
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/io/mod.rs:1854:15
   7:     0x7f5ac918bbb4 - std::sys_common::backtrace::_print::hf4de1e64fbf090a3
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f5ac918bbb4 - std::sys_common::backtrace::print::hb77b4a0f8f584264
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f5ac918e947 - std::panicking::default_hook::{{closure}}::hc42fc7e3b5f6cdbd
  10:     0x7f5ac918e6a9 - std::panicking::default_hook::hff91b86d193565d4
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/panicking.rs:292:9
  11:     0x7f5acbf443bc - std[2c17c6fbbbf20bd]::panicking::update_hook::<alloc[9c1d3d296df120ce]::boxed::Box<rustc_driver_impl[183d3f9280fb921b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f5ac918f096 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h55e149fb63b6b4c2
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/alloc/src/boxed.rs:2029:9
  13:     0x7f5ac918f096 - std::panicking::rust_panic_with_hook::h48d80c235e73e1c1
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/panicking.rs:785:13
  14:     0x7f5ac918eda9 - std::panicking::begin_panic_handler::{{closure}}::h5098457d512ce7c7
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/panicking.rs:651:13
  15:     0x7f5ac918c2d6 - std::sys_common::backtrace::__rust_end_short_backtrace::h88cf4f2b5332de72
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f5ac918eb34 - rust_begin_unwind
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/panicking.rs:647:5
  17:     0x7f5ac91daf35 - core::panicking::panic_fmt::h673dad205e446227
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/core/src/panicking.rs:72:14
  18:     0x7f5acc79caa6 - rustc_query_system[beb9a530d6f0ac5c]::query::job::deadlock
  19:     0x7f5acbf3b9ac - std[2c17c6fbbbf20bd]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[44fac7103cf6efb4]::util::run_in_thread_pool_with_globals<rustc_interface[44fac7103cf6efb4]::interface::run_compiler<core[f5e9b552e9b5c0f8]::result::Result<(), rustc_span[4b66b6657a2798ee]::ErrorGuaranteed>, rustc_driver_impl[183d3f9280fb921b]::run_compiler::{closure#0}>::{closure#0}, core[f5e9b552e9b5c0f8]::result::Result<(), rustc_span[4b66b6657a2798ee]::ErrorGuaranteed>>::{closure#2}::{closure#1}, ()>
  20:     0x7f5acbf46011 - <<std[2c17c6fbbbf20bd]::thread::Builder>::spawn_unchecked_<rustc_interface[44fac7103cf6efb4]::util::run_in_thread_pool_with_globals<rustc_interface[44fac7103cf6efb4]::interface::run_compiler<core[f5e9b552e9b5c0f8]::result::Result<(), rustc_span[4b66b6657a2798ee]::ErrorGuaranteed>, rustc_driver_impl[183d3f9280fb921b]::run_compiler::{closure#0}>::{closure#0}, core[f5e9b552e9b5c0f8]::result::Result<(), rustc_span[4b66b6657a2798ee]::ErrorGuaranteed>>::{closure#2}::{closure#1}, ()>::{closure#1} as core[f5e9b552e9b5c0f8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:     0x7f5ac9198735 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8542b097259e0b43
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/alloc/src/boxed.rs:2015:9
  22:     0x7f5ac9198735 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he185b299f65ba456
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/alloc/src/boxed.rs:2015:9
  23:     0x7f5ac9198735 - std::sys::pal::unix::thread::Thread::new::thread_start::h12307a2d2012c952
                               at /rustc/256b6fb19a2c018eaad4806d2369d1f6a71fc6ec/library/std/src/sys/pal/unix/thread.rs:108:17
  24:     0x7f5ac8f839eb - <unknown>
  25:     0x7f5ac90077cc - <unknown>
  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 `/home/matthias/vcs/github/glacier2/fixed/rustc-ice-2024-02-07T23_35_31-470145.txt` to your bug report

note: compiler flags: -Z threads=50 --crate-type lib -Z crate-attr=feature(transmutability)

query stack during panic:
end of query stack
deadlock handler panicked, aborting process
[1]    470145 IOT instruction  rustc  -Zthreads=50 --crate-type lib -Zcrate-attr="feature(transmutability)"

@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. WG-compiler-parallel Working group: Parallelizing the compiler labels Feb 7, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 7, 2024
@matthiaskrgr matthiaskrgr changed the title ICE: deadlock detected without any query` ICE: deadlock detected without any query Feb 7, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 8, 2024
@tanvincible
Copy link
Contributor

Not sure if this will be useful, but I got the errors as below

error: `self` parameter is only allowed in associated functions
 --> rust/deadlock.rs:5:44
  |
5 |     pub fn is_maybe_transmutable<Src, Dst>(&self, cpu: &mut CPU)
  |                                            ^^^^^ not semantically valid as function parameter
  |
  = note: associated functions are those in `impl` or `trait` definitions

error[E0412]: cannot find type `CPU` in this scope
 --> rust/deadlock.rs:5:61
  |
5 |     pub fn is_maybe_transmutable<Src, Dst>(&self, cpu: &mut CPU)
  |                                                             ^^^ not found in this scope

warning: unused import: `Assume`
 --> rust/deadlock.rs:2:20
  |
2 |     use std::mem::{Assume, BikeshedIntrinsicFrom};
  |                    ^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

thread 'rustc' panicked at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/compiler/rustc_middle/src/ty/context/tls.rs:111:50:
no ImplicitCtxt stored in tls
stack backtrace:
   0:     0x7a3dd4022dd6 - std::backtrace_rs::backtrace::libunwind::trace::ha6b405819230ab93
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7a3dd4022dd6 - std::backtrace_rs::backtrace::trace_unsynchronized::hd81a41dac54e8c7c
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7a3dd4022dd6 - std::sys_common::backtrace::_print_fmt::h8a614fb0299263a9
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7a3dd4022dd6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfecca39b07c4fcbc
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7a3dd4075830 - core::fmt::rt::Argument::fmt::hd8d61e351fa89782
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/core/src/fmt/rt.rs:142:9
   5:     0x7a3dd4075830 - core::fmt::write::hac38076b2df535c3
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/core/src/fmt/mod.rs:1120:17
   6:     0x7a3dd40166df - std::io::Write::write_fmt::hc618f51de184ded7
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/io/mod.rs:1854:15
   7:     0x7a3dd4022bb4 - std::sys_common::backtrace::_print::h91b3748df0472d8e
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7a3dd4022bb4 - std::sys_common::backtrace::print::h3d80365599e4186a
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7a3dd4025947 - std::panicking::default_hook::{{closure}}::h8335850836899fff
  10:     0x7a3dd40256a9 - std::panicking::default_hook::h44ae3592f8bdcad7
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/panicking.rs:292:9
  11:     0x7a3dd0d3609c - std[33a067abddaea91d]::panicking::update_hook::<alloc[37f95687a701a527]::boxed::Box<rustc_driver_impl[28f341bbf51b5b8b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7a3dd4026096 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h49f45ac780789671
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/alloc/src/boxed.rs:2029:9
  13:     0x7a3dd4026096 - std::panicking::rust_panic_with_hook::h91951ce8adb19a4d
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/panicking.rs:785:13
  14:     0x7a3dd4025de2 - std::panicking::begin_panic_handler::{{closure}}::h5df637559c663cfa
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/panicking.rs:659:13
  15:     0x7a3dd40232d6 - std::sys_common::backtrace::__rust_end_short_backtrace::hef201df6e278e27a
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7a3dd4025b34 - rust_begin_unwind
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/panicking.rs:647:5
  17:     0x7a3dd4071f35 - core::panicking::panic_fmt::hbedf0cc3d53692aa
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/core/src/panicking.rs:72:14
  18:     0x7a3dd4071ce3 - core::panicking::panic_display::h6927b3efd4158f6f
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/core/src/panicking.rs:196:5
  19:     0x7a3dd4071ce3 - core::panicking::panic_str::hb5dfdda127c7549e
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/core/src/panicking.rs:171:5
  20:     0x7a3dd4071ce3 - core::option::expect_failed::h1fc27a58737bc104
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/core/src/option.rs:1988:5
  21:     0x7a3dd0d373e4 - rustc_interface[d2448aaae3ba5e14]::util::run_in_thread_pool_with_globals::<rustc_interface[d2448aaae3ba5e14]::interface::run_compiler<core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>, rustc_driver_impl[28f341bbf51b5b8b]::run_compiler::{closure#0}>::{closure#0}, core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>>::{closure#2}
  22:     0x7a3dd093bbe5 - <rayon_core[bec955dcc0e4b23d]::registry::WorkerThread>::wait_until_cold
  23:     0x7a3dd09383d3 - <rayon_core[bec955dcc0e4b23d]::registry::ThreadBuilder>::run
  24:     0x7a3dd0d382d7 - <<crossbeam_utils[2416c156f4eec79d]::thread::ScopedThreadBuilder>::spawn<<rayon_core[bec955dcc0e4b23d]::ThreadPoolBuilder>::build_scoped<rustc_interface[d2448aaae3ba5e14]::util::run_in_thread_pool_with_globals<rustc_interface[d2448aaae3ba5e14]::interface::run_compiler<core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>, rustc_driver_impl[28f341bbf51b5b8b]::run_compiler::{closure#0}>::{closure#0}, core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface[d2448aaae3ba5e14]::util::run_in_thread_pool_with_globals<rustc_interface[d2448aaae3ba5e14]::interface::run_compiler<core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>, rustc_driver_impl[28f341bbf51b5b8b]::run_compiler::{closure#0}>::{closure#0}, core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core[f0b29e4f99c56c64]::result::Result<(), rustc_span[c163a2698fcd98dd]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core[f0b29e4f99c56c64]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7a3dd0d2da6e - std[33a067abddaea91d]::sys_common::backtrace::__rust_begin_short_backtrace::<alloc[37f95687a701a527]::boxed::Box<dyn core[f0b29e4f99c56c64]::ops::function::FnOnce<(), Output = ()> + core[f0b29e4f99c56c64]::marker::Send>, ()>
  26:     0x7a3dd0d37f73 - <<std[33a067abddaea91d]::thread::Builder>::spawn_unchecked_<alloc[37f95687a701a527]::boxed::Box<dyn core[f0b29e4f99c56c64]::ops::function::FnOnce<(), Output = ()> + core[f0b29e4f99c56c64]::marker::Send>, ()>::{closure#1} as core[f0b29e4f99c56c64]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:     0x7a3dd402f735 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf670e4550039b74f
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/alloc/src/boxed.rs:2015:9
  28:     0x7a3dd402f735 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcbbd2ff9c75bda4e
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/alloc/src/boxed.rs:2015:9
  29:     0x7a3dd402f735 - std::sys::pal::unix::thread::Thread::new::thread_start::h6612dee8739f0efb
                               at /rustc/f067fd6084d750f3797f54b71771c5dbc149726f/library/std/src/sys/pal/unix/thread.rs:108:17
  30:     0x7a3dcdea370a - <unknown>
  31:     0x7a3dcdf27aac - <unknown>
  32:                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 `/home/tanvipm/projects/rustc-ice-2025-03-12T08_24_05-14731.txt` to your bug report

note: compiler flags: -Z threads=50 --crate-type lib -Z crate-attr=feature(transmutability)

query stack during panic:
end of query stack
Rayon: detected unexpected panic; aborting
zsh: IOT instruction (core dumped)  rustc rust/deadlock.rs -Zthreads=50 --crate-type lib 

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. WG-compiler-parallel Working group: Parallelizing the compiler
Projects
None yet
Development

No branches or pull requests

4 participants