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

cargo test cause ICE #95012

Closed
Sherlock-Holo opened this issue Mar 16, 2022 · 1 comment
Closed

cargo test cause ICE #95012

Sherlock-Holo opened this issue Mar 16, 2022 · 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

@Sherlock-Holo
Copy link

Code

use std::time::{Duration, Instant};

use async_trait::async_trait;
use dashmap::DashMap;
use http::Uri;
use tonic::{Request, Response, Status};
use tracing::{debug, error, info, instrument};

use crate::pb::register_server::Register;
use crate::pb::*;

#[derive(Debug, Clone)]
struct Node {
    uri: Uri,
    deadline: Instant,
}

#[derive(Default)]
pub struct Registry {
    max_period: Duration,
    nodes: DashMap<u64, Node>,
}

#[async_trait]
impl Register for Registry {
    #[instrument(skip(self), err)]
    async fn register_node(
        &self,
        request: Request<RegisterNodeRequest>,
    ) -> Result<Response<RegisterNodeResponse>, Status> {
        let req = request.into_inner();

        let uri = req.node_uri.parse::<Uri>().map_err(|err| {
            error!(%err, "node url invalid");

            Status::invalid_argument(format!("node url {} invalid", req.node_uri))
        })?;

        debug!(node_id = req.node_id, %uri, "parse node uri done");

        let period = Duration::from_millis(req.period).min(self.max_period);

        debug!(node_id = req.node_id, ?period, "node period");

        let deadline = Instant::now() + period;

        debug!(node_id = req.node_id, ?deadline, "node deadline");

        // self.nodes.insert(req.node_id, Node {})
        self.nodes.insert(req.node_id, Node { uri, deadline });

        Ok(Response::new(RegisterNodeResponse {
            period: period.as_millis() as _,
        }))
    }

    #[instrument(skip(self), err)]
    async fn list_nodes(
        &self,
        _request: Request<ListNodesRequest>,
    ) -> Result<Response<ListNodesResponse>, Status> {
        let mut out_of_date_ids = vec![];

        let nodes = self
            .nodes
            .iter()
            .filter(|node| {
                let alive = node.deadline.elapsed() < self.max_period;
                if !alive {
                    out_of_date_ids.push(*node.key());
                }

                alive
            })
            .map(|node| NodeInfo {
                node_id: *node.key(),
                node_uri: node.uri.to_string(),
            })
            .collect::<Vec<_>>();

        if !out_of_date_ids.is_empty() {
            info!(
                ?out_of_date_ids,
                "some nodes are out of date, need to be cleared"
            );

            for node_id in out_of_date_ids {
                // the out of date node may update when removing, so use remove_if not remove
                self.nodes.remove_if(&node_id, |_, node| {
                    node.deadline.elapsed() >= self.max_period
                });

                debug!(node_id, "out of date node is cleaed");
            }
        }

        debug!(?nodes, "list nodes done");

        Ok(Response::new(ListNodesResponse { node_list: nodes }))
    }
}

#[cfg(test)]
mod tests {
    use tonic::IntoRequest;

    use super::*;

    #[tokio::test]
    async fn test_register_node() {
        let registry = Registry::default();

        registry
            .register_node(
                RegisterNodeRequest {
                    node_id: 1,
                    period: 1000,
                    node_uri: "http://127.0.0.1".to_string(),
                }
                .into_request(),
            )
            .await
            .unwrap();

        let node = registry.nodes.get(&1).unwrap();
        assert_eq!(*node.key(), 1);
        assert_eq!(node.uri, Uri::from_static("http://127.0.0.1"));

        assert!(node.deadline.elapsed() <= Duration::from_millis(1000));
    }
}

the pb is

syntax = "proto3";

package skv_register;

message RegisterNodeRequest {
  uint64 node_id = 1;
  uint64 period = 2; // time unit is millisecond
  string node_uri = 3;
}

message RegisterNodeResponse {
  uint64 period = 1; // time unit is millisecond
}

message ListNodesRequest {}

message NodeInfo {
  uint64 node_id = 1;
  string node_uri = 2;
}

message ListNodesResponse {
  repeated NodeInfo node_list = 1;
}

service Register {
  rpc register_node(RegisterNodeRequest) returns (RegisterNodeResponse) {}

  rpc list_nodes(ListNodesRequest) returns (ListNodesResponse) {}
}

