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

Internal compiler error with warp server + CORS in library referenced from binary #105171

Closed
rossng opened this issue Dec 2, 2022 · 4 comments
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@rossng
Copy link

rossng commented Dec 2, 2022

Code

Minimal reproduction repo

Meta

Nightly

The bug was introduced in nightly-2022-11-20 (tested by bisecting nightlies from rustup). The previous day works fine.

First broken version:

rustc --version --verbose:

rustc 1.67.0-nightly (c5d82ed7a 2022-11-19)
binary: rustc
commit-hash: c5d82ed7a4ad94a538bb87e5016e7d5ce0bd434b
commit-date: 2022-11-19
host: aarch64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

Last working version:
rustc --version --verbose

rustc 1.67.0-nightly (b833ad56f 2022-11-18)
binary: rustc
commit-hash: b833ad56f46a0bbe0e8729512812a161e7dae28a
commit-date: 2022-11-18
host: aarch64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

Beta

rustc --version --verbose:

rustc 1.66.0-beta.2 (0040709e3 2022-11-20)
binary: rustc
commit-hash: 0040709e39bfa159d099ee14628ad4ac72f91406
commit-date: 2022-11-20
host: aarch64-apple-darwin
release: 1.66.0-beta.2
LLVM version: 15.0.2

No error.

Stable

rustc --version --verbose:

rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: aarch64-apple-darwin
release: 1.65.0
LLVM version: 15.0.0

No error.

Error output

Attached as a file because it's too long!

2022-12-rust-ice.txt

Here's a taste of the error output:

