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] in cargo test, no errors encountered even though delay_span_bug issued #107759

Closed
davecb opened this issue Feb 7, 2023 · 3 comments
Closed
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

@davecb
Copy link

davecb commented Feb 7, 2023

This is my first Rust bug report, so please bear with me (:-))
As of yesterday and today only, I get this bug when running cargo test, not cargo build

The command sequence is

rm -rf coverage
RUSTFLAGS="-Cinstrument-coverage" \
  LLVM_PROFILE_FILE="rivr-%p-%m.profraw" \
  RUST_BACKTRACE=1 \
  cargo test 

Code

The code the message points at is /home/davecb/.cargo/registry/src/github.com-1ecc6299db9ec823/combine-4.6.6/src/stream/mod.rs:44:17, the line with just Ok(())

macro_rules! clone_resetable {
    (( $($params: tt)* ) $ty: ty) => {
        impl<$($params)*> ResetStream for $ty
            where Self: StreamOnce
        {
            type Checkpoint = Self;

            fn checkpoint(&self) -> Self {
                self.clone()
            }
            #[inline]
            fn reset(&mut self, checkpoint: Self) -> Result<(), Self::Error> {
                *self = checkpoint;
                Ok(())
            }
        }
    }

Meta

I'm ruinning nightly, and

rustc --version --verbose:

rustc 1.69.0-nightly (e1eaa2d5d 2023-02-06)
binary: rustc
commit-hash: e1eaa2d5d4d1f5b7b89561a940718058d414e89c
commit-date: 2023-02-06
host: x86_64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

make: Entering directory '/home/davecb/go/src/gitlab.indexexchange.com/machine-learning-optimization/rivr-rust-library'
rm -rf coverage
RUSTFLAGS="-Cinstrument-coverage" \
LLVM_PROFILE_FILE="rivr-%p-%m.profraw" \
RUST_BACKTRACE=1 \
cargo test # this currently exits with  = 101
   Compiling serde v1.0.152
   Compiling tokio-util v0.7.4
   Compiling futures-util v0.3.26
   Compiling openssl v0.10.45
   Compiling openssl-sys v0.9.80
   Compiling native-tls v0.2.11
   Compiling thiserror v1.0.38
   Compiling prost v0.11.6
   Compiling zstd-safe v6.0.3+zstd.1.5.2
   Compiling zstd-sys v2.0.6+zstd.1.5.2
   Compiling actix-rt v2.8.0
   Compiling lz4-sys v1.9.4
   Compiling combine v4.6.6
   Compiling pin-project v1.0.12
   Compiling multiversion v0.6.1
   Compiling deepsize v0.2.0
   Compiling actix-macros v0.2.3
   Compiling static_init v1.0.3
   Compiling flatbuffers v22.9.29
   Compiling tokio-retry v0.3.0
   Compiling lz4 v1.24.0
   Compiling lasso v0.6.0
   Compiling zstd v0.12.3+zstd.1.5.2
   Compiling prost-types v0.11.6
   Compiling actix-codec v0.5.0
   Compiling prost-build v0.11.6
   Compiling rivr-rust-library v0.13.1 (/home/davecb/go/src/gitlab.indexexchange.com/machine-learning-optimization/rivr-rust-library)
   Compiling h2 v0.3.15
   Compiling futures-executor v0.3.26
   Compiling local-channel v0.1.3
   Compiling actix-server v2.2.0
   Compiling chrono v0.4.23
   Compiling serde_json v1.0.92
   Compiling bstr v0.2.17
   Compiling serde_urlencoded v0.7.1
   Compiling halfbrown v0.1.18
   Compiling actix-router v0.5.1
   Compiling serde_v8 v0.54.0
   Compiling futures v0.3.26
   Compiling humantime-serde v1.1.1
   Compiling value-trait v0.5.1
   Compiling csv v1.1.6
   Compiling actix-web-codegen v4.1.0
   Compiling simd-json v0.7.0
   Compiling tokio-native-tls v0.3.0
   Compiling arrow-array v29.0.0
   Compiling redis v0.22.3
   Compiling jni v0.20.0
   Compiling arrow-select v29.0.0
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:3469 ~ combine[2ef6]::stream::{impl#47}::reset), const_param_did: None }) (after phase change to runtime-optimized) at bb0[3]:
                                encountered `Assign((_0, const Result::<(), StringStreamError>::Ok(())))` with incompatible types:
                                left-hand side has type: Result<(), <&str as StreamOnce>::Error>
                                right-hand side has type: Result<(), StringStreamError>
   --> /home/davecb/.cargo/registry/src/github.com-1ecc6299db9ec823/combine-4.6.6/src/stream/mod.rs:44:17
    |
44  |                 Ok(())
    |                 ^^^^^^
...
153 | clone_resetable! {('a) &'a str}
    | ------------------------------- in this macro invocation
    |
    = note: delayed at    0: <rustc_errors::HandlerInner>::emit_diagnostic
               1: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
               2: <rustc_const_eval::transform::validate::TypeChecker>::fail::<alloc::string::String>
               3: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
               4: rustc_mir_transform::optimized_mir
               5: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::optimized_mir, rustc_query_impl::plumbing::QueryCtxt>
               6: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
               7: rustc_metadata::rmeta::encoder::encode_metadata_impl
               8: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
               9: rustc_metadata::rmeta::encoder::encode_metadata
              10: rustc_metadata::fs::encode_and_write_metadata
              11: rustc_interface::passes::start_codegen
              12: <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>>
              13: <rustc_interface::queries::Queries>::ongoing_codegen
              14: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
              15: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
              16: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
              17: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
              18: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
              19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                         at /rustc/e1eaa2d5d4d1f5b7b89561a940718058d414e89c/library/alloc/src/boxed.rs:1988:9
              20: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                         at /rustc/e1eaa2d5d4d1f5b7b89561a940718058d414e89c/library/alloc/src/boxed.rs:1988:9
              21: std::sys::unix::thread::Thread::new::thread_start
                         at /rustc/e1eaa2d5d4d1f5b7b89561a940718058d414e89c/library/std/src/sys/unix/thread.rs:108:17
              22: start_thread
                         at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
              23: clone
                         at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            
    = note: this error: internal compiler error originates in the macro `clone_resetable` (in Nightly builds, run with -Z macro-backtrace for more info)

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.69.0-nightly (e1eaa2d5d 2023-02-06) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C instrument-coverage

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

query stack during panic:
end of query stack
error: could not compile `combine`
warning: build failed, waiting for other jobs to finish...

Backtrace

Please see above

@davecb davecb 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 Feb 7, 2023
@davecb davecb changed the title [ICE] in cargpo test, no errors encountered even though delay_span_bug issued [ICE] in cargo test, no errors encountered even though delay_span_bug issued Feb 7, 2023
@davecb
Copy link
Author

davecb commented Feb 7, 2023

Stripping the coverage flags had no effect on the result.

If there are other experiments you'd like done, please email me at any of

@clubby789
Copy link
Contributor

This is a recent regression; #107678

@davecb
Copy link
Author

davecb commented Feb 7, 2023

Much appreciated: feel free to close this is it's a duplicate or doesn't contribute to the investigation, I'll subscribe to 107678

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

3 participants