and use tonic-build to generate it

Meta

rustc --version --verbose:

rustc 1.61.0-nightly (52b34550a 2022-03-15)
binary: rustc
commit-hash: 52b34550aca5f7dd7e152f773e3ab786acb86f6f
commit-date: 2022-03-15
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Error output

run cargo test

   Compiling tracing-subscriber v0.3.9
   Compiling hyper v0.14.17
   Compiling skvregistry v0.1.0 (/home/sherlock/git/simple_kv/skvregistry)
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/compiler/rustc_middle/src/ty/sty.rs:1089:9
stack backtrace:
   0:     0x7efebd69d9bd - std::backtrace_rs::backtrace::libunwind::trace::h4630fb3ea0978244
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7efebd69d9bd - std::backtrace_rs::backtrace::trace_unsynchronized::hf18a5a72046346f1
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7efebd69d9bd - std::sys_common::backtrace::_print_fmt::hf749d0aa30a58698
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7efebd69d9bd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9b8410cdaf24e94d
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7efebd6f749c - core::fmt::write::h4628ef2f511cb2a1
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/core/src/fmt/mod.rs:1190:17
   5:     0x7efebd68ef41 - std::io::Write::write_fmt::h0500ef668fc0f1ca
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/io/mod.rs:1655:15
   6:     0x7efebd6a0a35 - std::sys_common::backtrace::_print::h0bef26ee54194799
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7efebd6a0a35 - std::sys_common::backtrace::print::hd94733c6e7c5f533
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7efebd6a0a35 - std::panicking::default_hook::{{closure}}::heee50b6b48941df3
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/panicking.rs:295:22
   9:     0x7efebd6a06e9 - std::panicking::default_hook::hfbe8348e52a92768
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/panicking.rs:314:9
  10:     0x7efebdeca291 - rustc_driver[689e96f3a05e42de]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7efebd6a1180 - std::panicking::rust_panic_with_hook::h123c71abd7d4640f
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/panicking.rs:702:17
  12:     0x7efebd6a0f79 - std::panicking::begin_panic_handler::{{closure}}::h4dff286ac3d07322
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/panicking.rs:586:13
  13:     0x7efebd69de74 - std::sys_common::backtrace::__rust_end_short_backtrace::h1350a023dcdb3181
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7efebd6a0ce9 - rust_begin_unwind
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/panicking.rs:584:5
  15:     0x7efebd664c73 - core::panicking::panic_fmt::hdc1c83fe453b97e2
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/core/src/panicking.rs:143:14
  16:     0x7efebd664b3d - core::panicking::panic::hb1922f21f0c33350
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/core/src/panicking.rs:48:5
  17:     0x7efebfafd31f - rustc_trait_selection[ca55f1b2036c5dee]::traits::type_known_to_meet_bound_modulo_regions
  18:     0x7efebf395df5 - <rustc_infer[769fe71a64f3976f]::infer::InferCtxtBuilder>::enter::<bool, rustc_ty_utils[89a13c48e2035fd7]::common_traits::is_item_raw::{closure#0}>
  19:     0x7efec004c04e - rustc_ty_utils[89a13c48e2035fd7]::common_traits::is_item_raw
  20:     0x7efebf775cdc - rustc_query_system[ccda753483a689aa]::query::plumbing::try_execute_query::<rustc_query_impl[7c11a1a95cade8b5]::plumbing::QueryCtxt, rustc_query_system[ccda753483a689aa]::query::caches::DefaultCache<rustc_middle[f9f9a681d39429ab]::ty::ParamEnvAnd<rustc_middle[f9f9a681d39429ab]::ty::Ty>, bool>>
  21:     0x7efec024133b - rustc_query_system[ccda753483a689aa]::query::plumbing::get_query::<rustc_query_impl[7c11a1a95cade8b5]::queries::is_sized_raw, rustc_query_impl[7c11a1a95cade8b5]::plumbing::QueryCtxt>
  22:     0x7efebfca5e55 - <rustc_middle[f9f9a681d39429ab]::ty::Ty>::is_sized
  23:     0x7efebfc2fd8e - <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached
  24:     0x7efebfc46d06 - rustc_middle[f9f9a681d39429ab]::ty::layout::layout_of
  25:     0x7efebf7d603a - rustc_query_system[ccda753483a689aa]::query::plumbing::get_query::<rustc_query_impl[7c11a1a95cade8b5]::queries::layout_of, rustc_query_impl[7c11a1a95cade8b5]::plumbing::QueryCtxt>
  26:     0x7efebf873f60 - <rustc_query_impl[7c11a1a95cade8b5]::Queries as rustc_middle[f9f9a681d39429ab]::ty::query::QueryEngine>::layout_of
  27:     0x7efebfc5228b - <alloc[2b3e5422ad2b1e63]::vec::Vec<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>> as alloc[2b3e5422ad2b1e63]::vec::spec_from_iter::SpecFromIter<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>, core[2748ca54e7081f8b]::iter::adapters::GenericShunt<core[2748ca54e7081f8b]::iter::adapters::map::Map<core[2748ca54e7081f8b]::slice::iter::Iter<rustc_middle[f9f9a681d39429ab]::ty::FieldDef>, <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[2748ca54e7081f8b]::result::Result<core[2748ca54e7081f8b]::convert::Infallible, rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutError>>>>::from_iter
  28:     0x7efebfc5171c - <alloc[2b3e5422ad2b1e63]::vec::Vec<alloc[2b3e5422ad2b1e63]::vec::Vec<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>>> as alloc[2b3e5422ad2b1e63]::vec::spec_from_iter::SpecFromIter<alloc[2b3e5422ad2b1e63]::vec::Vec<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>>, core[2748ca54e7081f8b]::iter::adapters::GenericShunt<core[2748ca54e7081f8b]::iter::adapters::map::Map<core[2748ca54e7081f8b]::slice::iter::Iter<rustc_middle[f9f9a681d39429ab]::ty::VariantDef>, <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[2748ca54e7081f8b]::result::Result<core[2748ca54e7081f8b]::convert::Infallible, rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutError>>>>::from_iter
  29:     0x7efebfc2f980 - <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached
  30:     0x7efebfc46d06 - rustc_middle[f9f9a681d39429ab]::ty::layout::layout_of
  31:     0x7efebf7d603a - rustc_query_system[ccda753483a689aa]::query::plumbing::get_query::<rustc_query_impl[7c11a1a95cade8b5]::queries::layout_of, rustc_query_impl[7c11a1a95cade8b5]::plumbing::QueryCtxt>
  32:     0x7efebf873f60 - <rustc_query_impl[7c11a1a95cade8b5]::Queries as rustc_middle[f9f9a681d39429ab]::ty::query::QueryEngine>::layout_of
  33:     0x7efebfc5228b - <alloc[2b3e5422ad2b1e63]::vec::Vec<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>> as alloc[2b3e5422ad2b1e63]::vec::spec_from_iter::SpecFromIter<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>, core[2748ca54e7081f8b]::iter::adapters::GenericShunt<core[2748ca54e7081f8b]::iter::adapters::map::Map<core[2748ca54e7081f8b]::slice::iter::Iter<rustc_middle[f9f9a681d39429ab]::ty::FieldDef>, <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[2748ca54e7081f8b]::result::Result<core[2748ca54e7081f8b]::convert::Infallible, rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutError>>>>::from_iter
  34:     0x7efebfc5171c - <alloc[2b3e5422ad2b1e63]::vec::Vec<alloc[2b3e5422ad2b1e63]::vec::Vec<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>>> as alloc[2b3e5422ad2b1e63]::vec::spec_from_iter::SpecFromIter<alloc[2b3e5422ad2b1e63]::vec::Vec<rustc_target[5665e444836c2cfe]::abi::TyAndLayout<rustc_middle[f9f9a681d39429ab]::ty::Ty>>, core[2748ca54e7081f8b]::iter::adapters::GenericShunt<core[2748ca54e7081f8b]::iter::adapters::map::Map<core[2748ca54e7081f8b]::slice::iter::Iter<rustc_middle[f9f9a681d39429ab]::ty::VariantDef>, <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[2748ca54e7081f8b]::result::Result<core[2748ca54e7081f8b]::convert::Infallible, rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutError>>>>::from_iter
  35:     0x7efebfc2f980 - <rustc_middle[f9f9a681d39429ab]::ty::layout::LayoutCx<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt>>::layout_of_uncached
  36:     0x7efebfc46d06 - rustc_middle[f9f9a681d39429ab]::ty::layout::layout_of
  37:     0x7efebf7d603a - rustc_query_system[ccda753483a689aa]::query::plumbing::get_query::<rustc_query_impl[7c11a1a95cade8b5]::queries::layout_of, rustc_query_impl[7c11a1a95cade8b5]::plumbing::QueryCtxt>
  38:     0x7efebf873f60 - <rustc_query_impl[7c11a1a95cade8b5]::Queries as rustc_middle[f9f9a681d39429ab]::ty::query::QueryEngine>::layout_of
  39:     0x7efebf87a555 - rustc_codegen_ssa[8aeb056d12bc5476]::debuginfo::type_names::push_debuginfo_type_name
  40:     0x7efebf879cd6 - rustc_codegen_ssa[8aeb056d12bc5476]::debuginfo::type_names::push_debuginfo_type_name
  41:     0x7efebf8784e0 - rustc_codegen_ssa[8aeb056d12bc5476]::debuginfo::type_names::compute_debuginfo_type_name
  42:     0x7efebf125fcb - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::type_di_node
  43:     0x7efebf123f5c - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::build_pointer_or_reference_di_node
  44:     0x7efebf125414 - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::type_di_node
  45:     0x7efebf121000 - <&mut rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::build_struct_type_di_node::{closure#0}::{closure#0} as core[2748ca54e7081f8b]::ops::function::FnOnce<((usize, &rustc_middle[f9f9a681d39429ab]::ty::FieldDef),)>>::call_once
  46:     0x7efebf0e6d5b - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::build_struct_type_di_node::{closure#0}, rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::build_struct_type_di_node::{closure#1}>
  47:     0x7efebf125155 - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::type_di_node
  48:     0x7efebf123f5c - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::build_pointer_or_reference_di_node
  49:     0x7efebf125414 - rustc_codegen_llvm[718acca89ba432ab]::debuginfo::metadata::type_di_node
  50:     0x7efebf106df8 - <rustc_codegen_llvm[718acca89ba432ab]::context::CodegenCx as rustc_codegen_ssa[8aeb056d12bc5476]::traits::debuginfo::DebugInfoMethods>::dbg_scope_fn
  51:     0x7efebf1329b2 - rustc_codegen_ssa[8aeb056d12bc5476]::mir::codegen_mir::<rustc_codegen_llvm[718acca89ba432ab]::builder::Builder>
  52:     0x7efebf0f1324 - rustc_codegen_llvm[718acca89ba432ab]::base::compile_codegen_unit::module_codegen
  53:     0x7efebfdafb66 - <rustc_query_system[ccda753483a689aa]::dep_graph::graph::DepGraph<rustc_middle[f9f9a681d39429ab]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[f9f9a681d39429ab]::ty::context::TyCtxt, rustc_span[71d6b32be7db1b29]::symbol::Symbol, rustc_codegen_ssa[8aeb056d12bc5476]::ModuleCodegen<rustc_codegen_llvm[718acca89ba432ab]::ModuleLlvm>>
  54:     0x7efebfd9e889 - rustc_codegen_llvm[718acca89ba432ab]::base::compile_codegen_unit
  55:     0x7efebfd8cacc - <rustc_codegen_llvm[718acca89ba432ab]::LlvmCodegenBackend as rustc_codegen_ssa[8aeb056d12bc5476]::traits::backend::CodegenBackend>::codegen_crate
  56:     0x7efebfd6de07 - <rustc_session[b6943ffe4755727e]::session::Session>::time::<alloc[2b3e5422ad2b1e63]::boxed::Box<dyn core[2748ca54e7081f8b]::any::Any>, rustc_interface[ed5ba2b564642d99]::passes::start_codegen::{closure#0}>
  57:     0x7efebfd5c878 - <rustc_interface[ed5ba2b564642d99]::passes::QueryContext>::enter::<<rustc_interface[ed5ba2b564642d99]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[2748ca54e7081f8b]::result::Result<alloc[2b3e5422ad2b1e63]::boxed::Box<dyn core[2748ca54e7081f8b]::any::Any>, rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>
  58:     0x7efebfd5524f - <rustc_interface[ed5ba2b564642d99]::queries::Queries>::ongoing_codegen
  59:     0x7efebfd18d6b - <rustc_interface[ed5ba2b564642d99]::interface::Compiler>::enter::<rustc_driver[689e96f3a05e42de]::run_compiler::{closure#1}::{closure#2}, core[2748ca54e7081f8b]::result::Result<core[2748ca54e7081f8b]::option::Option<rustc_interface[ed5ba2b564642d99]::queries::Linker>, rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>
  60:     0x7efebfd2bddf - rustc_span[71d6b32be7db1b29]::with_source_map::<core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>, rustc_interface[ed5ba2b564642d99]::interface::create_compiler_and_run<core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>, rustc_driver[689e96f3a05e42de]::run_compiler::{closure#1}>::{closure#1}>
  61:     0x7efebfd2b5e4 - rustc_interface[ed5ba2b564642d99]::interface::create_compiler_and_run::<core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>, rustc_driver[689e96f3a05e42de]::run_compiler::{closure#1}>
  62:     0x7efebfd16762 - <scoped_tls[a18bab56a8f82071]::ScopedKey<rustc_span[71d6b32be7db1b29]::SessionGlobals>>::set::<rustc_interface[ed5ba2b564642d99]::interface::run_compiler<core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>, rustc_driver[689e96f3a05e42de]::run_compiler::{closure#1}>::{closure#0}, core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>
  63:     0x7efebfd14c1f - std[14bdc88f27c1cbe3]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ed5ba2b564642d99]::util::run_in_thread_pool_with_globals<rustc_interface[ed5ba2b564642d99]::interface::run_compiler<core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>, rustc_driver[689e96f3a05e42de]::run_compiler::{closure#1}>::{closure#0}, core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>::{closure#0}, core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>
  64:     0x7efebfd2cd62 - <<std[14bdc88f27c1cbe3]::thread::Builder>::spawn_unchecked_<rustc_interface[ed5ba2b564642d99]::util::run_in_thread_pool_with_globals<rustc_interface[ed5ba2b564642d99]::interface::run_compiler<core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>, rustc_driver[689e96f3a05e42de]::run_compiler::{closure#1}>::{closure#0}, core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>::{closure#0}, core[2748ca54e7081f8b]::result::Result<(), rustc_errors[31a36e023e39c2ba]::ErrorGuaranteed>>::{closure#1} as core[2748ca54e7081f8b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  65:     0x7efebd6ab313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd90ad1cbe107fac7
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/alloc/src/boxed.rs:1853:9
  66:     0x7efebd6ab313 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h47f9929b43ba9f68
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/alloc/src/boxed.rs:1853:9
  67:     0x7efebd6ab313 - std::sys::unix::thread::Thread::new::thread_start::hf5007aed9e46726b
                               at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/sys/unix/thread.rs:108:17
  68:     0x7efebd4835c2 - start_thread
  69:     0x7efebd508584 - __clone
  70:                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.61.0-nightly (52b34550a 2022-03-15) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C link-arg=-fuse-ld=lld

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

query stack during panic:
#0 [is_sized_raw] computing whether `dyn std::io::Write` is `Sized`
#1 [layout_of] computing layout of `*const dyn std::io::Write`
#2 [layout_of] computing layout of `core::ptr::unique::Unique<dyn std::io::Write>`
#3 [layout_of] computing layout of `alloc::boxed::Box<dyn std::io::Write>`
end of query stack
error: could not compile `tracing-subscriber`
warning: build failed, waiting for other jobs to finish...
error: build failed
Backtrace

   Compiling tracing-subscriber v0.3.9
   Compiling hyper-timeout v0.4.1
   Compiling skvregistry v0.1.0 (/home/sherlock/git/simple_kv/skvregistry)
   Compiling tonic v0.6.2
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/compiler/rustc_middle/src/ty/sty.rs:1089:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/core/src/panicking.rs:143:14
   2: core::panicking::panic
             at /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/library/core/src/panicking.rs:48:5
   3: rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions
   4: <rustc_infer::infer::InferCtxtBuilder>::enter::<bool, rustc_ty_utils::common_traits::is_item_raw::{closure#0}>
   5: rustc_ty_utils::common_traits::is_item_raw
   6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Ty>, bool>>
   7: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::is_sized_raw, rustc_query_impl::plumbing::QueryCtxt>
   8: <rustc_middle::ty::Ty>::is_sized
   9: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
  10: rustc_middle::ty::layout::layout_of
  11: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
  12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
  13: <alloc::vec::Vec<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>, core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core::result::Result<core::convert::Infallible, rustc_middle::ty::layout::LayoutError>>>>::from_iter
  14: <alloc::vec::Vec<alloc::vec::Vec<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>>> as alloc::vec::spec_from_iter::SpecFromIter<alloc::vec::Vec<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>>, core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core::result::Result<core::convert::Infallible, rustc_middle::ty::layout::LayoutError>>>>::from_iter
  15: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
  16: rustc_middle::ty::layout::layout_of
  17: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
  18: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
  19: <alloc::vec::Vec<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>, core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::FieldDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core::result::Result<core::convert::Infallible, rustc_middle::ty::layout::LayoutError>>>>::from_iter
  20: <alloc::vec::Vec<alloc::vec::Vec<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>>> as alloc::vec::spec_from_iter::SpecFromIter<alloc::vec::Vec<rustc_target::abi::TyAndLayout<rustc_middle::ty::Ty>>, core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::slice::iter::Iter<rustc_middle::ty::VariantDef>, <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core::result::Result<core::convert::Infallible, rustc_middle::ty::layout::LayoutError>>>>::from_iter
  21: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>>::layout_of_uncached
  22: rustc_middle::ty::layout::layout_of
  23: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::layout_of, rustc_query_impl::plumbing::QueryCtxt>
  24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_of
  25: rustc_codegen_ssa::debuginfo::type_names::push_debuginfo_type_name
  26: rustc_codegen_ssa::debuginfo::type_names::push_debuginfo_type_name
  27: rustc_codegen_ssa::debuginfo::type_names::compute_debuginfo_type_name
  28: rustc_codegen_llvm::debuginfo::metadata::type_di_node
  29: rustc_codegen_llvm::debuginfo::metadata::build_pointer_or_reference_di_node
  30: rustc_codegen_llvm::debuginfo::metadata::type_di_node
  31: <&mut rustc_codegen_llvm::debuginfo::metadata::build_struct_type_di_node::{closure#0}::{closure#0} as core::ops::function::FnOnce<((usize, &rustc_middle::ty::FieldDef),)>>::call_once
  32: rustc_codegen_llvm::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm::debuginfo::metadata::build_struct_type_di_node::{closure#0}, rustc_codegen_llvm::debuginfo::metadata::build_struct_type_di_node::{closure#1}>
  33: rustc_codegen_llvm::debuginfo::metadata::type_di_node
  34: rustc_codegen_llvm::debuginfo::metadata::build_pointer_or_reference_di_node
  35: rustc_codegen_llvm::debuginfo::metadata::type_di_node
  36: <rustc_codegen_llvm::context::CodegenCx as rustc_codegen_ssa::traits::debuginfo::DebugInfoMethods>::dbg_scope_fn
  37: rustc_codegen_ssa::mir::codegen_mir::<rustc_codegen_llvm::builder::Builder>
  38: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  39: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::symbol::Symbol, rustc_codegen_ssa::ModuleCodegen<rustc_codegen_llvm::ModuleLlvm>>
  40: rustc_codegen_llvm::base::compile_codegen_unit
  41: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  42: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  43: <rustc_interface::passes::QueryContext>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box<dyn core::any::Any>, rustc_errors::ErrorGuaranteed>>
  44: <rustc_interface::queries::Queries>::ongoing_codegen
  45: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  46: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  47: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  48: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.61.0-nightly (52b34550a 2022-03-15) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C link-arg=-fuse-ld=lld

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

query stack during panic:
#0 [is_sized_raw] computing whether `dyn std::io::Write` is `Sized`
#1 [layout_of] computing layout of `*const dyn std::io::Write`
#2 [layout_of] computing layout of `core::ptr::unique::Unique<dyn std::io::Write>`
#3 [layout_of] computing layout of `alloc::boxed::Box<dyn std::io::Write>`
end of query stack
error: could not compile `tracing-subscriber`
warning: build failed, waiting for other jobs to finish...
error: build failed

@Sherlock-Holo Sherlock-Holo 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 Mar 16, 2022
@lqd
Copy link
Member

lqd commented Mar 16, 2022

This looks like a duplicate of #94998, so I'll close this one as such, and we can have all the information in the other one. Thanks a bunch for opening an issue!

@lqd lqd closed this as completed Mar 16, 2022
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