rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98k stars 12.68k forks source link

ICE: `./x.py doc --stage 1` panics #75849

Closed camelid closed 4 years ago

camelid commented 4 years ago

Command

./x.py doc --stage 1

Happens with PR #75842, but I don't think it's because of the PR, for one because the checks passed.

Meta

Commit hash: 4419e04f167

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/me/rust/src/librustc_serialize/leb128.rs:32:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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-apple-darwin

note: compiler flags: -Z macro-backtrace -Z osx-rpath-install-name -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C link-args=-Wl,-rpath,@loader_path/../lib -C prefer-dynamic --crate-type lib

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

thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/me/rust/src/librustc_serialize/leb128.rs:32:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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-apple-darwin

note: compiler flags: -Z macro-backtrace -Z osx-rpath-install-name -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C link-args=-Wl,-rpath,@loader_path/../lib -C prefer-dynamic --crate-type lib

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

error: could not compile `chalk-engine`.

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: "/Users/me/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "build" "--target" "x86_64-apple-darwin" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--features" " llvm" "--manifest-path" "/Users/me/rust/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
failed to run: /Users/me/rust/build/bootstrap/debug/bootstrap doc --stage 1
Build completed unsuccessfully in 0:54:03
Full x.py output

``` Updating only changed submodules Submodules updated in 0.13 seconds Finished dev [unoptimized + debuginfo] target(s) in 0.21s Generating unstable book md files (x86_64-apple-darwin) Building stage0 tool unstable-book-gen (x86_64-apple-darwin) Compiling proc-macro2 v1.0.19 Compiling serde v1.0.115 Compiling unicode-xid v0.2.1 Compiling ryu v1.0.5 Compiling syn v1.0.38 Compiling memchr v2.3.3 Compiling serde_derive v1.0.115 Compiling serde_json v1.0.57 Compiling itoa v0.4.6 Compiling autocfg v1.0.0 Compiling lazy_static v1.4.0 Compiling semver-parser v0.7.0 Compiling same-file v1.0.6 Compiling regex-syntax v0.6.18 Compiling thread_local v1.0.1 Compiling walkdir v2.3.1 Compiling num-traits v0.2.12 Compiling quote v1.0.7 Compiling aho-corasick v0.7.13 Compiling regex v1.3.9 Compiling semver v0.9.0 Compiling cargo_metadata v0.9.1 Compiling tidy v0.1.0 (/Users/me/rust/src/tools/tidy) Compiling unstable-book-gen v0.1.0 (/Users/me/rust/src/tools/unstable-book-gen) Finished release [optimized] target(s) in 47.57s Building stage0 tool rustbook (x86_64-apple-darwin) Compiling libc v0.2.74 Compiling getrandom v0.1.14 Compiling syn v1.0.38 Compiling cfg-if v0.1.10 Compiling ppv-lite86 v0.2.8 Compiling siphasher v0.3.3 Compiling log v0.4.11 Compiling itoa v0.4.6 Compiling new_debug_unreachable v1.0.4 Compiling mac v0.1.1 Compiling utf-8 v0.7.5 Compiling precomputed-hash v0.1.1 Compiling ucd-trie v0.1.3 Compiling maplit v1.0.2 Compiling bitflags v1.2.1 Compiling tinyvec v0.3.4 Compiling matches v0.1.8 Compiling version_check v0.9.1 Compiling unicode-width v0.1.8 Compiling unicode-segmentation v1.6.0 Compiling quick-error v1.2.3 Compiling percent-encoding v2.1.0 Compiling anyhow v1.0.32 Compiling pulldown-cmark v0.7.2 Compiling strsim v0.8.0 Compiling strum v0.18.0 Compiling termcolor v1.1.0 Compiling remove_dir_all v0.5.3 Compiling quick-error v2.0.0 Compiling ansi_term v0.11.0 Compiling vec_map v0.8.2 Compiling shlex v0.1.1 Compiling open v1.4.0 Compiling serde v1.0.115 Compiling ryu v1.0.5 Compiling serde_json v1.0.57 Compiling phf_shared v0.8.0 Compiling num-traits v0.2.12 Compiling num-integer v0.1.43 Compiling futf v0.1.4 Compiling pest v2.1.3 Compiling unicode-bidi v0.3.4 Compiling unicode-normalization v0.1.13 Compiling getopts v0.2.21 Compiling textwrap v0.11.0 Compiling heck v0.3.1 Compiling humantime v1.3.0 Compiling unicase v2.6.0 Compiling phf v0.8.0 Compiling tendril v0.4.1 Compiling idna v0.2.0 Compiling pest_meta v2.1.3 Compiling string_cache v0.8.0 Compiling toml v0.5.6 Compiling time v0.1.43 Compiling atty v0.2.14 Compiling url v2.1.1 Compiling rand_core v0.5.1 Compiling clap v2.33.3 Compiling rand_chacha v0.2.2 Compiling rand_pcg v0.2.1 Compiling env_logger v0.7.1 Compiling pest_generator v2.1.3 Compiling chrono v0.4.15 Compiling rand v0.7.3 Compiling phf_generator v0.8.0 Compiling tempfile v3.1.0 Compiling phf_codegen v0.8.0 Compiling string_cache_codegen v0.5.1 Compiling serde_derive v1.0.115 Compiling html5ever v0.25.1 Compiling strum_macros v0.18.0 Compiling pest_derive v2.1.0 Compiling handlebars v3.4.0 Compiling markup5ever v0.10.0 Compiling elasticlunr-rs v2.3.9 Compiling xml5ever v0.16.1 Compiling markup5ever_rcdom v0.1.0 Compiling ammonia v3.1.0 Compiling mdbook v0.4.2 Compiling rustbook v0.1.0 (/Users/me/rust/src/tools/rustbook) Finished release [optimized] target(s) in 2m 11s Rustbook (x86_64-apple-darwin) - unstable-book Building stage0 std artifacts (x86_64-apple-darwin -> x86_64-apple-darwin) Compiling cc v1.0.58 Compiling core v0.0.0 (/Users/me/rust/library/core) Compiling libc v0.2.74 Compiling autocfg v1.0.0 Compiling std v0.0.0 (/Users/me/rust/library/std) Compiling hashbrown v0.8.2 Compiling compiler_builtins v0.1.32 Compiling unwind v0.0.0 (/Users/me/rust/library/unwind) Compiling rustc-std-workspace-core v1.99.0 (/Users/me/rust/library/rustc-std-workspace-core) Compiling alloc v0.0.0 (/Users/me/rust/library/alloc) Compiling cfg-if v0.1.10 Compiling adler v0.2.3 Compiling rustc-demangle v0.1.16 Compiling panic_abort v0.0.0 (/Users/me/rust/library/panic_abort) Compiling rustc-std-workspace-alloc v1.99.0 (/Users/me/rust/library/rustc-std-workspace-alloc) Compiling panic_unwind v0.0.0 (/Users/me/rust/library/panic_unwind) Compiling gimli v0.22.0 Compiling miniz_oxide v0.4.0 Compiling object v0.20.0 Compiling addr2line v0.13.0 Compiling rustc-std-workspace-std v1.99.0 (/Users/me/rust/library/rustc-std-workspace-std) Compiling term v0.0.0 (/Users/me/rust/library/term) Compiling proc_macro v0.0.0 (/Users/me/rust/library/proc_macro) Compiling unicode-width v0.1.8 Compiling getopts v0.2.21 Compiling test v0.0.0 (/Users/me/rust/library/test) Finished release [optimized] target(s) in 57.04s Copying stage0 std from stage0 (x86_64-apple-darwin -> x86_64-apple-darwin / x86_64-apple-darwin) Building stage0 compiler artifacts (x86_64-apple-darwin -> x86_64-apple-darwin) Compiling cfg-if v0.1.10 Compiling libc v0.2.74 Compiling autocfg v1.0.0 Compiling lazy_static v1.4.0 Compiling proc-macro2 v1.0.19 Compiling scopeguard v1.1.0 Compiling unicode-xid v0.2.1 Compiling syn v1.0.38 Compiling maybe-uninit v2.0.0 Compiling semver-parser v0.7.0 Compiling cc v1.0.58 Compiling smallvec v1.4.2 Compiling byteorder v1.3.4 Compiling getrandom v0.1.14 Compiling log v0.4.11 Compiling typenum v1.12.0 Compiling either v1.6.0 Compiling instant v0.1.6 Compiling rustc-hash v1.1.0 Compiling rustc-rayon-core v0.3.0 Compiling ppv-lite86 v0.2.8 Compiling bitflags v1.2.1 Compiling byte-tools v0.3.1 Compiling arrayvec v0.5.1 Compiling remove_dir_all v0.5.3 Compiling rustc_graphviz v0.0.0 (/Users/me/rust/src/librustc_graphviz) Compiling stable_deref_trait v1.2.0 Compiling opaque-debug v0.2.3 Compiling unicode-width v0.1.8 Compiling fake-simd v0.1.2 Compiling scoped-tls v1.0.0 Compiling termcolor v1.1.0 Compiling annotate-snippets v0.8.0 Compiling rustc_fs_util v0.0.0 (/Users/me/rust/src/librustc_fs_util) Compiling version_check v0.9.1 Compiling datafrog v2.0.1 Compiling tinyvec v0.3.4 Compiling crc32fast v1.2.0 Compiling adler v0.2.3 Compiling serde v1.0.115 Compiling build_helper v0.1.0 (/Users/me/rust/src/build_helper) Compiling unicode-script v0.5.2 Compiling punycode v0.4.1 Compiling ryu v1.0.5 Compiling regex-syntax v0.6.18 Compiling rustc-demangle v0.1.16 Compiling fixedbitset v0.2.0 Compiling pathdiff v0.2.0 Compiling serde_json v1.0.57 Compiling itoa v0.4.6 Compiling ansi_term v0.12.1 Compiling rustc_error_codes v0.0.0 (/Users/me/rust/src/librustc_error_codes) Compiling tracing-core v0.1.14 Compiling crossbeam-utils v0.6.6 Compiling log_settings v0.1.2 Compiling thread_local v1.0.1 Compiling sharded-slab v0.0.9 Compiling lock_api v0.4.1 Compiling lock_api v0.3.4 Compiling semver v0.9.0 Compiling hashbrown v0.8.2 Compiling crossbeam-utils v0.7.2 Compiling memoffset v0.5.5 Compiling indexmap v1.5.1 Compiling crossbeam-epoch v0.8.2 Compiling itertools v0.8.2 Compiling itertools v0.9.0 Compiling block-padding v0.1.5 Compiling getopts v0.2.21 Compiling rustc_lexer v0.1.0 (/Users/me/rust/src/librustc_lexer) Compiling unicode-normalization v0.1.13 Compiling miniz_oxide v0.4.0 Compiling psm v0.1.11 Compiling stacker v0.1.11 Compiling rustc_llvm v0.0.0 (/Users/me/rust/src/librustc_llvm) Compiling crossbeam-queue v0.1.2 Compiling regex v1.3.9 Compiling rustc_version v0.2.3 Compiling unicode-security v0.0.5 Compiling parking_lot_core v0.8.0 Compiling num_cpus v1.13.0 Compiling memmap v0.7.0 Compiling parking_lot_core v0.7.2 Compiling jobserver v0.1.21 Compiling termize v0.1.1 Compiling atty v0.2.14 Compiling smallvec v0.6.13 Compiling quote v1.0.7 Compiling parking_lot_core v0.6.2 Compiling parking_lot v0.9.0 Compiling ena v0.14.0 Compiling polonius-engine v0.12.1 Compiling rustc_apfloat v0.0.0 (/Users/me/rust/src/librustc_apfloat) Compiling regex-automata v0.1.9 Compiling generic-array v0.12.3 Compiling flate2 v1.0.16 Compiling rand_core v0.5.1 Compiling parking_lot v0.11.0 Compiling parking_lot v0.10.2 Compiling digest v0.8.1 Compiling block-buffer v0.7.3 Compiling matchers v0.0.1 Compiling rls-span v0.5.2 Compiling rand_chacha v0.2.2 Compiling once_cell v1.4.1 Compiling rustc_serialize v0.0.0 (/Users/me/rust/src/librustc_serialize) Compiling petgraph v0.5.1 Compiling crossbeam-deque v0.7.3 Compiling sha-1 v0.8.2 Compiling md-5 v0.8.0 Compiling tracing-subscriber v0.2.11 Compiling rls-data v0.19.0 Compiling rand v0.7.3 Compiling synstructure v0.12.4 Compiling tempfile v3.1.0 Compiling measureme v0.7.1 Compiling rustc-rayon v0.3.0 Compiling tracing-attributes v0.1.10 Compiling rustc_macros v0.1.0 (/Users/me/rust/src/librustc_macros) Compiling chalk-derive v0.14.0 Compiling rustc_index v0.0.0 (/Users/me/rust/src/librustc_index) Compiling chalk-ir v0.14.0 Compiling tracing v0.1.19 Compiling rustc_data_structures v0.0.0 (/Users/me/rust/src/librustc_data_structures) Compiling rustc_arena v0.0.0 (/Users/me/rust/src/librustc_arena) Compiling rustc_span v0.0.0 (/Users/me/rust/src/librustc_span) Compiling chalk-engine v0.14.0 Compiling chalk-solve v0.14.0 Compiling rustc_ast v0.0.0 (/Users/me/rust/src/librustc_ast) Compiling rustc_target v0.0.0 (/Users/me/rust/src/librustc_target) Compiling rustc_errors v0.0.0 (/Users/me/rust/src/librustc_errors) Compiling rustc_feature v0.0.0 (/Users/me/rust/src/librustc_feature) Compiling rustc_parse_format v0.0.0 (/Users/me/rust/src/librustc_parse_format) Compiling rustc_query_system v0.0.0 (/Users/me/rust/src/librustc_query_system) Compiling rustc_ast_pretty v0.0.0 (/Users/me/rust/src/librustc_ast_pretty) Compiling rustc_hir v0.0.0 (/Users/me/rust/src/librustc_hir) Compiling rustc_session v0.0.0 (/Users/me/rust/src/librustc_session) Compiling rustc_hir_pretty v0.0.0 (/Users/me/rust/src/librustc_hir_pretty) Compiling rustc_attr v0.0.0 (/Users/me/rust/src/librustc_attr) Compiling rustc_parse v0.0.0 (/Users/me/rust/src/librustc_parse) Compiling rustc_ast_lowering v0.0.0 (/Users/me/rust/src/librustc_ast_lowering) Compiling rustc_middle v0.0.0 (/Users/me/rust/src/librustc_middle) Compiling rustc_ast_passes v0.0.0 (/Users/me/rust/src/librustc_ast_passes) Compiling rustc_expand v0.0.0 (/Users/me/rust/src/librustc_expand) Compiling rustc_infer v0.0.0 (/Users/me/rust/src/librustc_infer) Compiling rustc_incremental v0.0.0 (/Users/me/rust/src/librustc_incremental) Compiling rustc_symbol_mangling v0.0.0 (/Users/me/rust/src/librustc_symbol_mangling) Compiling rustc_save_analysis v0.0.0 (/Users/me/rust/src/librustc_save_analysis) Compiling rustc_metadata v0.0.0 (/Users/me/rust/src/librustc_metadata) Compiling rustc_builtin_macros v0.0.0 (/Users/me/rust/src/librustc_builtin_macros) Compiling rustc_trait_selection v0.0.0 (/Users/me/rust/src/librustc_trait_selection) Compiling rustc_codegen_ssa v0.0.0 (/Users/me/rust/src/librustc_codegen_ssa) Compiling rustc_resolve v0.0.0 (/Users/me/rust/src/librustc_resolve) Compiling rustc_lint v0.0.0 (/Users/me/rust/src/librustc_lint) Compiling rustc_typeck v0.0.0 (/Users/me/rust/src/librustc_typeck) Compiling rustc_passes v0.0.0 (/Users/me/rust/src/librustc_passes) Compiling rustc_mir_build v0.0.0 (/Users/me/rust/src/librustc_mir_build) Compiling rustc_ty v0.0.0 (/Users/me/rust/src/librustc_ty) Compiling rustc_traits v0.0.0 (/Users/me/rust/src/librustc_traits) Compiling rustc_mir v0.0.0 (/Users/me/rust/src/librustc_mir) Compiling rustc_codegen_llvm v0.0.0 (/Users/me/rust/src/librustc_codegen_llvm) Compiling rustc_plugin_impl v0.0.0 (/Users/me/rust/src/librustc_plugin_impl) Compiling rustc_privacy v0.0.0 (/Users/me/rust/src/librustc_privacy) Compiling rustc_interface v0.0.0 (/Users/me/rust/src/librustc_interface) Compiling rustc_driver v0.0.0 (/Users/me/rust/src/librustc_driver) Compiling rustc-main v0.0.0 (/Users/me/rust/src/rustc) Finished release [optimized] target(s) in 18m 03s Copying stage0 rustc from stage0 (x86_64-apple-darwin -> x86_64-apple-darwin / x86_64-apple-darwin) Assembling stage1 compiler (x86_64-apple-darwin) Rustbook (x86_64-apple-darwin) - book Rustbook (x86_64-apple-darwin) - book/first-edition Rustbook (x86_64-apple-darwin) - book/second-edition Rustbook (x86_64-apple-darwin) - book/2018-edition Documenting standalone (x86_64-apple-darwin) Building rustdoc for stage1 (x86_64-apple-darwin) Compiling autocfg v1.0.0 Compiling cfg-if v0.1.10 Compiling libc v0.2.74 Compiling proc-macro2 v1.0.19 Compiling lazy_static v1.4.0 Compiling getrandom v0.1.14 Compiling maybe-uninit v2.0.0 Compiling unicode-xid v0.2.1 Compiling syn v1.0.38 Compiling serde_derive v1.0.115 Compiling version_check v0.9.1 Compiling scopeguard v1.1.0 Compiling bitflags v1.2.1 Compiling serde v1.0.115 Compiling ryu v1.0.5 Compiling rustc-rayon-core v0.3.0 Compiling ppv-lite86 v0.2.8 Compiling memchr v2.3.3 Compiling serde_json v1.0.57 Compiling either v1.6.0 Compiling pulldown-cmark v0.7.2 Compiling itoa v0.4.6 Compiling remove_dir_all v0.5.3 Compiling macro-utils v0.1.3 Compiling smallvec v1.4.2 Compiling crossbeam-utils v0.6.6 Compiling crossbeam-utils v0.7.2 Compiling memoffset v0.5.5 Compiling crossbeam-epoch v0.8.2 Compiling itertools v0.8.2 Compiling minifier v0.0.33 Compiling unicase v2.6.0 Compiling crossbeam-queue v0.1.2 Compiling num_cpus v1.13.0 Compiling quote v1.0.7 Compiling rand_core v0.5.1 Compiling rand_chacha v0.2.2 Compiling crossbeam-deque v0.7.3 Compiling rand v0.7.3 Compiling tempfile v3.1.0 Compiling rustc-rayon v0.3.0 Compiling rustdoc v0.0.0 (/Users/me/rust/src/librustdoc) Compiling rustdoc-tool v0.0.0 (/Users/me/rust/src/tools/rustdoc) Finished release [optimized] target(s) in 2m 13s Documenting book redirect pages (x86_64-apple-darwin) Documenting stage1 std (x86_64-apple-darwin) Building stage1 std artifacts (x86_64-apple-darwin -> x86_64-apple-darwin) Compiling cc v1.0.58 Compiling core v0.0.0 (/Users/me/rust/library/core) Compiling libc v0.2.74 Compiling autocfg v1.0.0 Compiling std v0.0.0 (/Users/me/rust/library/std) Compiling hashbrown v0.8.2 Compiling compiler_builtins v0.1.32 Compiling unwind v0.0.0 (/Users/me/rust/library/unwind) Compiling rustc-std-workspace-core v1.99.0 (/Users/me/rust/library/rustc-std-workspace-core) Compiling alloc v0.0.0 (/Users/me/rust/library/alloc) Compiling cfg-if v0.1.10 Compiling adler v0.2.3 Compiling rustc-demangle v0.1.16 Compiling rustc-std-workspace-alloc v1.99.0 (/Users/me/rust/library/rustc-std-workspace-alloc) Compiling panic_abort v0.0.0 (/Users/me/rust/library/panic_abort) Compiling gimli v0.22.0 Compiling miniz_oxide v0.4.0 Compiling object v0.20.0 Compiling panic_unwind v0.0.0 (/Users/me/rust/library/panic_unwind) Compiling addr2line v0.13.0 Compiling rustc-std-workspace-std v1.99.0 (/Users/me/rust/library/rustc-std-workspace-std) Compiling proc_macro v0.0.0 (/Users/me/rust/library/proc_macro) Compiling term v0.0.0 (/Users/me/rust/library/term) Compiling unicode-width v0.1.8 Compiling getopts v0.2.21 Compiling test v0.0.0 (/Users/me/rust/library/test) Finished release [optimized] target(s) in 6m 03s Copying stage1 std from stage1 (x86_64-apple-darwin -> x86_64-apple-darwin / x86_64-apple-darwin) Documenting core v0.0.0 (/Users/me/rust/library/core) Finished release [optimized] target(s) in 11.09s Checking core v0.0.0 (/Users/me/rust/library/core) Checking rustc-std-workspace-core v1.99.0 (/Users/me/rust/library/rustc-std-workspace-core) Checking compiler_builtins v0.1.32 Documenting alloc v0.0.0 (/Users/me/rust/library/alloc) Finished release [optimized] target(s) in 16.53s Checking libc v0.2.74 Compiling std v0.0.0 (/Users/me/rust/library/std) Checking alloc v0.0.0 (/Users/me/rust/library/alloc) Checking cfg-if v0.1.10 Checking adler v0.2.3 Checking rustc-demangle v0.1.16 Checking unwind v0.0.0 (/Users/me/rust/library/unwind) Checking panic_abort v0.0.0 (/Users/me/rust/library/panic_abort) Checking rustc-std-workspace-alloc v1.99.0 (/Users/me/rust/library/rustc-std-workspace-alloc) Checking panic_unwind v0.0.0 (/Users/me/rust/library/panic_unwind) Checking gimli v0.22.0 Checking object v0.20.0 Checking hashbrown v0.8.2 Checking miniz_oxide v0.4.0 Checking addr2line v0.13.0 Documenting std v0.0.0 (/Users/me/rust/library/std) Finished release [optimized] target(s) in 16.54s Checking std v0.0.0 (/Users/me/rust/library/std) Documenting proc_macro v0.0.0 (/Users/me/rust/library/proc_macro) Finished release [optimized] target(s) in 5.62s Checking rustc-std-workspace-std v1.99.0 (/Users/me/rust/library/rustc-std-workspace-std) Checking term v0.0.0 (/Users/me/rust/library/term) Checking proc_macro v0.0.0 (/Users/me/rust/library/proc_macro) Checking unicode-width v0.1.8 Checking getopts v0.2.21 Documenting test v0.0.0 (/Users/me/rust/library/test) Finished release [optimized] target(s) in 3.03s Documenting stage1 compiler (x86_64-apple-darwin) skipping - compiler/librustdoc docs disabled Documenting stage1 rustdoc (x86_64-apple-darwin) skipping - compiler/librustdoc docs disabled Documenting error index (x86_64-apple-darwin) Building stage1 compiler artifacts (x86_64-apple-darwin -> x86_64-apple-darwin) Compiling cfg-if v0.1.10 Compiling libc v0.2.74 Compiling autocfg v1.0.0 Compiling lazy_static v1.4.0 Compiling proc-macro2 v1.0.19 Compiling unicode-xid v0.2.1 Compiling scopeguard v1.1.0 Compiling syn v1.0.38 Compiling maybe-uninit v2.0.0 Compiling semver-parser v0.7.0 Compiling cc v1.0.58 Compiling byteorder v1.3.4 Compiling smallvec v1.4.2 Compiling getrandom v0.1.14 Compiling typenum v1.12.0 Compiling log v0.4.11 Compiling instant v0.1.6 Compiling either v1.6.0 Compiling rustc-hash v1.1.0 Compiling bitflags v1.2.1 Compiling ppv-lite86 v0.2.8 Compiling rustc-rayon-core v0.3.0 Compiling byte-tools v0.3.1 Compiling arrayvec v0.5.1 Compiling remove_dir_all v0.5.3 Compiling rustc_graphviz v0.0.0 (/Users/me/rust/src/librustc_graphviz) Compiling stable_deref_trait v1.2.0 Compiling opaque-debug v0.2.3 Compiling fake-simd v0.1.2 Compiling unicode-width v0.1.8 Compiling scoped-tls v1.0.0 Compiling annotate-snippets v0.8.0 Compiling termcolor v1.1.0 Compiling rustc_fs_util v0.0.0 (/Users/me/rust/src/librustc_fs_util) Compiling version_check v0.9.1 Compiling datafrog v2.0.1 Compiling tinyvec v0.3.4 Compiling crc32fast v1.2.0 Compiling adler v0.2.3 Compiling serde v1.0.115 Compiling build_helper v0.1.0 (/Users/me/rust/src/build_helper) Compiling rustc-demangle v0.1.16 Compiling regex-syntax v0.6.18 Compiling unicode-script v0.5.2 Compiling ryu v1.0.5 Compiling fixedbitset v0.2.0 Compiling punycode v0.4.1 Compiling pathdiff v0.2.0 Compiling serde_json v1.0.57 Compiling itoa v0.4.6 Compiling ansi_term v0.12.1 Compiling rustc_error_codes v0.0.0 (/Users/me/rust/src/librustc_error_codes) Compiling tracing-core v0.1.14 Compiling crossbeam-utils v0.6.6 Compiling log_settings v0.1.2 Compiling thread_local v1.0.1 Compiling sharded-slab v0.0.9 Compiling lock_api v0.3.4 Compiling lock_api v0.4.1 Compiling semver v0.9.0 Compiling hashbrown v0.8.2 Compiling memoffset v0.5.5 Compiling crossbeam-utils v0.7.2 Compiling indexmap v1.5.1 Compiling crossbeam-epoch v0.8.2 Compiling itertools v0.8.2 Compiling itertools v0.9.0 Compiling block-padding v0.1.5 Compiling getopts v0.2.21 Compiling rustc_lexer v0.1.0 (/Users/me/rust/src/librustc_lexer) Compiling unicode-normalization v0.1.13 Compiling miniz_oxide v0.4.0 Compiling regex v1.3.9 Compiling psm v0.1.11 Compiling stacker v0.1.11 Compiling rustc_llvm v0.0.0 (/Users/me/rust/src/librustc_llvm) Compiling crossbeam-queue v0.1.2 Compiling rustc_version v0.2.3 Compiling unicode-security v0.0.5 Compiling parking_lot_core v0.8.0 Compiling num_cpus v1.13.0 Compiling parking_lot_core v0.7.2 Compiling memmap v0.7.0 Compiling jobserver v0.1.21 Compiling termize v0.1.1 Compiling atty v0.2.14 Compiling parking_lot_core v0.6.2 Compiling parking_lot v0.9.0 Compiling quote v1.0.7 Compiling smallvec v0.6.13 Compiling regex-automata v0.1.9 Compiling ena v0.14.0 Compiling polonius-engine v0.12.1 Compiling rustc_apfloat v0.0.0 (/Users/me/rust/src/librustc_apfloat) Compiling generic-array v0.12.3 Compiling flate2 v1.0.16 Compiling rls-span v0.5.2 Compiling rand_core v0.5.1 Compiling parking_lot v0.11.0 Compiling parking_lot v0.10.2 Compiling matchers v0.0.1 Compiling block-buffer v0.7.3 Compiling digest v0.8.1 Compiling rls-data v0.19.0 Compiling rand_chacha v0.2.2 Compiling once_cell v1.4.1 Compiling rustc_serialize v0.0.0 (/Users/me/rust/src/librustc_serialize) Compiling petgraph v0.5.1 Compiling crossbeam-deque v0.7.3 Compiling synstructure v0.12.4 Compiling tracing-subscriber v0.2.11 Compiling md-5 v0.8.0 Compiling sha-1 v0.8.2 Compiling rand v0.7.3 Compiling tempfile v3.1.0 Compiling measureme v0.7.1 Compiling rustc-rayon v0.3.0 Compiling tracing-attributes v0.1.10 Compiling rustc_macros v0.1.0 (/Users/me/rust/src/librustc_macros) Compiling chalk-derive v0.14.0 Compiling rustc_index v0.0.0 (/Users/me/rust/src/librustc_index) Compiling chalk-ir v0.14.0 Compiling tracing v0.1.19 Compiling rustc_data_structures v0.0.0 (/Users/me/rust/src/librustc_data_structures) Compiling chalk-engine v0.14.0 thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/me/rust/src/librustc_serialize/leb128.rs:32:28 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 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-apple-darwin note: compiler flags: -Z macro-backtrace -Z osx-rpath-install-name -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C link-args=-Wl,-rpath,@loader_path/../lib -C prefer-dynamic --crate-type lib note: some of the compiler flags provided by cargo are hidden thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/me/rust/src/librustc_serialize/leb128.rs:32:28 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 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-apple-darwin note: compiler flags: -Z macro-backtrace -Z osx-rpath-install-name -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C link-args=-Wl,-rpath,@loader_path/../lib -C prefer-dynamic --crate-type lib note: some of the compiler flags provided by cargo are hidden error: could not compile `chalk-engine`. 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: "/Users/me/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "build" "--target" "x86_64-apple-darwin" "-Zbinary-dep-depinfo" "-j" "4" "--release" "--features" " llvm" "--manifest-path" "/Users/me/rust/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics" expected success, got: exit code: 101 failed to run: /Users/me/rust/build/bootstrap/debug/bootstrap doc --stage 1 Build completed unsuccessfully in 0:54:03 ```

