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 while compiling with -Z threads=16: no ImplicitCtxt stored in tls #118070

Closed
RecursivePineapple opened this issue Nov 19, 2023 · 1 comment
Closed
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

@RecursivePineapple
Copy link

Code

I'm unable to share a minimal verifiable example, because my project is well over 30k lines, and the problem is not caused by a singular dependency. I haven't been able to reproduce this panic, so I assume there's a timing issue somewhere in the new multithreaded frontend.

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (283170175 2023-11-17)
binary: rustc
commit-hash: 2831701757eb7b3105eda26a306c2f3a97e2664b
commit-date: 2023-11-17
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

~/.cargo/config.toml

[target.x86_64-unknown-linux-gnu]
linker = "/opt/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/mold", "-Zproc-macro-backtrace", "-Zthreads=16"]

Error output

thread 'rustc' panicked at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/compiler/rustc_middle/src/ty/context/tls.rs:111:50:
no ImplicitCtxt stored in tls
stack backtrace:
   0:     0x7f55b6a889b1 - std::backtrace_rs::backtrace::libunwind::trace::h483ae850edb3de16
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f55b6a889b1 - std::backtrace_rs::backtrace::trace_unsynchronized::he76ab31c56246276
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f55b6a889b1 - std::backtrace::Backtrace::create::hf889f4dd163a019c
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/backtrace.rs:331:13
   3:     0x7f55b6a88900 - std::backtrace::Backtrace::force_capture::h054d0cdba698d72b
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/backtrace.rs:313:9
   4:     0x7f55b3712bec - std[fdaad7ef90c89896]::panicking::update_hook::<alloc[b004227970b6e7b7]::boxed::Box<rustc_driver_impl[17daedf8c5568a7a]::install_ice_hook::{closure#0}>>::{closure#0}
   5:     0x7f55b6aa3a58 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h17e51abe579bd85b
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/alloc/src/boxed.rs:2021:9
   6:     0x7f55b6aa3a58 - std::panicking::rust_panic_with_hook::ha049439f228290e2
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/panicking.rs:783:13
   7:     0x7f55b6aa37ae - std::panicking::begin_panic_handler::{{closure}}::h94015db26d13be8a
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/panicking.rs:657:13
   8:     0x7f55b6aa0d66 - std::sys_common::backtrace::__rust_end_short_backtrace::hf6ab2f900cebd595
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/sys_common/backtrace.rs:170:18
   9:     0x7f55b6aa3512 - rust_begin_unwind
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/panicking.rs:645:5
  10:     0x7f55b6aeff85 - core::panicking::panic_fmt::h4abc57c479b2c5f0
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/core/src/panicking.rs:72:14
  11:     0x7f55b6aefd33 - core::panicking::panic_display::h91130a2c3d09f4fe
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/core/src/panicking.rs:177:5
  12:     0x7f55b6aefd33 - core::panicking::panic_str::hd398731a94ca8cd8
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/core/src/panicking.rs:152:5
  13:     0x7f55b6aefd33 - core::option::expect_failed::hbcbd1f7e1860f526
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/core/src/option.rs:1981:5
  14:     0x7f55b37123db - rustc_interface[6f4ac54450cab10c]::util::run_in_thread_pool_with_globals::<rustc_interface[6f4ac54450cab10c]::interface::run_compiler<core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>, rustc_driver_impl[17daedf8c5568a7a]::run_compiler::{closure#1}>::{closure#0}, core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>>::{closure#2}
  15:     0x7f55b3307d85 - <rayon_core[6a25b8e43840d6ae]::registry::WorkerThread>::wait_until_cold
  16:     0x7f55b3304953 - <rayon_core[6a25b8e43840d6ae]::registry::ThreadBuilder>::run
  17:     0x7f55b3714ae7 - <<crossbeam_utils[68810042c2943676]::thread::ScopedThreadBuilder>::spawn<<rayon_core[6a25b8e43840d6ae]::ThreadPoolBuilder>::build_scoped<rustc_interface[6f4ac54450cab10c]::util::run_in_thread_pool_with_globals<rustc_interface[6f4ac54450cab10c]::interface::run_compiler<core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>, rustc_driver_impl[17daedf8c5568a7a]::run_compiler::{closure#1}>::{closure#0}, core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface[6f4ac54450cab10c]::util::run_in_thread_pool_with_globals<rustc_interface[6f4ac54450cab10c]::interface::run_compiler<core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>, rustc_driver_impl[17daedf8c5568a7a]::run_compiler::{closure#1}>::{closure#0}, core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core[d7b1c133060fc623]::result::Result<(), rustc_span[b3d67ce24f067787]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core[d7b1c133060fc623]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  18:     0x7f55b370da3e - std[fdaad7ef90c89896]::sys_common::backtrace::__rust_begin_short_backtrace::<alloc[b004227970b6e7b7]::boxed::Box<dyn core[d7b1c133060fc623]::ops::function::FnOnce<(), Output = ()> + core[d7b1c133060fc623]::marker::Send>, ()>
  19:     0x7f55b3714773 - <<std[fdaad7ef90c89896]::thread::Builder>::spawn_unchecked_<alloc[b004227970b6e7b7]::boxed::Box<dyn core[d7b1c133060fc623]::ops::function::FnOnce<(), Output = ()> + core[d7b1c133060fc623]::marker::Send>, ()>::{closure#1} as core[d7b1c133060fc623]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  20:     0x7f55b6aad915 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h83a9e80d965766fa
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/alloc/src/boxed.rs:2007:9
  21:     0x7f55b6aad915 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf1e406043410dd12
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/alloc/src/boxed.rs:2007:9
  22:     0x7f55b6aad915 - std::sys::unix::thread::Thread::new::thread_start::h3aec058c6f8c1423
                               at /rustc/2831701757eb7b3105eda26a306c2f3a97e2664b/library/std/src/sys/unix/thread.rs:108:17
  23:     0x7f55b04076db - start_thread
                               at /build/glibc-uZu3wS/glibc-2.27/nptl/pthread_create.c:463
  24:     0x7f55b013061f - clone
                               at /build/glibc-uZu3wS/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  25:                0x0 - <unknown>


rustc version: 1.76.0-nightly (283170175 2023-11-17)
platform: x86_64-unknown-linux-gnu

@RecursivePineapple RecursivePineapple 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 Nov 19, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 19, 2023
@saethlin saethlin added WG-compiler-parallel Working group: Parallelizing the compiler and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 19, 2023
@petrochenkov
Copy link
Contributor

Duplicate of #111522.

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