Skip to content

Building rustc using 1.69.0-nightly causes ICE #108745

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

Closed
stefins opened this issue Mar 4, 2023 · 1 comment
Closed

Building rustc using 1.69.0-nightly causes ICE #108745

stefins opened this issue Mar 4, 2023 · 1 comment
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

@stefins
Copy link

stefins commented Mar 4, 2023

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (44cfafe2f 2023-03-03)
binary: rustc
commit-hash: 44cfafe2fafe816395d3acc434663a45d5178c41
commit-date: 2023-03-03
host: aarch64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 83963 but the index is 83963', /Users/user/rust/compiler/rustc_serialize/src/leb128.rs:84:1
stack backtrace:
   0:        0x10537e0fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha53459bb6d4ff5af
   1:        0x1053ba93c - core::fmt::write::ha68623c3dae1f19c
   2:        0x10535058c - std::io::Write::write_fmt::h8b4aa58251300bed
   3:        0x10537df0c - std::sys_common::backtrace::print::hf6b477e8b0f24da8
   4:        0x10535769c - std::panicking::default_hook::{{closure}}::hdf638eb4797e9f83
   5:        0x105357360 - std::panicking::default_hook::h7d2e96dc1bd66553
thread 'rustc' panicked at 'index out of bounds: the len is 83963 but the index is 83963', /Users/rust/compiler/rustc_serialize/src/leb128.rs:84:1
Backtrace

thread 'rustc' panicked at 'index out of bounds: the len is 83963 but the index is 83963', /Users/user/rust/compiler/rustc_serialize/src/leb128.rs:84:1
stack backtrace:
   0:        0x10537e0fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha53459bb6d4ff5af
   1:        0x1053ba93c - core::fmt::write::ha68623c3dae1f19c
   2:        0x10535058c - std::io::Write::write_fmt::h8b4aa58251300bed
   3:        0x10537df0c - std::sys_common::backtrace::print::hf6b477e8b0f24da8
   4:        0x10535769c - std::panicking::default_hook::{{closure}}::hdf638eb4797e9f83
   5:        0x105357360 - std::panicking::default_hook::h7d2e96dc1bd66553
