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

no ImplicitCtxt stored in tls when using -Zthreads=8 #117785

Closed
MartinquaXD opened this issue Nov 10, 2023 · 3 comments
Closed

no ImplicitCtxt stored in tls when using -Zthreads=8 #117785

MartinquaXD opened this issue Nov 10, 2023 · 3 comments
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

@MartinquaXD
Copy link

Compiler panicked when compiling big project with parallelization feature enabled.

Meta

rustc --version --verbose:

cargo 1.75.0-nightly (7046d992f 2023-11-08)

Error output

thread 'rustc' panicked at /rustc/0f44eb32f1123ac93ab404d74c295263ce468343/compiler/rustc_middle/src/ty/context/tls.rs:111:50:
no ImplicitCtxt stored in tls
<Backtrace>
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -Z threads=8

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

query stack during panic:
end of query stack
Rayon: detected unexpected panic; aborting
error: could not compile `rustix` (lib)

Caused by:
  process didn't exit successfully: `/Users/martin/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustc --crate-name rustix --edition=2021 /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=203 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked --cfg 'feature="default"' --cfg 'feature="fs"' --cfg 'feature="std"' --cfg 'feature="termios"' --cfg 'feature="use-libc-auxv"' -C metadata=286b6850d203df26 -C extra-filename=-286b6850d203df26 --out-dir /Users/martin/work/backend/side/target/debug/deps -L dependency=/Users/martin/work/backend/side/target/debug/deps --extern bitflags=/Users/martin/work/backend/side/target/debug/deps/libbitflags-c2a1d62f0fb6eb0c.rmeta --extern libc_errno=/Users/martin/work/backend/side/target/debug/deps/liberrno-5081d544525172dd.rmeta --extern libc=/Users/martin/work/backend/side/target/debug/deps/liblibc-1ba6836e8f7fa714.rmeta --cap-lints allow -Z threads=8 --cfg static_assertions --cfg libc --cfg apple --cfg bsd` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
Backtrace

stack backtrace:
   0:        0x1035612b8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h052d4a6449303d0c
   1:        0x1035a3268 - core::fmt::write::hd7376fa11f842969
   2:        0x1035579ec - std::io::Write::write_fmt::h8962cd07816e935b
   3:        0x1035610f4 - std::sys_common::backtrace::print::h97fb0a8a4077c481
   4:        0x103563af4 - std::panicking::default_hook::{{closure}}::h3b4672ac61ca5355
   5:        0x10356383c - std::panicking::default_hook::h609e6a125a90b4e7
   Compiling flate2 v1.0.26
   6:        0x10c96abb8 - <alloc[e142c9bf9c63cfc4]::boxed::Box<rustc_driver_impl[1a98898d3f3a38ed]::install_ice_hook::{closure#0}> as core[4e0a19b8f4e7b450]::ops::function::Fn<(&dyn for<'a, 'b> core[4e0a19b8f4e7b450]::ops::function::Fn<(&'a core[4e0a19b8f4e7b450]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[4e0a19b8f4e7b450]::marker::Send + core[4e0a19b8f4e7b450]::marker::Sync, &core[4e0a19b8f4e7b450]::panic::panic_info::PanicInfo)>>::call
   7:        0x10356416c - std::panicking::rust_panic_with_hook::h9625542414b348eb
   8:        0x103563f34 - std::panicking::begin_panic_handler::{{closure}}::hb4fa343c314105dc
   9:        0x103561720 - std::sys_common::backtrace::__rust_end_short_backtrace::he263cec7b035e782
  10:        0x103563cd0 - _rust_begin_unwind
  11:        0x1035bd0b8 - core::panicking::panic_fmt::h624e311b541e9a0d
  12:        0x1035bd084 - core::option::expect_failed::h3320581af4499170
  13:        0x10c91a0d0 - rustc_interface[6fd153b9b61224af]::util::run_in_thread_pool_with_globals::<rustc_interface[6fd153b9b61224af]::interface::run_compiler<core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>, rustc_driver_impl[1a98898d3f3a38ed]::run_compiler::{closure#1}>::{closure#0}, core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>>::{closure#2}
  14:        0x1106774fc - <rayon_core[cbb553a4c613b58b]::sleep::Sleep>::sleep
  15:        0x110676a04 - <rayon_core[cbb553a4c613b58b]::registry::WorkerThread>::wait_until_cold
  16:        0x10c06a22c - <rayon_core[cbb553a4c613b58b]::registry::ThreadBuilder>::run
  17:        0x10c971610 - rustc_span[7d3d88934d9d268]::set_session_globals_then::<(), rustc_interface[6fd153b9b61224af]::util::run_in_thread_pool_with_globals<rustc_interface[6fd153b9b61224af]::interface::run_compiler<core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>, rustc_driver_impl[1a98898d3f3a38ed]::run_compiler::{closure#1}>::{closure#0}, core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}::{closure#0}>
  18:        0x10c91a44c - <<crossbeam_utils[6313ccede057e440]::thread::ScopedThreadBuilder>::spawn<<rayon_core[cbb553a4c613b58b]::ThreadPoolBuilder>::build_scoped<rustc_interface[6fd153b9b61224af]::util::run_in_thread_pool_with_globals<rustc_interface[6fd153b9b61224af]::interface::run_compiler<core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>, rustc_driver_impl[1a98898d3f3a38ed]::run_compiler::{closure#1}>::{closure#0}, core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface[6fd153b9b61224af]::util::run_in_thread_pool_with_globals<rustc_interface[6fd153b9b61224af]::interface::run_compiler<core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>, rustc_driver_impl[1a98898d3f3a38ed]::run_compiler::{closure#1}>::{closure#0}, core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core[4e0a19b8f4e7b450]::result::Result<(), rustc_span[7d3d88934d9d268]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core[4e0a19b8f4e7b450]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  19:        0x10c978478 - std[f37625d93cba7df1]::sys_common::backtrace::__rust_begin_short_backtrace::<alloc[e142c9bf9c63cfc4]::boxed::Box<dyn core[4e0a19b8f4e7b450]::ops::function::FnOnce<(), Output = ()> + core[4e0a19b8f4e7b450]::marker::Send>, ()>
  20:        0x10c94c5f0 - <<std[f37625d93cba7df1]::thread::Builder>::spawn_unchecked_<alloc[e142c9bf9c63cfc4]::boxed::Box<dyn core[4e0a19b8f4e7b450]::ops::function::FnOnce<(), Output = ()> + core[4e0a19b8f4e7b450]::marker::Send>, ()>::{closure#1} as core[4e0a19b8f4e7b450]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  21:        0x10356c368 - std::sys::unix::thread::Thread::new::thread_start::h6af77cae4d08b8df
  22:        0x18f69ffa8 - __pthread_joiner_wake

@MartinquaXD MartinquaXD 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 10, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 10, 2023
@saethlin saethlin changed the title Compiler panicked when using parallel frontend no ImplicitCtxt stored in tls when using -Zthreads=8 Nov 10, 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 10, 2023
@aumetra
Copy link

aumetra commented Nov 11, 2023

Seems to be a duplicate of #111522?

@MartinquaXD
Copy link
Author

Yes, appears to be a duplicate. Sorry for that.
The back trace in the other issue is quite a bit more verbose but seems to indicate a panic in the same function. This issue can be closed then. 👌

@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

5 participants