warning: Error finalizing incremental compilation session directory `/Users/ross/Projects/2022-12-rust-ice-repro/target/debug/incremental/app-1h19fwfbfapnj/s-gfyl3ekz1u-1rggnpp-working`: No such file or directory (os error 2)

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in DropGlue(DefId(2:2801 ~ core[7323]::ptr::drop_in_place), Some(hyper::server::server::new_svc::State<hyper::server::tcp::addr_stream::AddrStream, futures_util::future::ready::Ready<std::result::Result<hyper::service::util::ServiceFn<[closure@warp::server::Server<warp::filters::cors::internal::CorsFilter<warp::filter::or::Or<warp::filter::and_then::AndThen<warp::filter::and::And<warp::filter::and::And<warp::filter::unify::Unify<warp::filter::or::Or<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::head::{closure#0}]>::{closure#0}]>>>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::path::tail::{closure#0}]>, [closure@warp::filters::fs::path_from_tail::{closure#0}]>>, warp::filter::map::Map<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_modified_since::IfModifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_modified_since::IfModifiedSince>, std::convert::Infallible>>>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_unmodified_since::IfUnmodifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_unmodified_since::IfUnmodifiedSince>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_range::IfRange>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_range::IfRange>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::range::Range>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::range::Range>, std::convert::Infallible>>>::{closure#0}]>>, [closure@warp::filters::fs::conditionals::{closure#0}]>>, fn(warp::filters::fs::ArcPath, warp::filters::fs::Conditionals) -> impl std::future::Future<Output = std::result::Result<warp::filters::fs::File, warp::reject::Rejection>> + std::marker::Send {warp::filters::fs::file_reply}>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, fn() -> impl std::future::Future<Output = std::result::Result<impl warp::reply::Reply, std::convert::Infallible>> {server::serve_foo}>>>>::bind_ephemeral<([u8; 4], u16)>::{closure#1}::{closure#0}::{closure#0}], hyper::body::body::Body>, std::convert::Infallible>>, hyper::service::util::ServiceFn<[closure@warp::server::Server<warp::filters::cors::internal::CorsFilter<warp::filter::or::Or<warp::filter::and_then::AndThen<warp::filter::and::And<warp::filter::and::And<warp::filter::unify::Unify<warp::filter::or::Or<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::head::{closure#0}]>::{closure#0}]>>>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::path::tail::{closure#0}]>, [closure@warp::filters::fs::path_from_tail::{closure#0}]>>, warp::filter::map::Map<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_modified_since::IfModifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_modified_since::IfModifiedSince>, std::convert::Infallible>>>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_unmodified_since::IfUnmodifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_unmodified_since::IfUnmodifiedSince>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_range::IfRange>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_range::IfRange>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::range::Range>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::range::Range>, std::convert::Infallible>>>::{closure#0}]>>, [closure@warp::filters::fs::conditionals::{closure#0}]>>, fn(warp::filters::fs::ArcPath, warp::filters::fs::Conditionals) -> impl std::future::Future<Output = std::result::Result<warp::filters::fs::File, warp::reject::Rejection>> + std::marker::Send {warp::filters::fs::file_reply}>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, fn() -> impl std::future::Future<Output = std::result::Result<impl warp::reply::Reply, std::convert::Infallible>> {server::serve_foo}>>>>::bind_ephemeral<([u8; 4], u16)>::{closure#1}::{closure#0}::{closure#0}], hyper::body::body::Body>, hyper::common::exec::Exec, hyper::server::server::NoopWatcher>)) (after phase change to runtime-optimized) at bb3[0]:
                                Field projection `((*_1) as Connected).field[0]` specified type `hyper::server::conn::upgrades::UpgradeableConnection<hyper::server::tcp::addr_stream::AddrStream, hyper::service::util::ServiceFn<[closure@warp::server::Server<warp::filters::cors::internal::CorsFilter<warp::filter::or::Or<warp::filter::and_then::AndThen<warp::filter::and::And<warp::filter::and::And<warp::filter::unify::Unify<warp::filter::or::Or<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::head::{closure#0}]>::{closure#0}]>>>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::path::tail::{closure#0}]>, [closure@warp::filters::fs::path_from_tail::{closure#0}]>>, warp::filter::map::Map<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_modified_since::IfModifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_modified_since::IfModifiedSince>, std::convert::Infallible>>>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_unmodified_since::IfUnmodifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_unmodified_since::IfUnmodifiedSince>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_range::IfRange>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_range::IfRange>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::range::Range>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::range::Range>, std::convert::Infallible>>>::{closure#0}]>>, [closure@warp::filters::fs::conditionals::{closure#0}]>>, fn(warp::filters::fs::ArcPath, warp::filters::fs::Conditionals) -> impl std::future::Future<Output = std::result::Result<warp::filters::fs::File, warp::reject::Rejection>> + std::marker::Send {warp::filters::fs::file_reply}>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, fn() -> impl std::future::Future<Output = std::result::Result<impl warp::reply::Reply, std::convert::Infallible>> {server::serve_foo}>>>>::bind_ephemeral<([u8; 4], u16)>::{closure#1}::{closure#0}::{closure#0}], hyper::body::body::Body>, hyper::common::exec::Exec>`, but actual type is `<hyper::server::server::NoopWatcher as hyper::server::server::Watcher<hyper::server::tcp::addr_stream::AddrStream, hyper::service::util::ServiceFn<[closure@warp::server::Server<warp::filters::cors::internal::CorsFilter<warp::filter::or::Or<warp::filter::and_then::AndThen<warp::filter::and::And<warp::filter::and::And<warp::filter::unify::Unify<warp::filter::or::Or<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::head::{closure#0}]>::{closure#0}]>>>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::path::tail::{closure#0}]>, [closure@warp::filters::fs::path_from_tail::{closure#0}]>>, warp::filter::map::Map<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_modified_since::IfModifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_modified_since::IfModifiedSince>, std::convert::Infallible>>>::{closure#0}]>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_unmodified_since::IfUnmodifiedSince>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_unmodified_since::IfUnmodifiedSince>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::if_range::IfRange>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::if_range::IfRange>, std::convert::Infallible>>>::{closure#0}]>>, warp::filter::FilterFn<[closure@warp::filter::filter_fn_one<[closure@warp::filters::header::optional2<headers::common::range::Range>::{closure#0}], futures_util::future::ready::Ready<std::result::Result<std::option::Option<headers::common::range::Range>, std::convert::Infallible>>>::{closure#0}]>>, [closure@warp::filters::fs::conditionals::{closure#0}]>>, fn(warp::filters::fs::ArcPath, warp::filters::fs::Conditionals) -> impl std::future::Future<Output = std::result::Result<warp::filters::fs::File, warp::reject::Rejection>> + std::marker::Send {warp::filters::fs::file_reply}>, warp::filter::and_then::AndThen<warp::filter::FilterFn<[closure@warp::filters::method::method_is<[closure@warp::filters::method::get::{closure#0}]>::{closure#0}]>, fn() -> impl std::future::Future<Output = std::result::Result<impl warp::reply::Reply, std::convert::Infallible>> {server::serve_foo}>>>>::bind_ephemeral<([u8; 4], u16)>::{closure#1}::{closure#0}::{closure#0}], hyper::body::body::Body>, hyper::common::exec::Exec>>::Future`
  |
  = note: delayed at compiler/rustc_const_eval/src/transform/validate.rs:88:36
Backtrace

stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::flush_delayed::<alloc::vec::Vec<rustc_errors::diagnostic::Diagnostic>, &str>
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place::<rustc_session::parse::ParseSess>
   5: core::ptr::drop_in_place::<rustc_session::session::Session>
   6: core::ptr::drop_in_place::<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
   8: <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.

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.67.0-nightly (c090c6880 2022-12-01) running on aarch64-apple-darwin

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

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

query stack during panic:
end of query stack

@rossng rossng 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 2, 2022
@albertlarsan68
Copy link
Member

searched nightlies: from nightly-2022-11-18 to nightly-2022-11-20
regressed nightly: nightly-2022-11-20
searched commit range: b833ad5...c5d82ed
regressed commit: 2f8d804 (pr #104600)

bisected with cargo-bisect-rustc v0.6.4

Host triple: x86_64-pc-windows-msvc
Reproduce with:

cargo bisect-rustc --access=github --start 2022-11-18 --end 2022-11-20 --regress=ice -- build

@workingjubilee
Copy link
Contributor

@lcnr @BoxyUwU It's hard to tell due to the rollup which PR is responsible but I am guessing one of you might want to take a look at this.

@lcnr lcnr added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Dec 6, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Dec 6, 2022
@apiraino
Copy link
Contributor

apiraino commented Dec 7, 2022

I see a number of issues with this error and they point to #105009. I'd close this as duplicate, makes sense?

(as per other bisections, the PR responsible could be #104411)

@apiraino
Copy link
Contributor

apiraino commented Dec 8, 2022

Closing in favor or #105009

@apiraino apiraino closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2022
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Dec 8, 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) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. 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