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

Compiler error during compilation of combine (Docker rust:latest, aarch64, nightly) #107684

Closed
HerrMuellerluedenscheid opened this issue Feb 5, 2023 · 0 comments · Fixed by #107688
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

@HerrMuellerluedenscheid
Copy link

Hi,
Thanks for building my most loved programming language! I encountered a compilation error building combine=4.6.6 in a docker container (rust:latest) on toolchain nightly. It does not happen on the host system but only in the docker build. I am not entirely sure if I should rather open an issue over at the rust docker repo. If yes, let me know.

Code

I boiled it down to the combine crate. I attached a minimalistic crate example (combine-bug.zip). Run

docker build

on a M1.

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (50d3ba5bc 2023-02-04)
binary: rustc
commit-hash: 50d3ba5bcbf5c7e13d4ce068d3339710701dd603
commit-date: 2023-02-04
host: aarch64-unknown-linux-gnu
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

   Compiling combine v4.6.6
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[ba33]::stream::{impl#47}::reset), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                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>
   --> /usr/local/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
Backtrace

root@ca48a006b8bf:~/bug/bug-report# cargo build
   Compiling combine v4.6.6
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[ba33]::stream::{impl#47}::reset), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                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>
   --> /usr/local/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: std::backtrace_rs::backtrace::libunwind::trace
                         at /rustc/50d3ba5bcbf5c7e13d4ce068d3339710701dd603/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
               1: std::backtrace_rs::backtrace::trace_unsynchronized
                         at /rustc/50d3ba5bcbf5c7e13d4ce068d3339710701dd603/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
               2: std::backtrace::Backtrace::create
                         at /rustc/50d3ba5bcbf5c7e13d4ce068d3339710701dd603/library/std/src/backtrace.rs:332:13
               3: <rustc_errors::HandlerInner>::emit_diagnostic
               4: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
               5: <rustc_const_eval::transform::validate::TypeChecker>::fail::<alloc::string::String>
               6: <rustc_const_eval::transform::validate::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
               7: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
               8: rustc_mir_transform::pass_manager::run_passes_inner
               9: rustc_mir_transform::optimized_mir
              10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::optimized_mir, rustc_query_impl::plumbing::QueryCtxt>
              11: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::optimized_mir, rustc_query_impl::plumbing::QueryCtxt, rustc_middle::dep_graph::dep_node::DepKind>
              12: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
              13: rustc_metadata::rmeta::encoder::encode_metadata_impl
              14: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
              15: rustc_metadata::rmeta::encoder::encode_metadata
              16: rustc_metadata::fs::encode_and_write_metadata
              17: rustc_interface::passes::start_codegen
              18: <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>>
              19: <rustc_interface::queries::Queries>::ongoing_codegen
              20: <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>>
              21: 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}>
              22: <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>>
              23: 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>>
              24: <<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}
              25: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                         at /rustc/50d3ba5bcbf5c7e13d4ce068d3339710701dd603/library/alloc/src/boxed.rs:1988:9
              26: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                         at /rustc/50d3ba5bcbf5c7e13d4ce068d3339710701dd603/library/alloc/src/boxed.rs:1988:9
              27: std::sys::unix::thread::Thread::new::thread_start
                         at /rustc/50d3ba5bcbf5c7e13d4ce068d3339710701dd603/library/std/src/sys/unix/thread.rs:108:17
              28: start_thread
              29: <unknown>

    = 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 (50d3ba5bc 2023-02-04) running on aarch64-unknown-linux-gnu

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

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

query stack during panic:
end of query stack
error: could not compile `combine`

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

Successfully merging a pull request may close this issue.

1 participant