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 with cross-crate inlined asm! #72485

Closed
thepowersgang opened this issue May 23, 2020 · 4 comments
Closed

ICE with cross-crate inlined asm! #72485

thepowersgang opened this issue May 23, 2020 · 4 comments
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) A-specialization Area: Trait impl specialization C-bug Category: This is a bug. F-asm `#![feature(asm)]` (not `llvm_asm`) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@thepowersgang
Copy link
Contributor

thepowersgang commented May 23, 2020

Code

EDIT: Minimised

ice_asm/src/lib.rs

#![feature(asm)]
#[inline]   
pub unsafe fn inw() {
    asm!("");
}

ice_asm/src/main.rs

fn main() {
    unsafe { ice_asm::inw() }
}

Meta

rustc --version --verbose:

rustc 1.45.0-nightly (215f2d329 2020-05-22)
binary: rustc
commit-hash: 215f2d3294b08dbdcf8f7d40de21ef1e7eae0a2d
commit-date: 2020-05-22
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 10.0

Error output

   Compiling ice_asm v0.1.0 (/home/tpg/Projects/rust_os/temp/ice_asm)
thread 'rustc' panicked at 'missing specialization: `<rustc_metadata::rmeta::decoder::DecodeContext as SpecializedDecoder<&[rustc_ast::ast::InlineAsmTemplatePiece]>>::specialized_decode` not overridden', /rustc/215f2d3294b08dbdcf8f7d40de21ef1e7eae0a2d/src/libstd/macros.rs:16:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:490
  12: rust_begin_unwind
             at src/libstd/panicking.rs:388
  13: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:342
  14: <E as serialize::serialize::SpecializationError>::not_found
  15: <rustc_middle::mir::Terminator as serialize::serialize::Decodable>::decode
  16: serialize::serialize::Decoder::read_option
  17: <rustc_middle::mir::BasicBlockData as serialize::serialize::Decodable>::decode
  18: serialize::serialize::Decoder::read_seq
  19: <rustc_middle::mir::Body as serialize::serialize::Decodable>::decode
  20: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_optimized_mir
  21: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
  22: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::optimized_mir>::compute
  23: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  24: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  25: rustc_data_structures::stack::ensure_sufficient_stack
  26: rustc_query_system::query::plumbing::get_query_impl
  27: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
  28: rustc_mir::monomorphize::collector::collect_neighbours
  29: rustc_data_structures::stack::ensure_sufficient_stack
  30: rustc_mir::monomorphize::collector::collect_items_rec
  31: rustc_mir::monomorphize::collector::collect_items_rec
  32: rustc_mir::monomorphize::collector::collect_crate_mono_items
  33: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  34: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::collect_and_partition_mono_items>::compute
  35: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  36: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  37: rustc_data_structures::stack::ensure_sufficient_stack
  38: rustc_query_system::query::plumbing::get_query_impl
  39: rustc_codegen_ssa::base::codegen_crate
  40: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  41: rustc_interface::passes::start_codegen
  42: rustc_middle::ty::context::tls::enter_global
  43: rustc_interface::queries::Queries::ongoing_codegen
  44: rustc_interface::interface::run_compiler_in_existing_thread_pool
  45: scoped_tls::ScopedKey<T>::set
  46: rustc_ast::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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 (215f2d329 2020-05-22) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

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

query stack during panic:
#0 [optimized_mir] processing `ice_asm::inw`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: could not compile `ice_asm`.
@thepowersgang thepowersgang 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 May 23, 2020
@JohnTitor JohnTitor added A-inline-assembly Area: Inline assembly (`asm!(…)`) A-specialization Area: Trait impl specialization F-asm `#![feature(asm)]` (not `llvm_asm`) requires-nightly This issue requires a nightly compiler in some way. labels May 23, 2020
@JohnTitor
Copy link
Member

I think it's related to #72386.

@Aaron1011
Copy link
Member

It looks like a duplicate.

@JohnTitor
Copy link
Member

Yeah, confirmed #72400 fixes this, closing in favor of the above issue.

@thepowersgang
Copy link
Contributor Author

(I did see that other ticket, but since the panic location was different - I opened a second ticket)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) A-specialization Area: Trait impl specialization C-bug Category: This is a bug. F-asm `#![feature(asm)]` (not `llvm_asm`) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants