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: collect_and_partition_mono_items #96703

Closed
spookyvision opened this issue May 4, 2022 · 7 comments
Closed

ICE: collect_and_partition_mono_items #96703

spookyvision opened this issue May 4, 2022 · 7 comments
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

@spookyvision
Copy link
Contributor

Ohai! Unfortunately I wasn't able to reduce this further, it must be some warp voodoo causing this…

Code

/* Cargo.toml:

[package]
name = "ice-ice-baby"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1", features = ["full"] }
warp = "0.3"
hyper = "0.14"

*/
use std::{convert::Infallible, net::SocketAddr, sync::Arc};

use hyper::server::Server;
use tokio::sync::RwLock;
use warp::Filter;

type State = Arc<RwLock<usize>>;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let state = State::default();
    let state = warp::any().map(move || state.clone());

    let ws = warp::path("ws")
        .and(warp::ws())
        .and(state)
        .map(|ws: warp::ws::Ws, users| ws.on_upgrade(move |_socket| handle(users)));

    let index = warp::path::end().map(|| warp::reply::html(INDEX_HTML));
    let routes = index.or(ws);

    let cors = warp::cors().build();
    let service = warp::service(routes.with(cors));

    let make_svc = hyper::service::make_service_fn(|_: _| {
        let svc = service.clone();
        async move { Ok::<_, Infallible>(svc) }
    });

    let sa: SocketAddr = "0.0.0.0:3030".parse().unwrap();
    let server = Server::bind(&sa);
    server.serve(make_svc).await?;

    Ok(())
}

async fn handle(state: State) {
    state.write().await;
}

static INDEX_HTML: &str = "";

Meta

rustc --version --verbose:

rustc 1.62.0-nightly (e1b71feb5 2022-05-03)
binary: rustc
commit-hash: e1b71feb592ba64805689e2b15b9fa570182c442
commit-date: 2022-05-03
host: x86_64-apple-darwin
release: 1.62.0-nightly
LLVM version: 14.0.1

Error output

Compiling ice-ice-baby v0.1.0 (/Users/ace/play/laserver_ice)
error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:1053:22: unexpected unsized tail: hyper::server::conn::spawn_all::State<hyper::server::conn::AddrStream, std::future::from_generator::GenFuture<[static generator@src/main.rs:40:20: 40:48]>, warp::filter::service::FilteredService<warp::cors::internal::CorsFilter<warp::filter::or::Or<warp::filter::map::Map<warp::filter::FilterFn<[closure@warp::path::end::{closure#0}]>, [closure@src/main.rs:32:39: 32:71]>, warp::filter::map::Map<warp::filter::and::And<warp::filter::and::And<warp::path::Exact<warp::path::internal::Opaque<&str>>, warp::filter::map::Map<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::get::{closure#0}]>::{closure#0}]>, warp::filter::untuple_one::UntupleOne<warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::header::header2<headers::common::connection::Connection>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<headers::common::connection::Connection, warp::Rejection>>>::{closure#0}]>, [closure@warp::ws::{closure#0}]>>>, warp::filter::FilterFn<[closure@warp::header::exact_ignore_case::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::header::exact::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::header::header2<headers::common::sec_websocket_key::SecWebsocketKey>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<headers::common::sec_websocket_key::SecWebsocketKey, warp::Rejection>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::ws::on_upgrade::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<hyper::upgrade::OnUpgrade>, warp::Rejection>>>::{closure#0}]>>, [closure@warp::ws::{closure#1}]>>, warp::filter::map::Map<warp::filters::any::Any, [closure@src/main.rs:25:33: 25:54]>>, [closure@src/main.rs:30:14: 30:83]>>>>, hyper::common::exec::Exec, hyper::server::conn::spawn_all::NoopWatcher>

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/e1b71feb592ba64805689e2b15b9fa570182c442/compiler/rustc_errors/src/lib.rs:1324:9
stack backtrace:
(see below)

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.62.0-nightly (e1b71feb5 2022-05-03) running on x86_64-apple-darwin

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

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

query stack during panic:
#0 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: could not compile `ice-ice-baby`
Backtrace

0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::bug::<&alloc::string::String>
   3: <rustc_errors::Handler>::bug::<&alloc::string::String>
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, ()>
   5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_monomorphize::collector::find_vtable_types_for_unsizing
   8: <rustc_monomorphize::collector::MirNeighborCollector as rustc_middle::mir::visit::Visitor>::visit_rvalue
   9: rustc_monomorphize::collector::collect_neighbours
  10: rustc_monomorphize::collector::collect_items_rec
  11: rustc_monomorphize::collector::collect_items_rec
  12: rustc_monomorphize::collector::collect_items_rec
  13: rustc_monomorphize::collector::collect_items_rec
  14: rustc_monomorphize::collector::collect_items_rec
  15: rustc_monomorphize::collector::collect_items_rec
  16: rustc_monomorphize::collector::collect_items_rec
  17: rustc_monomorphize::collector::collect_items_rec
  18: rustc_monomorphize::collector::collect_items_rec
  19: rustc_monomorphize::collector::collect_items_rec
  20: rustc_monomorphize::collector::collect_items_rec
  21: rustc_monomorphize::collector::collect_items_rec
  22: rustc_monomorphize::collector::collect_items_rec
  23: rustc_monomorphize::collector::collect_items_rec
  24: rustc_monomorphize::collector::collect_items_rec
  25: rustc_monomorphize::collector::collect_items_rec
  26: rustc_monomorphize::collector::collect_items_rec
  27: <rustc_session::session::Session>::time::<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}>
  28: rustc_monomorphize::collector::collect_crate_mono_items
  29: rustc_monomorphize::partitioning::collect_and_partition_mono_items
  30: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), (&std::collections::hash::set::HashSet<rustc_span::def_id::DefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, &[rustc_middle::mir::mono::CodegenUnit])>
  31: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), (&std::collections::hash::set::HashSet<rustc_span::def_id::DefId, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>, &[rustc_middle::mir::mono::CodegenUnit])>>
  32: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::collect_and_partition_mono_items, rustc_query_impl::plumbing::QueryCtxt>
  33: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_and_partition_mono_items
  34: rustc_codegen_ssa::base::codegen_crate::<rustc_codegen_llvm::LlvmCodegenBackend>
  35: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  36: <rustc_session::session::Session>::time::<alloc::boxed::Box<dyn core::any::Any>, rustc_interface::passes::start_codegen::{closure#0}>
  37: <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>>
  38: <rustc_interface::queries::Queries>::ongoing_codegen
  39: <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>>
  40: 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}>
  41: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  42: <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.