thread 'rustc' panicked at 'index out of bounds: the len is 83963 but the index is 83963', /Users/user/rust/compiler/rustc_serialize/src/leb128.rs:84:1
stack backtrace:
   0:        0x104fd60fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha53459bb6d4ff5af
   1:        0x10501293c - core::fmt::write::ha68623c3dae1f19c
   2:        0x104fa858c - std::io::Write::write_fmt::h8b4aa58251300bed
   3:        0x104fd5f0c - std::sys_common::backtrace::print::hf6b477e8b0f24da8
   4:        0x104faf69c - std::panicking::default_hook::{{closure}}::hdf638eb4797e9f83
   5:        0x104faf360 - std::panicking::default_hook::h7d2e96dc1bd66553
   6:        0x10d45d548 - rustc_driver_impl[2c1640858437bfcc]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x105357e98 - std::panicking::rust_panic_with_hook::h8bd72f93f1dd6346
   8:        0x10537e428 - std::panicking::begin_panic_handler::{{closure}}::he25deed1e819e5a3
   9:        0x10537e234 - std::sys_common::backtrace::__rust_end_short_backtrace::h004e1bcecdd55ae0
  10:        0x1053579e8 - _rust_begin_unwind
  11:        0x1053f3d70 - core::panicking::panic_fmt::hc383220eeda95a7d
  12:        0x1053f3e6c - core::panicking::panic_bounds_check::h64ec5195473a6a08
  13:        0x110a8e564 - <rustc_metadata[585a1dc57f7966e1]::rmeta::decoder::DecodeContext>::read_lazy_table::<rustc_span[b2bfdd1fa2dd6c51]::hygiene::ExpnIndex, core[a27f259b2d86647a]::option::Option<rustc_metadata[585a1dc57f7966e1]::rmeta::LazyValue<rustc_span[b2bfdd1fa2dd6c51]::hygiene::ExpnHash>>>
  14:        0x110a3387c - <rustc_metadata[585a1dc57f7966e1]::rmeta::CrateRoot as rustc_serialize[c6dc7208c70a6adf]::serialize::Decodable<rustc_metadata[585a1dc57f7966e1]::rmeta::decoder::DecodeContext>>::decode
  15:        0x1109e2430 - <rustc_metadata[585a1dc57f7966e1]::locator::CrateLocator>::extract_one
  16:        0x1109e1210 - <rustc_metadata[585a1dc57f7966e1]::locator::CrateLocator>::extract_lib
  17:        0x1109e03dc - <rustc_metadata[585a1dc57f7966e1]::locator::CrateLocator>::find_library_crate
  18:        0x1109dee58 - <rustc_metadata[585a1dc57f7966e1]::locator::CrateLocator>::maybe_load_library_crate
  19:        0x110a2e634 - <rustc_metadata[585a1dc57f7966e1]::creader::CrateLoader>::load
  20:        0x110a2bdf8 - <rustc_metadata[585a1dc57f7966e1]::creader::CrateLoader>::maybe_resolve_crate
  21:        0x110a2d198 - <rustc_metadata[585a1dc57f7966e1]::creader::CrateLoader>::maybe_resolve_crate
  22:        0x110a30738 - <rustc_metadata[585a1dc57f7966e1]::creader::CrateLoader>::maybe_process_path_extern
  23:        0x10fd79f2c - <rustc_resolve[62768f244b3f99cb]::Resolver>::extern_prelude_get
  24:        0x10fd7cb78 - <rustc_resolve[62768f244b3f99cb]::Resolver>::early_resolve_ident_in_lexical_scope
  25:        0x10fd6390c - <rustc_resolve[62768f244b3f99cb]::Resolver>::resolve_path_with_ribs
  26:        0x10fd6c7b8 - <rustc_resolve[62768f244b3f99cb]::Resolver as rustc_expand[c6aaebe4e7f9fa19]::base::ResolverExpand>::resolve_imports
  27:        0x110bb5c00 - <rustc_expand[c6aaebe4e7f9fa19]::expand::MacroExpander>::fully_expand_fragment
  28:        0x110bb58ac - <rustc_expand[c6aaebe4e7f9fa19]::expand::MacroExpander>::expand_crate
  29:        0x10d512730 - <rustc_session[291aea7a051eb502]::session::Session>::time::<rustc_ast[1dec4150faa9cfed]::ast::Crate, rustc_interface[5ef73afcb5cdc05]::passes::configure_and_expand::{closure#1}>
  30:        0x10d56a790 - rustc_interface[5ef73afcb5cdc05]::passes::resolver_for_lowering
  31:        0x11049dea4 - rustc_query_system[261156c8aade9f9a]::query::plumbing::try_execute_query::<rustc_query_impl[1e91bdd1a483d3f7]::queries::resolver_for_lowering, rustc_query_impl[1e91bdd1a483d3f7]::plumbing::QueryCtxt>
  32:        0x1106eab8c - <rustc_query_impl[1e91bdd1a483d3f7]::Queries as rustc_middle[9c912325736899ce]::ty::query::QueryEngine>::resolver_for_lowering
  33:        0x10d4a3728 - <rustc_middle[9c912325736899ce]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[2c1640858437bfcc]::run_compiler::{closure#1}::{closure#2}::{closure#2}, &rustc_data_structures[8e38a7798467bd53]::steal::Steal<(rustc_middle[9c912325736899ce]::ty::ResolverAstLowering, alloc[317453980e41a223]::rc::Rc<rustc_ast[1dec4150faa9cfed]::ast::Crate>)>>
  34:        0x10d4a48c0 - <scoped_tls[b77997ce4a425]::ScopedKey<rustc_span[b2bfdd1fa2dd6c51]::SessionGlobals>>::set::<rustc_interface[5ef73afcb5cdc05]::interface::run_compiler<core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>, rustc_driver_impl[2c1640858437bfcc]::run_compiler::{closure#1}>::{closure#0}, core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>>
  35:        0x10d46a4c0 - std[40de7a8abf64919]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[5ef73afcb5cdc05]::util::run_in_thread_pool_with_globals<rustc_interface[5ef73afcb5cdc05]::interface::run_compiler<core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>, rustc_driver_impl[2c1640858437bfcc]::run_compiler::{closure#1}>::{closure#0}, core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>>
  36:        0x10d463e38 - <<std[40de7a8abf64919]::thread::Builder>::spawn_unchecked_<rustc_interface[5ef73afcb5cdc05]::util::run_in_thread_pool_with_globals<rustc_interface[5ef73afcb5cdc05]::interface::run_compiler<core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>, rustc_driver_impl[2c1640858437bfcc]::run_compiler::{closure#1}>::{closure#0}, core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[a27f259b2d86647a]::result::Result<(), rustc_span[b2bfdd1fa2dd6c51]::ErrorGuaranteed>>::{closure#1} as core[a27f259b2d86647a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:        0x105345820 - std::sys::unix::thread::Thread::new::thread_start::hef737176451774ed
  38:        0x19419206c - __pthread_deallocate

@stefins stefins 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 Mar 4, 2023
@matthiaskrgr matthiaskrgr added the A-incr-comp Area: Incremental compilation label Mar 4, 2023
@saethlin saethlin self-assigned this Mar 9, 2024
@saethlin saethlin removed the A-incr-comp Area: Incremental compilation label Mar 9, 2024
@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.

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