Skip to content

deadlock detected: now with query map, collecting exported symbols for crate / collect_and_partition_mono_items #118205

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

rustc --edition=2021 -Zthreads=16

pub static global: isize = 3;

static global0: isize = 4;

pub static global2: &'static isize = &global0;

pub fn verify_same(a: &'static isize) {
    let a = a as *const isize as usize;
    let b = &global as *const isize as usize;
    assert_eq!(a, b);
}

pub fn verify_same2(a: &'static isize) {
    let a = a as *const isize as usize;
    let b = global2 as *const isize as usize;
    assert_eq!(a, b);
}

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (fc13ca6d7 2023-11-23)
binary: rustc
commit-hash: fc13ca6d70f7381513c22443fc5aaee1d151ea45
commit-date: 2023-11-23
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Error output

<output>
Backtrace

warning: static variable `global` should have an upper case name
 --> /home/matthias/vcs/github/rust_misc_stuff/tests/ui/cross-crate/auxiliary/xcrate_static_addresses.rs:1:12
  |
1 | pub static global: isize = 3;
  |            ^^^^^^ help: convert the identifier to upper case: `GLOBAL`
  |
  = note: `#[warn(non_upper_case_globals)]` on by default

warning: static variable `global0` should have an upper case name
 --> /home/matthias/vcs/github/rust_misc_stuff/tests/ui/cross-crate/auxiliary/xcrate_static_addresses.rs:3:8
  |
3 | static global0: isize = 4;
  |        ^^^^^^^ help: convert the identifier to upper case: `GLOBAL0`

warning: static variable `global2` should have an upper case name
 --> /home/matthias/vcs/github/rust_misc_stuff/tests/ui/cross-crate/auxiliary/xcrate_static_addresses.rs:5:12
  |
5 | pub static global2: &'static isize = &global0;
  |            ^^^^^^^ help: convert the identifier to upper case: `GLOBAL2`