@spookyvision spookyvision 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 4, 2022
@spookyvision
Copy link
Contributor Author

addendum, exact version of deps:

[dependencies]
tokio = { version = "=1.18.1", features = ["full"] }
warp = "=0.3.2"
hyper = "=0.14.18"

@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label May 5, 2022
@Badel2
Copy link
Contributor

Badel2 commented May 6, 2022

Unable to reproduce:

rustc 1.62.0-nightly (30f386087 2022-05-05)
binary: rustc
commit-hash: 30f386087564243ab88a93c984c265290a31580b
commit-date: 2022-05-05
host: x86_64-unknown-linux-gnu
release: 1.62.0-nightly
LLVM version: 14.0.1

Maybe it's an issue related to the x86_64-apple-darwin target?

@steffahn
Copy link
Member

I can reproduce it on nightly-2022-05-04-x86_64-unknown-linux-gnu, so it’s not apple-darwin specific.

@steffahn
Copy link
Member

Appears to have disappeared in nightly-2022-07-09. Bisection for the commit is still running.

@steffahn
Copy link
Member

searched nightlies: from nightly-2022-05-04 to nightly-2022-08-26
regressed nightly: nightly-2022-07-09
searched commit range: 1517f5d...06754d8
regressed commit: 052495d

bisected with cargo-bisect-rustc v0.6.4

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc github --start 2022-05-04 --end nightly-2022-08-26 --regress non-ice

Which is #98614, though that PR fixes an issue with a different-looking ICE and a soundness issue…

@steffahn
Copy link
Member

steffahn commented Aug 28, 2022

Bisecting the other way shows that this ICE was also a regression. Precisely at #94081 like the two issues fixed by #98614. So I suppose I think it’s fairly safe to assume that this issue has been properly fixed, too? cc @oli-obk.

@rustbot label -E-needs-mcve. (because if this is fixed, the effort of minimization might not be worth it…)

@rustbot rustbot removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 28, 2022
@rustbot
Copy link
Collaborator

rustbot commented Aug 28, 2022

Error: Parsing relabel command in comment failed: ...'needs-mcve' | error: a label delta at >| ' (because '...

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@oli-obk oli-obk closed this as completed Aug 31, 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

6 participants