Closed
Description
I tried this code:
Tried to build the dispatch
crate.
I expected to see this happen: Successful build.
Instead, this happened: Compiler panic.
Meta
rustc --version --verbose
:
rustc 1.45.0-nightly (e83f756 2020-04-26)
binary: rustc
commit-hash: e83f756
commit-date: 2020-04-26
host: x86_64-apple-darwin
release: 1.45.0-nightly
LLVM version: 9.0
Backtrace:
error: internal compiler error: src/librustc_mir/interpret/validity.rs:396: Unexpected error during ptr inbounds test: cannot read from foreign (extern) static DefId(0:40 ~ dispatch[6e69]::ffi[0]::[0]::_dispatch_queue_attr_concurrent[0])
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:904:9
stack backtrace:
0: 0x1100d19df - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5e3a63e7985407d7
1: 0x11010b7ee - core::fmt::write::h26bd57c1fd6e9c98
2: 0x1100c2977 - std::io::Write::write_fmt::h1b039c1010aa04fe
3: 0x1100d64fa - std::panicking::default_hook::{{closure}}::h7596190ab59d75d5
4: 0x1100d623c - std::panicking::default_hook::h8a07383816b1a388
5: 0x114198848 - rustc_driver::report_ice::h296b79ffcf51ce3e
6: 0x1100d6c15 - std::panicking::rust_panic_with_hook::h0bcea39f2cca3a4b
7: 0x118234b96 - std::panicking::begin_panic::h66e22c23a1549a6e
8: 0x117e1cfb7 - rustc_errors::HandlerInner::bug::hb332c3c5946e8455
9: 0x117e1b9a7 - rustc_errors::Handler::bug::hd936ee9ba186a04d
10: 0x11789ab39 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::head52c037401cd39
11: 0x11788f3b6 - rustc_middle::ty::context::tls::with_opt::{{closure}}::h1175b0b6ce73192f
12: 0x11788f33c - rustc_middle::ty::context::tls::with_opt::hab77656c6808d61d
13: 0x11789aa48 - rustc_middle::util::bug::opt_span_bug_fmt::he5e4627c7adae268
14: 0x1182152eb - rustc_middle::util::bug::bug_fmt::h3d982ecec1b3b7c7
15: 0x116b8b5d3 - rustc_mir::interpret::validity::ValidityVisitor<M>::check_safe_pointer::h291a2bee9f7f4cfe
16: 0x116b8f9bb - rustc_mir::interpret::validity::ValidityVisitor<M>::try_visit_primitive::hb38fb3a8b177cdeb
17: 0x116cff30f - rustc_mir::interpret::validity::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::validate_operand_internal::h0fd562892c38caa3
18: 0x116e30f2d - rustc_mir::const_eval::eval_queries::const_eval_validated_provider::h3c9275a9f466ee97
19: 0x116a40e8e - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::const_eval_validated>::compute::hcdb7ef1607ca94a8
20: 0x116b6ffb8 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hc3e13af361aba2b0
21: 0x116a7ae95 - rustc_query_system::query::plumbing::get_query::h854993e300e4fae1
22: 0x116e3061a - rustc_mir::const_eval::eval_queries::const_eval_validated_provider::h3c9275a9f466ee97
23: 0x117cac8e5 - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::const_eval_validated>::compute::hcdb7ef1607ca94a8
24: 0x117ad5158 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::h6efc840c34b85f25
25: 0x117ca414a - rustc_query_system::query::plumbing::get_query::hff598a8d50b70459
26: 0x1179b4411 - rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_poly::h4c0c73d36c3ca2d5
27: 0x11746dd7e - <rustc_lint::BuiltinCombinedLateLintPass as rustc_lint::passes::LateLintPass>::check_item::ha3b5b1de31baab6d
28: 0x114469423 - rustc_hir::intravisit::Visitor::visit_nested_item::h864f6dfe5b2dc4d6
29: 0x11443397d - rustc_hir::intravisit::walk_item::h7bff3cbd983d4c68
30: 0x11446942e - rustc_hir::intravisit::Visitor::visit_nested_item::h864f6dfe5b2dc4d6
31: 0x11442ec9d - rustc_hir::intravisit::walk_crate::hcc8023c9ea6fe572
32: 0x114449a77 - rustc_session::utils::<impl rustc_session::session::Session>::time::h5b6624f93e07a70e
33: 0x11444c051 - rustc_session::utils::<impl rustc_session::session::Session>::time::hc7d512eb197226d2
34: 0x1144a0539 - rustc_interface::passes::analysis::{{closure}}::{{closure}}::h84231c11c9470877
35: 0x114448e8a - rustc_session::utils::<impl rustc_session::session::Session>::time::h3e5c6d62075716bf
36: 0x1144a042e - rustc_interface::passes::analysis::h4a4e1a01585c6f70
37: 0x1141acb5a - rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute::h5be5c3012b981eba
38: 0x1142ea159 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl::hd018b5d7bb8cf53c
39: 0x1141ad888 - rustc_query_system::query::plumbing::get_query::h1a03c197423e6671
40: 0x11432075c - rustc_middle::ty::context::tls::enter_global::h7257fd220d03bcfb
41: 0x1142f2fe1 - rustc_interface::interface::run_compiler_in_existing_thread_pool::hb089841313bdad7a
42: 0x1141a0ed9 - scoped_tls::ScopedKey<T>::set::hd33ab82953a5937b
43: 0x11419dfa5 - rustc_ast::attr::with_globals::hcb8a41b5f37a8602
44: 0x1141a692b - std::sys_common::backtrace::__rust_begin_short_backtrace::hacb8026ff037f54c
45: 0x1142f4ffc - core::ops::function::FnOnce::call_once{{vtable.shim}}::h8428325df99f3681
46: 0x1100e524d - std::sys::unix::thread::Thread::new::thread_start::h41525d65c59f0a79
47: 0x7fff6a6f5e65 - _ZL12preoptimized
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.45.0-nightly (e83f75634 2020-04-26) running on x86_64-apple-darwin
note: compiler flags: -C opt-level=3 -C bitcode-in-rlib=no -C codegen-units=1 -C debuginfo=2 -C overflow-checks=on --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [const_eval_validated] const-evaluating + checking `ffi::DISPATCH_QUEUE_CONCURRENT`
#1 [const_eval_validated] const-evaluating + checking `ffi::DISPATCH_QUEUE_CONCURRENT`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
error: could not compile `dispatch`.
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Helping to "clean up" bugs with minimal examples and bisectionsOperating system: iOSOperating system: macOSHigh priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from stable to nightly.