thread '<unnamed>' panicked at compiler/rustc_query_system/src/query/job.rs:548:13:
deadlock detected! current query map:
{
    QueryJobId(
        1229,
    ): QueryJobInfo {
        query: QueryStackFrame {
            description: "collecting exported symbols for crate `0`",
            span: Some(
                Span {
                    lo: BytePos(
                        0,
                    ),
                    hi: BytePos(
                        0,
                    ),
                    ctxt: #0,
                },
            ),
            def_id: None,
            def_kind: None,
            ty_adt_id: None,
            dep_kind: DepKind {
                variant: 249,
            },
            hash: 12056485195163891650,
        },
        job: QueryJob {
            id: QueryJobId(
                1229,
            ),
            span: Span {
                lo: BytePos(
                    0,
                ),
                hi: BytePos(
                    0,
                ),
                ctxt: #0,
            },
            parent: None,
            latch: Some(
                QueryLatch {
                    info: Mutex {
                        data: QueryLatchInfo {
                            complete: false,
                            waiters: [
                                QueryWaiter {
                                    query: None,
                                    condvar: Condvar { .. },
                                    span: Span {
                                        lo: BytePos(
                                            0,
                                        ),
                                        hi: BytePos(
                                            0,
                                        ),
                                        ctxt: #0,
                                    },
                                    cycle: Mutex {
                                        data: None,
                                    },
                                },
                            ],
                        },
                    },
                },
            ),
        },
    },
    QueryJobId(
        1242,
    ): QueryJobInfo {
        query: QueryStackFrame {
            description: "collect_and_partition_mono_items",
            span: Some(
                Span {
                    lo: BytePos(
                        0,
                    ),
                    hi: BytePos(
                        0,
                    ),
                    ctxt: #0,
                },
            ),
            def_id: None,
            def_kind: None,
            ty_adt_id: None,
            dep_kind: DepKind {
                variant: 250,
            },
            hash: 15975767348252564715,
        },
        job: QueryJob {
            id: QueryJobId(
                1242,
            ),
            span: Span {
                lo: BytePos(
                    0,
                ),
                hi: BytePos(
                    0,
                ),
                ctxt: #0,
            },
            parent: Some(
                QueryJobId(
                    1229,
                ),
            ),
            latch: None,
        },
    },
}
stack backtrace:
   0:     0x7f757e1bcafc - std::backtrace_rs::backtrace::libunwind::trace::hb7874fdb876d6a33
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f757e1bcafc - std::backtrace_rs::backtrace::trace_unsynchronized::hfd16eb345705ed29
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f757e1bcafc - std::sys_common::backtrace::_print_fmt::h2ebfc309c7ba6d42
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f757e1bcafc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4ac6e06a20b25c35
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f757e20fc80 - core::fmt::rt::Argument::fmt::ha07604edfcde1b50
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/core/src/fmt/rt.rs:142:9
   5:     0x7f757e20fc80 - core::fmt::write::h65e51514dc428ee4
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f757e1b09af - std::io::Write::write_fmt::hb5d4658f9e4e80c1
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/io/mod.rs:1762:15
   7:     0x7f757e1bc8e4 - std::sys_common::backtrace::_print::h6f720f26eadbfa0e
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f757e1bc8e4 - std::sys_common::backtrace::print::ha7cb1801514bf000
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f757e1bf577 - std::panicking::default_hook::{{closure}}::h50d9eeaa2c9ddf63
  10:     0x7f757e1bf2df - std::panicking::default_hook::h2f1a9064e2ffc577
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/panicking.rs:292:9
  11:     0x7f757aefd0c0 - std[76d2dc5da0aff713]::panicking::update_hook::<alloc[a973e296dfb5f4bc]::boxed::Box<rustc_driver_impl[1a4eb564e865739e]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f757e1bfcb8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h964f55efb97c9907
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/alloc/src/boxed.rs:2021:9
  13:     0x7f757e1bfcb8 - std::panicking::rust_panic_with_hook::h6d23d56c8d3cb044
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/panicking.rs:783:13
  14:     0x7f757e1bfa0e - std::panicking::begin_panic_handler::{{closure}}::ha4f11e3cfef36a87
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/panicking.rs:657:13
  15:     0x7f757e1bcfc6 - std::sys_common::backtrace::__rust_end_short_backtrace::hb092d8d5af117d8a
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f757e1bf772 - rust_begin_unwind
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/panicking.rs:645:5
  17:     0x7f757e20c365 - core::panicking::panic_fmt::h0aba5e5824ae1da8
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/core/src/panicking.rs:72:14
  18:     0x7f757b7cae66 - rustc_query_system[6f0d3dc7706fe901]::query::job::deadlock
  19:     0x7f757aef507c - std[76d2dc5da0aff713]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[19061b1bef701b58]::util::run_in_thread_pool_with_globals<rustc_interface[19061b1bef701b58]::interface::run_compiler<core[b166d8b927da802c]::result::Result<(), rustc_span[80f72817ab8f0e5f]::ErrorGuaranteed>, rustc_driver_impl[1a4eb564e865739e]::run_compiler::{closure#0}>::{closure#0}, core[b166d8b927da802c]::result::Result<(), rustc_span[80f72817ab8f0e5f]::ErrorGuaranteed>>::{closure#2}::{closure#1}, ()>
  20:     0x7f757aefee81 - <<std[76d2dc5da0aff713]::thread::Builder>::spawn_unchecked_<rustc_interface[19061b1bef701b58]::util::run_in_thread_pool_with_globals<rustc_interface[19061b1bef701b58]::interface::run_compiler<core[b166d8b927da802c]::result::Result<(), rustc_span[80f72817ab8f0e5f]::ErrorGuaranteed>, rustc_driver_impl[1a4eb564e865739e]::run_compiler::{closure#0}>::{closure#0}, core[b166d8b927da802c]::result::Result<(), rustc_span[80f72817ab8f0e5f]::ErrorGuaranteed>>::{closure#2}::{closure#1}, ()>::{closure#1} as core[b166d8b927da802c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:     0x7f757e1c9b75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf4a56211c07be68c
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/alloc/src/boxed.rs:2007:9
  22:     0x7f757e1c9b75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5116e2d8972832ea
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/alloc/src/boxed.rs:2007:9
  23:     0x7f757e1c9b75 - std::sys::unix::thread::Thread::new::thread_start::h1997c24c5b66ef90
                               at /rustc/fc13ca6d70f7381513c22443fc5aaee1d151ea45/library/std/src/sys/unix/thread.rs:108:17
  24:     0x7f75780aa9eb - <unknown>
  25:     0x7f757812e7cc - <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: rustc 1.76.0-nightly (fc13ca6d7 2023-11-23) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z dump-mir-dir=/tmp/icemaker_global_tempdir.R2B4br2BXDkO/rustc_testrunner_tmpdir.Lsl8OcR7icb3 -Z no-codegen --crate-type lib -Z threads=16

query stack during panic:
end of query stack
deadlock handler panicked, aborting process

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