Skip to content

ICE on nightly: thread 'rustc' panicked at 'called Option::unwrap() on a None value', compiler/rustc_metadata/src/rmeta/decoder.rs:1565:75 #79779

Closed
@PaulGrandperrin

Description

@PaulGrandperrin

This is a transient (not sure if it's the correct word) bug.
The code was compiling fine, then I changed the port number of the server ("8081" to "8080"), tried to compile again and got this ICE.

Running cargo clean and then cargo run works fine.

Nothing special happened in between as far I as know (no toolchain upgrade for instance..)

I made a tar of the full directory at the time of the bug to keep all the compiler artifacts intact. If needed, don't hesitate to ask me for it :-)

Code

use tracing::trace;

use tide::Request;
use tide::prelude::*;

use common::Rpc;

#[async_std::main]
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    app.at("/api").post(api);
    app.listen("127.0.0.1:8080").await?;
    Ok(())
}

async fn api(mut req: Request<()>) -> tide::Result {
    let body = req.body_bytes().await?;
    let rpc: Rpc = rmp_serde::from_read_ref(&body)?;
    trace!("rpc: {:?}", rpc);
    Ok(format!("rpc: {:?}", rpc).into())
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (0f6f2d681 2020-12-06)
binary: rustc
commit-hash: 0f6f2d681b39c5f95459cd09cb936b6ceb27cd82
commit-date: 2020-12-06
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

   Compiling server v0.1.0 (/home/paulg/Repositories/cachou-playground/server-rustc-bug)
     Running `rustc --crate-name server --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=3fc825bd3e1a9242 -C extra-filename=-3fc825bd3e1a9242 --out-dir /home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps -C incremental=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/incremental -L dependency=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps --extern async_std=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libasync_std-2a85e9786aee0342.rlib --extern common=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libcommon-811e97b20d8cbed3.rlib --extern rmp_serde=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/librmp_serde-ce6f3021794182d5.rlib --extern tide=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libtide-828f06c62cd879ae.rlib --extern tracing=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libtracing-4f85beb7f1f22a4f.rlib -L native=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/build/blake3-3f72ccf30d2497a6/out -L native=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/build/blake3-3f72ccf30d2497a6/out`
warning: unused import: `tide::prelude::*`
 --> src/main.rs:4:5
  |
4 | use tide::prelude::*;
  |     ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:1565:75
stack backtrace:
   0:     0x7f9a333ff6a7 - std::backtrace_rs::backtrace::libunwind::trace::h746c3e9529d524bc
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x7f9a333ff6a7 - std::backtrace_rs::backtrace::trace_unsynchronized::h86340908ff889faa
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f9a333ff6a7 - std::sys_common::backtrace::_print_fmt::h43f85f9b18230404
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f9a333ff6a7 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc132ae1a5b5aa7cd
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x7f9a3347351c - core::fmt::write::hdf023a0036d2a25f
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/core/src/fmt/mod.rs:1078:17
   5:     0x7f9a333f1692 - std::io::Write::write_fmt::h8580846154bcb66a
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/io/mod.rs:1519:15
   6:     0x7f9a334033a5 - std::sys_common::backtrace::_print::h7ee55fed88d107a3
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x7f9a334033a5 - std::sys_common::backtrace::print::h54a7d3e52a524177
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x7f9a334033a5 - std::panicking::default_hook::{{closure}}::h60921e857bf55a40
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/panicking.rs:208:50
   9:     0x7f9a33402efa - std::panicking::default_hook::hf0f9afb1017317fc
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/panicking.rs:225:9
  10:     0x7f9a33cfa868 - rustc_driver::report_ice::hff78d76a39ffbb86
  11:     0x7f9a220c17d6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha8b2d1cf960a5467
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1342:9
  12:     0x7f9a220c25bb - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hb0800cd21acd3def
                               at /home/paulg/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:320:21
  13:     0x7f9a33403ca6 - std::panicking::rust_panic_with_hook::h8d66bf42b407aaea
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/panicking.rs:595:17
  14:     0x7f9a33403797 - std::panicking::begin_panic_handler::{{closure}}::hde71edcd925d0c5e
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/panicking.rs:495:13
  15:     0x7f9a333ffb6c - std::sys_common::backtrace::__rust_end_short_backtrace::h8a3c7d6cea578919
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/sys_common/backtrace.rs:141:18
  16:     0x7f9a33403729 - rust_begin_unwind
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/panicking.rs:493:5
  17:     0x7f9a3346f931 - core::panicking::panic_fmt::h20225113c4a2f8fd
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/core/src/panicking.rs:92:14
  18:     0x7f9a3346f87d - core::panicking::panic::h35b77276aa4b0c12
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/core/src/panicking.rs:50:5
  19:     0x7f9a35ad19ce - core::lazy::OnceCell<T>::get_or_init::h57b96d8389ca25cd
  20:     0x7f9a35c5e133 - rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::def_path_hash_to_def_id::h65c4824ddb9cc373
  21:     0x7f9a369b8174 - rustc_middle::ty::query::on_disk_cache::OnDiskCache::def_path_hash_to_def_id::h3412f85b9ae2674d
  22:     0x7f9a366d6dd3 - rustc_middle::ty::query::force_from_dep_node::h7210c4b76f287a49
  23:     0x7f9a36d47346 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  24:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  25:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  26:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  27:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  28:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  29:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  30:     0x7f9a36d47325 - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green::hfac9b7a11c770223
  31:     0x7f9a36d4700a - rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green_and_read::hbb910053a3c353ca
  32:     0x7f9a3684a907 - rustc_data_structures::stack::ensure_sufficient_stack::hb3f75ff200245260
  33:     0x7f9a36b4de4b - rustc_query_system::query::plumbing::get_query_impl::h278c35441249bece
  34:     0x7f9a3668a17b - <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle::ty::fold::TypeFolder>::fold_const::h042fd8b14050b640
  35:     0x7f9a35670fe3 - rustc_middle::ty::normalize_erasing_regions::<impl rustc_middle::ty::context::TyCtxt>::subst_and_normalize_erasing_regions::h79fdf78bb7db21a0
  36:     0x7f9a3537763b - <rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor>::visit_const::h611eebaff4b02bc8
  37:     0x7f9a3537742a - <rustc_mir::monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor>::visit_rvalue::h2a4850b5841248d9
  38:     0x7f9a3537a8e9 - rustc_mir::monomorphize::collector::collect_neighbours::h3a2d11a7f35726ff
  39:     0x7f9a353749bb - rustc_mir::monomorphize::collector::collect_items_rec::h592c99f8b97ec733
  40:     0x7f9a35374b6c - rustc_mir::monomorphize::collector::collect_items_rec::h592c99f8b97ec733
  41:     0x7f9a35374b6c - rustc_mir::monomorphize::collector::collect_items_rec::h592c99f8b97ec733
  42:     0x7f9a355b5d31 - rustc_session::utils::<impl rustc_session::session::Session>::time::h6bba076e45971cf3
  43:     0x7f9a35373dcd - rustc_mir::monomorphize::collector::collect_crate_mono_items::h5434448f8a3f6dd0
  44:     0x7f9a35451193 - rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items::h226257a3cee4be40
  45:     0x7f9a3414e502 - 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::hf9e6a15dd9ed505d
  46:     0x7f9a3403ae29 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h36288958d2194954
  47:     0x7f9a34093c3a - rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task::he4126ac6fd47c061
  48:     0x7f9a340c49e9 - rustc_data_structures::stack::ensure_sufficient_stack::hce83024ed38bf38c
  49:     0x7f9a341c39bc - rustc_query_system::query::plumbing::get_query_impl::h3d4812047a177271
  50:     0x7f9a34167b6b - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate::h067fffb3870bc5b0
  51:     0x7f9a33f1892e - rustc_session::utils::<impl rustc_session::session::Session>::time::had158f21ec5bf4d1
  52:     0x7f9a33f5b62c - rustc_interface::passes::QueryContext::enter::h40067ad7feabcbd0
  53:     0x7f9a33fb3a93 - rustc_interface::queries::Queries::ongoing_codegen::h4fc36fc05972247d
  54:     0x7f9a33ca34e2 - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::hd899306a06575d0c
  55:     0x7f9a33d365f7 - rustc_span::with_source_map::ha4e07ff263d0dc1d
  56:     0x7f9a33ca468b - rustc_interface::interface::create_compiler_and_run::h1d6d732867d1f489
  57:     0x7f9a33d50b60 - scoped_tls::ScopedKey<T>::set::h39c0aa543118d3f3
  58:     0x7f9a33d57346 - std::sys_common::backtrace::__rust_begin_short_backtrace::h1e5aa72fb9cd6d86
  59:     0x7f9a33cac07a - core::ops::function::FnOnce::call_once{{vtable.shim}}::hc793837e985b77ce
  60:     0x7f9a3341365a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hea1090dbdcecbf5a
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/alloc/src/boxed.rs:1328:9
  61:     0x7f9a3341365a - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8d5723d3912bd325
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/alloc/src/boxed.rs:1328:9
  62:     0x7f9a3341365a - std::sys::unix::thread::Thread::new::thread_start::hc17a425ca2995724
                               at /rustc/0f6f2d681b39c5f95459cd09cb936b6ceb27cd82/library/std/src/sys/unix/thread.rs:71:17
  63:     0x7f9a3334bead - start_thread
  64:     0x7f9a3326bd2f - __clone
  65:                0x0 - <unknown>

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 (0f6f2d681 2020-12-06) 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 [normalize_generic_arg_after_erasing_regions] normalizing `async_std::task::Builder::blocking::<std::future::from_generator::GenFuture<[static generator@src/main.rs:8:1: 8:19 {std::future::ResumeTy, std::future::from_generator::GenFuture<[static generator@src/main.rs:8:1: 8:19 for<'r, 's> {std::future::ResumeTy, tide::Server<()>, &'r str, impl std::future::Future, ()}]>, ()}]>, std::result::Result<(), tide::Error>>::promoted[5]`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
warning: 1 warning emitted

error: could not compile `server`

Caused by:
  process didn't exit successfully: `rustc --crate-name server --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=3fc825bd3e1a9242 -C extra-filename=-3fc825bd3e1a9242 --out-dir /home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps -C incremental=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/incremental -L dependency=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps --extern async_std=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libasync_std-2a85e9786aee0342.rlib --extern common=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libcommon-811e97b20d8cbed3.rlib --extern rmp_serde=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/librmp_serde-ce6f3021794182d5.rlib --extern tide=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libtide-828f06c62cd879ae.rlib --extern tracing=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/deps/libtracing-4f85beb7f1f22a4f.rlib -L native=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/build/blake3-3f72ccf30d2497a6/out -L native=/home/paulg/Repositories/cachou-playground/server-rustc-bug/target/debug/build/blake3-3f72ccf30d2497a6/out` (exit code: 101)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationA-metadataArea: Crate metadataC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions