Skip to content

Crash in decoder.rs: 'called Option::unwrap() on a None value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75 #79856

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

Closed
Nanduhirion opened this issue Dec 9, 2020 · 1 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.

Comments

@Nanduhirion
Copy link

Code

I suppose it has something to do with "clone_into" since this was the last line I added. Before that compiling was successful.

         let w: u32 = (b.width - b.x).ceil() as u32;
            let h: u32 = (b.height - b.y).ceil() as u32;
            let mut pixels = vec![127 as u8; (w * h * 4) as usize];
            let fractal: Fractal = calculation::Fractal::new(
                0.0,
                0.0,
                3.0,
                512,
                4.0,
                w as i32,
                h as i32,
                calculation::Fractal::c_modulo,
                4,
                w as i32 *4,
            );
            let p: Arc<Mutex<FractalParams>> = Arc::clone(&fractal.params);
            let p2: MutexGuard<FractalParams> = p.lock().unwrap();
            p2.calculate_fractal();
            let p3 = p2.pixels.lock().unwrap();
            p3.clone_into(&mut pixels);
            let image_handle: Handle = image::Handle::from_pixels(w, h, pixels);

            (
                Primitive::Image { handle: image_handle, bounds: b },

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (e792288df 2020-12-05)
binary: rustc
commit-hash: e792288df31636ca28108516c63a00ce4267063a
commit-date: 2020-12-05
host: x86_64-pc-windows-msvc
release: 1.50.0-nightly

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0-nightly (e792288df 2020-12-05) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-feature=+adx,+aes,+amx-bf16,+amx-int8,+amx-tile,+avx,+avx2,+avx512bf16,+avx512bitalg,+avx512bw,+avx512cd,+avx512dq,+avx512er,+avx512f,+avx512ifma,+avx512pf,+avx512vbmi,+avx512vbmi2,+avx512vl,+avx512vnni,+avx512vp2intersect,+avx512vpopcntdq,-bmi,-bmi2,+branchfusion,+clflushopt,+clwb,+cmov,+cx16,+cx8,+enqcmd,+ermsb,+f16c,+fast-11bytenop,+fast-15bytenop,+fast-7bytenop,-fast-bextr,+fast-gather,+fast-hops,+fast-lzcnt,+fast-scalar-fsqrt,+fast-scalar-shift-masks,+fast-shld-rotate,+fast-variable-shuffle,+fast-vector-fsqrt,+fast-vector-shift-masks,+fma,+fma4,+fsgsbase,+fxsr,+gfni,+idivl-to-divb,+idivq-to-divl,+lwp,+lzcnt,+macrofusion,+merge-to-threeway-branch,+mmx,+movbe,+movdir64b,+movdiri,+mwaitx,+nopl,+pad-short-functions,+pclmul,+pconfig,+popcnt,+prefer-256-bit,+prefer-mask-registers,+prfchw,+ptwrite,+rdpid,+rdrnd,+rdseed,+rtm,+sahf,+serialize,+sha,+shstk,+sse,+sse-unaligned-mem,+sse2,+sse3,+sse4.1,+sse4.2,+sse4a,+ssse3,-tbm,+tsxldtrk,+use-aa,+use-glm-div-sqrt-costs,+vaes,+vpclmulqdq,+vzeroupper,+waitpkg,+wbnoinvd,+xop,+xsave,+xsavec,+xsaveopt,+xsaves --crate-type bin

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

query stack during panic:
#0 [codegen_fn_attrs] computing codegen attributes of `futures_task::future_obj::if_alloc::<impl iced_native::futures::future::UnsafeFutureObj<'a, T> for std::boxed::Box<F>>::into_raw`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
Backtrace

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75
stack backtrace:
   0:     0x7ffcaebbb865 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h106ca6f8fb6a294d
   1:     0x7ffcaebe727b - core::fmt::write::h6390b994d95aebdb
   2:     0x7ffcaebacefd - <std::io::IoSlice as core::fmt::Debug>::fmt::hd713332ae62141f3
   3:     0x7ffcaebbfbdd - std::panicking::take_hook::h78f8a454f3a4df82
   4:     0x7ffcaebbf66a - std::panicking::take_hook::h78f8a454f3a4df82
   5:     0x7ffc9fc61127 - rustc_driver::report_ice::h4bc3647b6f621de8
   6:     0x7ffcaebc0730 - std::panicking::rust_panic_with_hook::h931fd6f26be82856
   7:     0x7ffcaebc01d3 - rust_begin_unwind
   8:     0x7ffcaebbc20f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h106ca6f8fb6a294d
   9:     0x7ffcaebc0159 - rust_begin_unwind
  10:     0x7ffcaebe32f0 - core::panicking::panic_fmt::h45da916c710b88f7
  11:     0x7ffcaebe323c - core::panicking::panic::h3a7a516f2be28c18
  12:     0x7ffca3404ba6 - rustc_metadata::dynamic_lib::DynamicLibrary::open::h6e15f450696ffdaf
  13:     0x7ffca359eb5d - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_path_hash_to_def_id::hb8b08d53ae47c264
  14:     0x7ffca40f1352 - rustc_middle::ty::query::on_disk_cache::OnDiskCache::compute_cnum_map::hbae92ac2867b06ae
  15:     0x7ffca3f007b9 - rustc_middle::ty::query::force_from_dep_node::h841e1a791cab1f4a
  16:     0x7ffca43d7425 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  17:     0x7ffca43d721a - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  18:     0x7ffca4020281 - rustc_middle::ty::context::TyCtxt::_intern_place_elems::hf379b6ef10105517
  19:     0x7ffca42afdd8 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1
  20:     0x7ffca419c788 - rustc_middle::mir::mono::MonoItem::instantiation_mode::hc366da6f5e5e4fc5
  21:     0x7ffca2be31e4 - <rustc_mir::dataflow::framework::graphviz::CfgEdge as core::fmt::Debug>::fmt::h2537cda26d18b021
  22:     0x7ffca2da2dd8 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  23:     0x7ffca2da24ff - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  24:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  25:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  26:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  27:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  28:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  29:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  30:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  31:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  32:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  33:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  34:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  35:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  36:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  37:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  38:     0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  39:     0x7ffca2f997d3 - <rustc_mir::util::spanview::SpanViewable as core::fmt::Debug>::fmt::h754ae9e4acd7ca7f
  40:     0x7ffca2da1551 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec
  41:     0x7ffca2e53592 - rustc_mir::monomorphize::partitioning::partition::hf4e9b71f30996dc1
  42:     0x7ffca005b6a7 - <rustc_codegen_llvm::back::lto::ThinLTOKeysMap as core::fmt::Debug>::fmt::hcd3349ee8b0cb4a5
  43:     0x7ffc9ff4f3ce - <rustc_ast::ast::StructField as rustc_ast::attr::HasAttrs>::attrs::h9f7930f3acf2c906
  44:     0x7ffc9ff9a637 - <rustc_ast::ast::FloatTy as rustc_codegen_llvm::debuginfo::metadata::MsvcBasicName>::msvc_basic_name::h3aa8bca1fb5698b6
  45:     0x7ffc9ffd3dc1 - rustc_codegen_llvm::type_::<impl rustc_codegen_ssa::traits::type_::LayoutTypeMethods for rustc_codegen_llvm::context::CodegenCx>::reg_backend_type::h5c329ef30d26310a
  46:     0x7ffca00f83e4 - <rustc_codegen_llvm::builder::Builder as rustc_codegen_ssa::traits::builder::BuilderMethods>::unchecked_umul::h41879df1ba38c684
  47:     0x7ffca0072d24 - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate::h409f60e0ae4aaf13
  48:     0x7ffc9fe58ede - rustc_interface::interface::parse_cfgspecs::he4e421c50de55949
  49:     0x7ffc9fe8d3da - rustc_interface::passes::BoxedResolver::to_resolver_outputs::hb096f93f8cf6df4c
  50:     0x7ffc9fed5a46 - rustc_interface::queries::Queries::ongoing_codegen::ha9e2915cfb307d3a
  51:     0x7ffc9fc08b74 - <rustc_codegen_ssa::back::linker::MsvcLinker as rustc_codegen_ssa::back::linker::Linker>::no_crt_objects::h47dd01e667a15f55
  52:     0x7ffc9fc99aac - <rustc_driver::args::Error as core::fmt::Debug>::fmt::hb838ed2d57a61e3c
  53:     0x7ffc9fc09bfc - <rustc_codegen_ssa::back::linker::MsvcLinker as rustc_codegen_ssa::back::linker::Linker>::no_crt_objects::h47dd01e667a15f55
  54:     0x7ffc9fcb0f84 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::hb838ed2d57a61e3c
  55:     0x7ffc9fcb8270 - rustc_ast::util::parser::prec_let_scrutinee_needs_par::h0da38a96661182e5
  56:     0x7ffc9fc12a3d - <rustc_codegen_ssa::back::linker::MsvcLinker as rustc_codegen_ssa::back::linker::Linker>::no_crt_objects::h47dd01e667a15f55
  57:     0x7ffcaebcf4f7 - std::sys::windows::thread::Thread::new::h05d768f6146b61f1
  58:     0x7ffd47f87034 - BaseThreadInitThunk
  59:     0x7ffd49f3d0d1 - RtlUserThreadStart

@Nanduhirion Nanduhirion 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 Dec 9, 2020
@Nanduhirion Nanduhirion changed the title Crash in decoder.rs Crash in decoder.rs: 'called Option::unwrap() on a None value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75 Dec 9, 2020
@camelid
Copy link
Member

camelid commented Dec 9, 2020

Duplicate of #79779.

@camelid camelid closed this as completed Dec 9, 2020
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.
Projects
None yet
Development

No branches or pull requests

2 participants