Backtrace

``` thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/me/rust/src/librustc_serialize/leb128.rs:32:28 thread 'rustc' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/me/rust/src/librustc_serialize/leb128.rs:32:28 stack backtrace: stack backtrace: 0: 0x107d12ede - ::fmt::h32be0b792f5af42c 0: 0x10bc1dede - ::fmt::h32be0b792f5af42c 1: 0x107da4d5d - core::fmt::write::h8c19a284908bf8d0 2: 0x107d07b19 - std::io::Write::write_fmt::h4afea657ba2056c8 3: 0x107d35715 - std::panicking::default_hook::{{closure}}::hfda4a6ebebe0fb19 4: 0x107d3541a - std::panicking::default_hook::h76fb4450e5c5c39f 1: 0x10bcafd5d - core::fmt::write::h8c19a284908bf8d0 2: 0x10bc12b19 - std::io::Write::write_fmt::h4afea657ba2056c8 3: 0x10bc40715 - std::panicking::default_hook::{{closure}}::hfda4a6ebebe0fb19 4: 0x10bc4041a - std::panicking::default_hook::h76fb4450e5c5c39f 5: 0x110fb6d68 - rustc_driver::report_ice::hff6060898cce1862 6: 0x107d35c4e - std::panicking::rust_panic_with_hook::h73cdb64754ba85ea 7: 0x107d1330b - std::panicking::begin_panic_handler::{{closure}}::hccbefc0f5db5f664 8: 0x107d13058 - std::sys_common::backtrace::__rust_end_short_backtrace::hbdfdaa2d0aa07a05 9: 0x107d35803 - _rust_begin_unwind 10: 0x107db56cf - core::panicking::panic_fmt::h8d1d50e7f1a3ecc7 11: 0x107db5696 - core::panicking::panic_bounds_check::hdee51931e29a29a0 12: 0x116cbf025 - rustc_session::config::_DERIVE_rustc_serialize_Decodable_D_FOR_SymbolManglingVersion:: for rustc_session::config::SymbolManglingVersion>::decode::hc4a72bffb348a93d 13: 0x116dea79b - rustc_metadata::rmeta::_DERIVE_rustc_serialize_Decodable_DecodeContext_a_tcx_FOR_CrateRoot:: for rustc_metadata::rmeta::CrateRoot>::decode::{{closure}}::h753e892c8fffbf52 14: 0x116c4a2cd - rustc_metadata::rmeta::decoder::MetadataBlob::get_root::ha5382402c3bdaca5 15: 0x116cda167 - rustc_metadata::locator::CrateLocator::extract_one::haec7515a6cb12e2b 16: 0x116cd8dd3 - rustc_metadata::locator::CrateLocator::extract_lib::h747035bbfb40510b 17: 0x116cd8483 - rustc_metadata::locator::CrateLocator::find_library_crate::h867b0c53eac0582e 18: 0x116cd7a7a - rustc_metadata::locator::CrateLocator::maybe_load_library_crate::h571b53aea7418fc6 19: 0x116dc3a6d - rustc_metadata::creader::CrateLoader::load::he22ab630ad85205c 20: 0x116dc093c - rustc_metadata::creader::CrateLoader::maybe_resolve_crate::he3a3c7b5663aecec 21: 0x116dc27ee - rustc_metadata::creader::CrateLoader::maybe_resolve_crate::he3a3c7b5663aecec 22: 0x116dc6ff5 - rustc_metadata::creader::CrateLoader::maybe_process_path_extern::hfb2dfb444a398841 23: 0x1161ba089 - rustc_resolve::Resolver::extern_prelude_get::h34347b3d20966316 24: 0x11619c9f1 - rustc_resolve::macros::::early_resolve_ident_in_lexical_scope::hd4972e4f1ccfcca4 25: 0x1161b6c23 - rustc_resolve::Resolver::resolve_path_with_ribs::{{closure}}::heba97e68249f529a 26: 0x1161b48b6 - rustc_resolve::Resolver::resolve_path_with_ribs::h05cb6cd47c47ea42 27: 0x1161fc961 - rustc_resolve::imports::ImportResolver::resolve_imports::h86369e404b07971b 28: 0x116198535 - rustc_resolve::macros::::resolve_imports::hb774b1030af4d1f0 29: 0x116f521d8 - rustc_expand::expand::MacroExpander::fully_expand_fragment::hf15e3661b7eeca2b 30: 0x116f51961 - rustc_expand::expand::MacroExpander::expand_crate::h80649a205b3238fa 31: 0x111225958 - rustc_session::utils::::time::h289ee5cc6fffa74c 32: 0x11126cc3a - rustc_interface::passes::configure_and_expand_inner::h057d6b374a9570b4 33: 0x11123af26 - rustc_interface::passes::configure_and_expand::{{closure}}::h367d439eac8b4410 34: 0x111233583 - rustc_data_structures::box_region::PinnedGenerator::new::h5aad7d6e83658615 35: 0x11126be0f - rustc_interface::passes::configure_and_expand::he4fb25520a70b77d 36: 0x1111b147b - rustc_interface::queries::Queries::expansion::h1f707a537bd808fa 37: 0x110fd2da8 - rustc_interface::queries::::enter::h63fa8194022545bd 38: 0x110f7ab5e - rustc_span::with_source_map::h36a26ee8977b6af2 39: 0x110fd46b1 - rustc_interface::interface::create_compiler_and_run::h3a9bd5e1de9427e7 40: 0x110fc4cc3 - scoped_tls::ScopedKey::set::h6fafb908c2b31a32 41: 0x110f822ef - std::sys_common::backtrace::__rust_begin_short_backtrace::he3191221ea2d109a 42: 0x110f673ec - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4f6589d3d515ae2f 43: 0x107d3bebd - std::sys::unix::thread::Thread::new::thread_start::hd05b904f16e150ce 44: 0x7fff68ab5109 - __pthread_start 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-apple-darwin note: compiler flags: -Z macro-backtrace -Z osx-rpath-install-name -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C link-args=-Wl,-rpath,@loader_path/../lib -C prefer-dynamic --crate-type lib note: some of the compiler flags provided by cargo are hidden query stack during panic: end of query stack 5: 0x10c7ccd68 - rustc_driver::report_ice::hff6060898cce1862 6: 0x10bc40c4e - std::panicking::rust_panic_with_hook::h73cdb64754ba85ea 7: 0x10bc1e30b - std::panicking::begin_panic_handler::{{closure}}::hccbefc0f5db5f664 8: 0x10bc1e058 - std::sys_common::backtrace::__rust_end_short_backtrace::hbdfdaa2d0aa07a05 9: 0x10bc40803 - _rust_begin_unwind 10: 0x10bcc06cf - core::panicking::panic_fmt::h8d1d50e7f1a3ecc7 11: 0x10bcc0696 - core::panicking::panic_bounds_check::hdee51931e29a29a0 12: 0x1124d5025 - rustc_session::config::_DERIVE_rustc_serialize_Decodable_D_FOR_SymbolManglingVersion:: for rustc_session::config::SymbolManglingVersion>::decode::hc4a72bffb348a93d 13: 0x11260079b - rustc_metadata::rmeta::_DERIVE_rustc_serialize_Decodable_DecodeContext_a_tcx_FOR_CrateRoot:: for rustc_metadata::rmeta::CrateRoot>::decode::{{closure}}::h753e892c8fffbf52 14: 0x1124602cd - rustc_metadata::rmeta::decoder::MetadataBlob::get_root::ha5382402c3bdaca5 15: 0x1124f0167 - rustc_metadata::locator::CrateLocator::extract_one::haec7515a6cb12e2b 16: 0x1124eedd3 - rustc_metadata::locator::CrateLocator::extract_lib::h747035bbfb40510b 17: 0x1124ee483 - rustc_metadata::locator::CrateLocator::find_library_crate::h867b0c53eac0582e 18: 0x1124eda7a - rustc_metadata::locator::CrateLocator::maybe_load_library_crate::h571b53aea7418fc6 19: 0x1125d9a6d - rustc_metadata::creader::CrateLoader::load::he22ab630ad85205c 20: 0x1125d693c - rustc_metadata::creader::CrateLoader::maybe_resolve_crate::he3a3c7b5663aecec 21: 0x1125d87ee - rustc_metadata::creader::CrateLoader::maybe_resolve_crate::he3a3c7b5663aecec 22: 0x1125dcc9c - rustc_metadata::creader::CrateLoader::process_extern_crate::hc38f849eb549020a 23: 0x11193e83f - ::visit_item::hf80509e6bf9dbc68 24: 0x1119918dc - rustc_ast::visit::walk_item::hbd9a8fb307e4c14e 25: 0x11193ff65 - ::visit_item::hf80509e6bf9dbc68 26: 0x11194ca40 - rustc_expand::expand::AstFragment::visit_with::heee823d45da7a4b7 27: 0x1119ad9bd - rustc_resolve::macros::::visit_ast_fragment_with_placeholders::hc4bf62cf73010d35 28: 0x11276f6fe - rustc_expand::expand::MacroExpander::collect_invocations::h470dfc2fb078230f 29: 0x11276817f - rustc_expand::expand::MacroExpander::fully_expand_fragment::hf15e3661b7eeca2b 30: 0x112767961 - rustc_expand::expand::MacroExpander::expand_crate::h80649a205b3238fa 31: 0x10ca3b958 - rustc_session::utils::::time::h289ee5cc6fffa74c 32: 0x10ca82c3a - rustc_interface::passes::configure_and_expand_inner::h057d6b374a9570b4 33: 0x10ca50f26 - rustc_interface::passes::configure_and_expand::{{closure}}::h367d439eac8b4410 34: 0x10ca49583 - rustc_data_structures::box_region::PinnedGenerator::new::h5aad7d6e83658615 35: 0x10ca81e0f - rustc_interface::passes::configure_and_expand::he4fb25520a70b77d 36: 0x10c9c747b - rustc_interface::queries::Queries::expansion::h1f707a537bd808fa 37: 0x10c7e8da8 - rustc_interface::queries::::enter::h63fa8194022545bd 38: 0x10c790b5e - rustc_span::with_source_map::h36a26ee8977b6af2 39: 0x10c7ea6b1 - rustc_interface::interface::create_compiler_and_run::h3a9bd5e1de9427e7 40: 0x10c7dacc3 - scoped_tls::ScopedKey::set::h6fafb908c2b31a32 41: 0x10c7982ef - std::sys_common::backtrace::__rust_begin_short_backtrace::he3191221ea2d109a 42: 0x10c77d3ec - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4f6589d3d515ae2f 43: 0x10bc46ebd - std::sys::unix::thread::Thread::new::thread_start::hd05b904f16e150ce 44: 0x7fff68ab5109 - __pthread_start 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-apple-darwin note: compiler flags: -Z macro-backtrace -Z osx-rpath-install-name -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C link-args=-Wl,-rpath,@loader_path/../lib -C prefer-dynamic --crate-type lib note: some of the compiler flags provided by cargo are hidden query stack during panic: end of query stack error: could not compile `chalk-engine`. ```

