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

yet another (random?) bootstrap ICE #74581

Closed
matthiaskrgr opened this issue Jul 21, 2020 · 6 comments
Closed

yet another (random?) bootstrap ICE #74581

matthiaskrgr opened this issue Jul 21, 2020 · 6 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Switched from f9a3086 to b52522a and ran x.py build

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/matthias/vcs/github/rust/src/librustc_serialize/leb128.rs:32:28

Backtrace

   Compiling rustc-std-workspace-core v1.99.0 (/home/matthias/vcs/github/rust/src/tools/rustc-std-workspace-core)
   Compiling compiler_builtins v0.1.32
thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/matthias/vcs/github/rust/src/librustc_serialize/leb128.rs:32:28
stack backtrace:
   0:     0x7f10d0070db0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h83efe194f8f67d3b
   1:     0x7f10d011101d - core::fmt::write::h71e0e6b4a0b91726
   2:     0x7f10d008f373 - std::io::Write::write_fmt::h9acb17a3af64e59b
   3:     0x7f10d00891e0 - std::panicking::default_hook::{{closure}}::ha3a007e0a475f5f8
   4:     0x7f10d0088f0a - std::panicking::default_hook::h3e2776b40b51d009
   5:     0x7f10d10870a9 - rustc_driver::report_ice::hcc3e0d217ce3a8da
   6:     0x7f10d0089866 - std::panicking::rust_panic_with_hook::h3d208397660b52cb
   7:     0x7f10d008941b - rust_begin_unwind
   8:     0x7f10d0110ca1 - core::panicking::panic_fmt::hfe9d003ed2cdba83
   9:     0x7f10d0110c62 - core::panicking::panic_bounds_check::hf7ae89aee69774be
  10:     0x7f10d28b3bbd - <rustc_metadata::rmeta::CrateRoot as rustc_serialize::serialize::Decodable>::decode::{{closure}}::h9ed33838b860c6b7
  11:     0x7f10d2a319ea - rustc_metadata::rmeta::decoder::MetadataBlob::get_root::ha9dc3a881feb0be9
  12:     0x7f10d2977340 - rustc_metadata::locator::CrateLocator::extract_one::h9d45d1e03d492e33
  13:     0x7f10d29765c1 - rustc_metadata::locator::CrateLocator::extract_lib::h6bd5e02cb2260b2f
  14:     0x7f10d2974f38 - rustc_metadata::locator::CrateLocator::maybe_load_library_crate::he126d93e0d90384b
  15:     0x7f10d2a41fda - rustc_metadata::creader::CrateLoader::load::h8c65ff58e7d50588
  16:     0x7f10d2a3e279 - rustc_metadata::creader::CrateLoader::maybe_resolve_crate::h7488e299773998bd
  17:     0x7f10d2a448ef - rustc_metadata::creader::CrateLoader::maybe_process_path_extern::h02a680e27eda735e
  18:     0x7f10d1c0601b - rustc_resolve::Resolver::extern_prelude_get::h808b5917671b019f
  19:     0x7f10d1beb6f4 - rustc_resolve::macros::<impl rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope::h925e3cde52793bf1
  20:     0x7f10d1c03330 - rustc_resolve::Resolver::resolve_path_with_ribs::{{closure}}::h4aa771f271bc8944
  21:     0x7f10d1c01537 - rustc_resolve::Resolver::resolve_path_with_ribs::h1d51748faeae7ffd
  22:     0x7f10d1c7553c - rustc_resolve::imports::ImportResolver::resolve_imports::h9811c70b32c29ca1
  23:     0x7f10d1be79ee - rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::resolve_imports::h9b7ff2506c56c3d9
  24:     0x7f10d2abdb46 - rustc_expand::expand::MacroExpander::fully_expand_fragment::h5f93b71605422611
  25:     0x7f10d2abd25f - rustc_expand::expand::MacroExpander::expand_crate::hf2b05a6b0b5cb181
  26:     0x7f10d12167f6 - rustc_session::utils::<impl rustc_session::session::Session>::time::he0064eb5905428c7
  27:     0x7f10d11f9593 - rustc_interface::passes::configure_and_expand_inner::h24b47a33e353f74a
  28:     0x7f10d128db62 - rustc_interface::passes::configure_and_expand::{{closure}}::h8a4e3d96144df778
  29:     0x7f10d123ed70 - rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new::h27c331f5c2ab078e
  30:     0x7f10d12038f5 - rustc_interface::queries::Queries::expansion::h8d015b8a15fbaddf
  31:     0x7f10d0ef77cf - rustc_interface::interface::create_compiler_and_run::hf00f2cd943ef0644
  32:     0x7f10d105038e - scoped_tls::ScopedKey<T>::set::hc6dc2a30d87f2d9d
  33:     0x7f10d0f1301c - std::sys_common::backtrace::__rust_begin_short_backtrace::h476bd6fe2bb1f0c5
  34:     0x7f10d0f15bae - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7e7edf9922c2d557
  35:     0x7f10d008a858 - std::sys::unix::thread::Thread::new::thread_start::he0f3ee1260f07274
  36:     0x7f10cce8c422 - start_thread
  37:     0x7f10cfe8fbf3 - __clone
  38:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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.47.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z macro-backtrace -Z save-analysis -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C codegen-units=4 -C debuginfo=0 -C target-cpu=native -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C embed-bitcode=yes --crate-type rlib

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

query stack during panic:
end of query stack
error: could not compile `rustc-std-workspace-core`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/home/matthias/vcs/github/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--features" "panic-unwind backtrace profiler compiler-builtins-c" "--manifest-path" "/home/matthias/vcs/github/rust/src/libtest/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
failed to run: /home/matthias/vcs/github/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:02

@matthiaskrgr matthiaskrgr 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 Jul 21, 2020
@mati865
Copy link
Contributor

mati865 commented Jul 21, 2020

Seems like incremental is enabled, right?

@matthiaskrgr
Copy link
Member Author

Mmh, probably, but I'm a bit confused because my config says no (I think?)

# Whether to always use incremental compilation when building rustc
#incremental = false

@mati865
Copy link
Contributor

mati865 commented Jul 21, 2020

Interesting to see that with incremental disabled.

@ehuss
Copy link
Contributor

ehuss commented Jul 21, 2020

It's not too surprising, I don't think the rmeta format is stable. Since bootstrap reuses the artifacts from previous builds, this seems inevitable. The only option I can think of is to set ignore-git to false in config.toml. Unfortunately that would mean everything gets rebuilt each time you update the git tree.

The metadata could include a schema/format version (similar to what incremental does), but I think it is unlikely that everyone will be able to know to manually change that version whenever the format changes. (It looks like the incremental header version has never been changed.) There could be tests or proc-macro magic to try to automate or verify the version gets updated, but that sounds like a ton of work for a very narrow use case (optimizing bootstrap for rustc development). Also, that probably wouldn't help much with backwards-compatibility, and might be back in the same situation, although with a slightly nicer error message.

@matthiaskrgr
Copy link
Member Author

I've had a couple of incremental ICEs while bootstrapping already, so all of these are "wontfix" essentially?

I can close them if you want. :)

@Alexendoo Alexendoo added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 22, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 7, 2020

I think this is the same issue as #76720.

@jyn514 jyn514 closed this as completed Dec 7, 2020
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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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