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: index out of bounds #120554

Closed
frederickjjoubert opened this issue Feb 1, 2024 · 4 comments
Closed

ICE: index out of bounds #120554

frederickjjoubert opened this issue Feb 1, 2024 · 4 comments
Assignees
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

@frederickjjoubert
Copy link

Code

I'm following along with the code from this webinar:

I cloned the repo, cargo build works fine.

When I run cargo test to run the project unit tests, the error/compiler panic occurs.

The unit tests are here: https://github.com/thebracket/webinar_axumcrud/blob/master/src/db.rs#L151

Meta

rustc --version --verbose:

jacques@pop-os:~/Code/rust/webinar_axumcrud$ rustc --version --verbose
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6

Error output

jacques@pop-os:~/Code/rust/webinar_axumcrud$ cargo test
   Compiling hyper v0.14.27
   Compiling sqlx-macros v0.7.2
thread 'rustc' panicked at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/compiler/rustc_serialize/src/opaque.rs:233:42:
range start index 6084809 out of range for slice of length 4194304
stack backtrace:
   0:     0x73d377f8b62c - std::backtrace_rs::backtrace::libunwind::trace::ha637c64ce894333a
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x73d377f8b62c - std::backtrace_rs::backtrace::trace_unsynchronized::h47f62dea28e0c88d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x73d377f8b62c - std::sys_common::backtrace::_print_fmt::h9eef0abe20ede486
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x73d377f8b62c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed7f999df88cc644
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x73d377fde630 - core::fmt::rt::Argument::fmt::h1539a9308b8d058d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/rt.rs:142:9
   5:     0x73d377fde630 - core::fmt::write::h3a39390d8560d9c9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/mod.rs:1120:17
   6:     0x73d377f7f54f - std::io::Write::write_fmt::h5fc9997dfe05f882
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/io/mod.rs:1762:15
   7:     0x73d377f8b414 - std::sys_common::backtrace::_print::h894006fb5c6f3d45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x73d377f8b414 - std::sys_common::backtrace::print::h23a2d212c6fff936
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x73d377f8e0a7 - std::panicking::default_hook::{{closure}}::h8a1d2ee00185001a
  10:     0x73d377f8de0f - std::panicking::default_hook::h6038f2eba384e475
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:292:9
thread 'rustc' panicked at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/compiler/rustc_serialize/src/opaque.rs:233:42:
range start index 6084682 out of range for slice of length 4194304
stack backtrace:
  11:     0x73d37ab37190 - std[409886f6357001f0]::panicking::update_hook::<alloc[c1b021ad36e35877]::boxed::Box<rustc_driver_impl[7d23c5715ff089db]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x73d377f8e7e8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1f8f335eaa9cfaee
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2021:9
  13:     0x73d377f8e7e8 - std::panicking::rust_panic_with_hook::h2b5517d590cab22e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:783:13
  14:     0x73d377f8e53e - std::panicking::begin_panic_handler::{{closure}}::h233112c06e0ef43e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:657:13
  15:     0x73d377f8baf6 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e893f24d7ebbff8
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x73d377f8e2a2 - rust_begin_unwind
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
  17:     0x73d377fdad15 - core::panicking::panic_fmt::hbf0e066aabfa482c
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
  18:     0x73d377fe0f62 - core::slice::index::slice_start_index_len_fail_rt::h2cff72a74e55bc89
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:52:5
  19:     0x73d377fe0f62 - core::slice::index::slice_start_index_len_fail::h89a39d0ac724bb0b
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:40:9
  20:     0x73d37c946011 - <rustc_metadata[21a965c5240b0d]::locator::CrateLocator>::extract_one
  21:     0x73d37c944cca - <rustc_metadata[21a965c5240b0d]::locator::CrateLocator>::extract_lib
  22:     0x73d37c943315 - <rustc_metadata[21a965c5240b0d]::locator::CrateLocator>::find_library_crate
  23:     0x73d37c89bf12 - <rustc_metadata[21a965c5240b0d]::creader::CrateLoader>::load
  24:     0x73d37ca8b690 - <rustc_metadata[21a965c5240b0d]::creader::CrateLoader>::maybe_resolve_crate
  25:     0x73d37ca8be0b - <rustc_metadata[21a965c5240b0d]::creader::CrateLoader>::maybe_resolve_crate
  26:     0x73d37ca8be0b - <rustc_metadata[21a965c5240b0d]::creader::CrateLoader>::maybe_resolve_crate
  27:     0x73d37c41765b - <rustc_resolve[ec47402b5e317cbf]::Resolver>::early_resolve_ident_in_lexical_scope
  28:     0x73d37c4ed787 - <rustc_resolve[ec47402b5e317cbf]::Resolver>::resolve_path_with_ribs
  29:     0x73d37c8ee6a2 - <rustc_resolve[ec47402b5e317cbf]::Resolver as rustc_expand[76cb781f6d4c8c2e]::base::ResolverExpand>::resolve_imports
  30:     0x73d37c6ef71a - <rustc_expand[76cb781f6d4c8c2e]::expand::MacroExpander>::fully_expand_fragment
  31:     0x73d37c572b26 - <rustc_expand[76cb781f6d4c8c2e]::expand::MacroExpander>::expand_crate
  32:     0x73d37ca9bc21 - rustc_interface[fbb0cb4be6c0ba34]::passes::resolver_for_lowering
  33:     0x73d37ca9af89 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  34:     0x73d37cb068e5 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::SingleCache<rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, false>
  35:     0x73d37cb06fc9 - rustc_query_impl[664ae873a521fa7c]::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
  36:     0x73d37cc06e46 - rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler::<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}
  37:     0x73d37cc0215b - std[409886f6357001f0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[fbb0cb4be6c0ba34]::util::run_in_thread_with_globals<rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>
  38:     0x73d37cc01fb3 - <<std[409886f6357001f0]::thread::Builder>::spawn_unchecked_<rustc_interface[fbb0cb4be6c0ba34]::util::run_in_thread_with_globals<rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#1} as core[21cdcf8e8af4c2d9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x73d377f986a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc7eafaff61e32df9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
  40:     0x73d377f986a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6ba4a5de48dd2304
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
  41:     0x73d377f986a5 - std::sys::unix::thread::Thread::new::thread_start::he469335aef763e45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/thread.rs:108:17
  42:     0x73d377c94ac3 - <unknown>
  43:     0x73d377d26850 - <unknown>
  44:                0x0 - <unknown>

   0:     0x775202d8b62c - std::backtrace_rs::backtrace::libunwind::trace::ha637c64ce894333a
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x775202d8b62c - std::backtrace_rs::backtrace::trace_unsynchronized::h47f62dea28e0c88d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x775202d8b62c - std::sys_common::backtrace::_print_fmt::h9eef0abe20ede486
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x775202d8b62c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed7f999df88cc644
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:44:22
error: 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.75.0 (82e1608df 2023-12-21) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type proc-macro -C prefer-dynamic -C embed-bitcode=no

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

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
   4:     0x775202dde630 - core::fmt::rt::Argument::fmt::h1539a9308b8d058d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/rt.rs:142:9
   5:     0x775202dde630 - core::fmt::write::h3a39390d8560d9c9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/mod.rs:1120:17
   6:     0x775202d7f54f - std::io::Write::write_fmt::h5fc9997dfe05f882
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/io/mod.rs:1762:15
   7:     0x775202d8b414 - std::sys_common::backtrace::_print::h894006fb5c6f3d45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x775202d8b414 - std::sys_common::backtrace::print::h23a2d212c6fff936
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x775202d8e0a7 - std::panicking::default_hook::{{closure}}::h8a1d2ee00185001a
  10:     0x775202d8de0f - std::panicking::default_hook::h6038f2eba384e475
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:292:9
error: could not compile `sqlx-macros` (lib)
warning: build failed, waiting for other jobs to finish...
  11:     0x775205937190 - std[409886f6357001f0]::panicking::update_hook::<alloc[c1b021ad36e35877]::boxed::Box<rustc_driver_impl[7d23c5715ff089db]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x775202d8e7e8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1f8f335eaa9cfaee
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2021:9
  13:     0x775202d8e7e8 - std::panicking::rust_panic_with_hook::h2b5517d590cab22e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:783:13
  14:     0x775202d8e53e - std::panicking::begin_panic_handler::{{closure}}::h233112c06e0ef43e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:657:13
  15:     0x775202d8baf6 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e893f24d7ebbff8
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x775202d8e2a2 - rust_begin_unwind
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
  17:     0x775202ddad15 - core::panicking::panic_fmt::hbf0e066aabfa482c
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
  18:     0x775202de0f62 - core::slice::index::slice_start_index_len_fail_rt::h2cff72a74e55bc89
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:52:5
  19:     0x775202de0f62 - core::slice::index::slice_start_index_len_fail::h89a39d0ac724bb0b
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:40:9
  20:     0x775207746011 - <rustc_metadata[21a965c5240b0d]::locator::CrateLocator>::extract_one
  21:     0x775207744cca - <rustc_metadata[21a965c5240b0d]::locator::CrateLocator>::extract_lib
  22:     0x77520769c5e9 - <rustc_metadata[21a965c5240b0d]::creader::CrateLoader>::load
  23:     0x77520788b690 - <rustc_metadata[21a965c5240b0d]::creader::CrateLoader>::maybe_resolve_crate
  24:     0x77520721765b - <rustc_resolve[ec47402b5e317cbf]::Resolver>::early_resolve_ident_in_lexical_scope
  25:     0x7752072ed787 - <rustc_resolve[ec47402b5e317cbf]::Resolver>::resolve_path_with_ribs
  26:     0x7752076ee6a2 - <rustc_resolve[ec47402b5e317cbf]::Resolver as rustc_expand[76cb781f6d4c8c2e]::base::ResolverExpand>::resolve_imports
  27:     0x7752074ef71a - <rustc_expand[76cb781f6d4c8c2e]::expand::MacroExpander>::fully_expand_fragment
  28:     0x775207372b26 - <rustc_expand[76cb781f6d4c8c2e]::expand::MacroExpander>::expand_crate
  29:     0x77520789bc21 - rustc_interface[fbb0cb4be6c0ba34]::passes::resolver_for_lowering
  30:     0x77520789af89 - rustc_query_impl[664ae873a521fa7c]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[664ae873a521fa7c]::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7752079068e5 - rustc_query_system[b5dcdc06a735d5f1]::query::plumbing::try_execute_query::<rustc_query_impl[664ae873a521fa7c]::DynamicConfig<rustc_query_system[b5dcdc06a735d5f1]::query::caches::SingleCache<rustc_middle[aca4860da4e5a967]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[664ae873a521fa7c]::plumbing::QueryCtxt, false>
  32:     0x775207906fc9 - rustc_query_impl[664ae873a521fa7c]::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
  33:     0x775207a06e46 - rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler::<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}
  34:     0x775207a0215b - std[409886f6357001f0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[fbb0cb4be6c0ba34]::util::run_in_thread_with_globals<rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>
  35:     0x775207a01fb3 - <<std[409886f6357001f0]::thread::Builder>::spawn_unchecked_<rustc_interface[fbb0cb4be6c0ba34]::util::run_in_thread_with_globals<rustc_interface[fbb0cb4be6c0ba34]::interface::run_compiler<core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>, rustc_driver_impl[7d23c5715ff089db]::run_compiler::{closure#1}>::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[21cdcf8e8af4c2d9]::result::Result<(), rustc_span[3d5dc97049ad8d50]::ErrorGuaranteed>>::{closure#1} as core[21cdcf8e8af4c2d9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x775202d986a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc7eafaff61e32df9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
  37:     0x775202d986a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6ba4a5de48dd2304
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs:2007:9
  38:     0x775202d986a5 - std::sys::unix::thread::Thread::new::thread_start::he469335aef763e45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/thread.rs:108:17
  39:     0x775202a94ac3 - <unknown>
  40:     0x775202b26850 - <unknown>
  41:                0x0 - <unknown>

error: 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.75.0 (82e1608df 2023-12-21) running on x86_64-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:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
error: could not compile `hyper` (lib)
Backtrace

jacques@pop-os:~/Code/rust/webinar_axumcrud$ RUST_BACKTRACE=1 cargo test
   Compiling hyper v0.14.27
   Compiling sqlx-macros v0.7.2
thread 'rustc' panicked at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/compiler/rustc_serialize/src/opaque.rs:233:42:
range start index 6084809 out of range for slice of length 4194304
stack backtrace:
thread 'rustc' panicked at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/compiler/rustc_serialize/src/opaque.rs:233:42:
range start index 6084682 out of range for slice of length 4194304
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: core::slice::index::slice_start_index_len_fail_rt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:52:5
   3: core::slice::index::slice_start_index_len_fail
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:40:9
   4: <rustc_metadata::locator::CrateLocator>::extract_one
   5: <rustc_metadata::locator::CrateLocator>::extract_lib
   6: <rustc_metadata::locator::CrateLocator>::find_library_crate
   7: <rustc_metadata::creader::CrateLoader>::load
   8: <rustc_metadata::creader::CrateLoader>::maybe_resolve_crate
   9: <rustc_metadata::creader::CrateLoader>::maybe_resolve_crate
  10: <rustc_metadata::creader::CrateLoader>::maybe_resolve_crate
  11: <rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope
  12: <rustc_resolve::Resolver>::resolve_path_with_ribs
  13: <rustc_resolve::Resolver as rustc_expand::base::ResolverExpand>::resolve_imports
  14: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  15: <rustc_expand::expand::MacroExpander>::expand_crate
  16: rustc_interface::passes::resolver_for_lowering
      [... omitted 1 frame ...]
  17: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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.75.0 (82e1608df 2023-12-21) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type proc-macro -C prefer-dynamic -C embed-bitcode=no

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

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
error: could not compile `sqlx-macros` (lib)
warning: build failed, waiting for other jobs to finish...
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: core::slice::index::slice_start_index_len_fail_rt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:52:5
   3: core::slice::index::slice_start_index_len_fail
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/index.rs:40:9
   4: <rustc_metadata::locator::CrateLocator>::extract_one
   5: <rustc_metadata::locator::CrateLocator>::extract_lib
   6: <rustc_metadata::creader::CrateLoader>::load
   7: <rustc_metadata::creader::CrateLoader>::maybe_resolve_crate
   8: <rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope
   9: <rustc_resolve::Resolver>::resolve_path_with_ribs
  10: <rustc_resolve::Resolver as rustc_expand::base::ResolverExpand>::resolve_imports
  11: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  12: <rustc_expand::expand::MacroExpander>::expand_crate
  13: rustc_interface::passes::resolver_for_lowering
      [... omitted 1 frame ...]
  14: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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.75.0 (82e1608df 2023-12-21) running on x86_64-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:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
error: could not compile `hyper` (lib)

@frederickjjoubert frederickjjoubert 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 1, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 1, 2024
@frederickjjoubert
Copy link
Author

Update: I ran cargo update and the error goes away.

@fmease fmease added A-incr-comp Area: Incremental compilation E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example A-async-await Area: Async & Await and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 1, 2024
@fmease fmease changed the title error: the compiler unexpectdly panicked error: the compiler unexpectedly panicked Feb 1, 2024
@Noratrieb Noratrieb added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Feb 1, 2024
@Noratrieb
Copy link
Member

Noratrieb commented Feb 1, 2024

@fmease we use S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. and not E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example for issues that do not have a reproduction, the latter is now intended only for issues which have a non-minimal reproduction (since we now want E- participation)

to the author: Thank you for opening the issue! But sadly we can't do anything without a reproduction. We'll keep it open for now in case someone figures out a reproduction, but as long as we don't have one, there is not much we can do.

@Noratrieb Noratrieb changed the title error: the compiler unexpectedly panicked Incremental ICE: index out of bounds Feb 1, 2024
@saethlin saethlin removed the A-incr-comp Area: Incremental compilation label Feb 3, 2024
@saethlin saethlin changed the title Incremental ICE: index out of bounds ICE: index out of bounds Feb 3, 2024
@saethlin saethlin removed the A-async-await Area: Async & Await label Feb 11, 2024
@saethlin saethlin self-assigned this Feb 11, 2024
@saethlin
Copy link
Member

I've been trying to work on a problem where running out of disk produces a broken rmeta file that crashes subsequent compilations. This issue report looks like that situation, which should be fixed by the combination of #117301 and #119510. I'll check back on this issue later.

@saethlin
Copy link
Member

I think the root cause of this issue was rustc incorrectly handling/reporting I/O errors. I've landed a number of PRs to address the problem; the most recent of those is #119510 which is now part of the latest stable toolchain, 1.77. Therefore, even though I have not reproduced exactly what you've reported here, I'm going to close this because I am reasonably confident that this bug is now fixed on stable.

Of course it is possible that I am wrong and the bug you've reported here is not fixed. If you happen to run into problems like this in 1.77 or later please do not hesitate to open a new issue.

@saethlin saethlin removed the S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. label Mar 27, 2024
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

5 participants