Cc @jyn514

camelid commented 4 years ago

Build finally finished! Posted backtrace.

jyn514 commented 4 years ago

The weird thing here is that there's no main function - the backtrace starts at __pthread_start. But @camelid isn't using parellel-compiler = true. So I'm very confused what's going on.

jyn514 commented 4 years ago

Actually, this is while compiling chalk-engine, not documenting it.

camelid commented 4 years ago

For reference, the config.toml that produced the error is exactly the same as config.toml.example.

ehuss commented 4 years ago

The weird thing here is that there's no main function

@jyn514 This is normal, the compiler always runs inside a dedicated thread (even for a non-parallel rustc).

Coincidentally I can reproduce this. I believe the issue is that the metadata format changes over time, but when rebuilding rustc, there isn't any versioning in place to check and avoid older versions. In this particular case, it is trying to load a proc macro (libtracing_attributes in my case), and then it tries to decode the metadata in the dylib. However, when the format changes, the serialization format that rustc uses isn't very resilient to errors, and tends to panic.

Under normal circumstances, the version of rustc is embedded in the header, and the crate loader will skip files created by a different version of rustc. However, in a rustc dev environment, the version doesn't include the git hash or anything (it is just rustc 1.47.0-dev), so if anything changes in an incompatible fashion over the 6-week release period, then it can fail.

I think this is just par for the course when working with rustc. I would suggest just deleting the stage1-rustc directory (or running x.py clean).

I don't think there is any feasible fix for this. There is a metadata version number that could be bumped manually, but I don't think these kinds of changes usually warrant that. The metadata schema could be versioned automatically, but that would require a lot of infrastructure to do (probably some proc-macro magic). Ideally the serialization code wouldn't panic and provide a better error, but I doubt that would be feasible to really fix (I don't really know, though).

jyn514 commented 4 years ago

Under normal circumstances, the version of rustc is embedded in the header, and the crate loader will skip files created by a different version of rustc. However, in a rustc dev environment, the version doesn't include the git hash or anything (it is just rustc 1.47.0-dev), so if anything changes in an incompatible fashion over the 6-week release period, then it can fail.

Is it possible to add the git hash to the version in a dev environment? That would be helpful for rustc --version, not just for rustc_metadata.

ehuss commented 4 years ago

Is it possible to add the git hash to the version in a dev environment? That would be helpful for rustc --version, not just for rustc_metadata.

I think if you set the channel to nightly in config.toml, it will embed the git hash. Usually this is undesirable, as any small change to the git hash will rebuild the world.

Mark-Simulacrum commented 4 years ago

There is a separate ignore-git flag in config.toml, which is enabled by default for dev at least.

I'm going to close this - I agree with @ehuss' diagnosis. There's a fundamental trade-off between rustbuild being over eager to clean things out and people getting annoyed at "spurious" rebuilds. In this case at least I suspect there's nothing we can do to detect this case.