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: Failed to get crate data #84049

Closed
ahcm opened this issue Apr 10, 2021 · 4 comments
Closed

ICE: Failed to get crate data #84049

ahcm opened this issue Apr 10, 2021 · 4 comments
Labels
A-metadata Area: Crate metadata 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

@ahcm
Copy link

ahcm commented Apr 10, 2021

Using rustic directly:

rustc t.rs --edition=2018 --extern async_std=target/release/libasync_std.rlib

should produce:

error[E0463]: can't find crate for `kv_log_macro` which `async_std` depends on

Code

use async_std;
fn main()
{
}

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (07e0e2ec2 2021-03-24)
binary: rustc
commit-hash: 07e0e2ec268c140e607e1ac7f49f145612d0f597
commit-date: 2021-03-24
host: aarch64-apple-darwin
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

$ rustc t.rs --edition=2018 --extern async_std=target/release/libasync_std.rlib
thread 'rustc' panicked at 'Failed to get crate data for crate16', compiler/rustc_metadata/src/creader.rs:136:32
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.53.0-nightly (07e0e2ec2 2021-03-24) running on aarch64-apple-darwin

query stack during panic:
end of query stack
Backtrace

thread 'rustc' panicked at 'Failed to get crate data for crate16', compiler/rustc_metadata/src/creader.rs:136:32
stack backtrace:
   0: _rust_begin_unwind
   1: std::panicking::begin_panic_fmt
   2: rustc_metadata::creader::CStore::get_crate_data::{{closure}}
   3: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   4: rustc_metadata::creader::CrateLoader::process_path_extern
   5: rustc_resolve::Resolver::extern_prelude_get
   6: rustc_resolve::macros::<impl rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope
   7: rustc_resolve::imports::<impl rustc_resolve::Resolver>::resolve_ident_in_module_unadjusted_ext
   8: rustc_resolve::Resolver::resolve_ident_in_module
   9: rustc_resolve::imports::ImportResolver::finalize_import::{{closure}}
  10: rustc_resolve::imports::ImportResolver::finalize_import
  11: rustc_resolve::imports::ImportResolver::finalize_imports
  12: rustc_session::utils::<impl rustc_session::session::Session>::time
  13: rustc_resolve::Resolver::resolve_crate
  14: rustc_interface::passes::configure_and_expand_inner
  15: rustc_interface::passes::configure_and_expand::{{closure}}
  16: ___rust_realloc
  17: rustc_interface::passes::configure_and_expand
  18: rustc_interface::queries::Queries::expansion
  19: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  20: rustc_span::with_source_map
  21: rustc_interface::interface::create_compiler_and_run
  22: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

@ahcm ahcm 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 Apr 10, 2021
@jyn514 jyn514 changed the title Refer ICE: Failed to get crate data Apr 10, 2021
@jyn514 jyn514 added the A-metadata Area: Crate metadata label Apr 10, 2021
@rosefromthedead
Copy link
Contributor

Veloren's nix build has a similar issue while compiling glutin_egl_sys' build.rs:

Build output
Building build.rs (glutin_egl_sys)
Running rustc --crate-name build_script_build build.rs --crate-type bin -C opt-level=3 -C codegen-units=8 -C incremental=no --edition 2018 --cfg feature="default" --out-dir target/build/glutin_egl_sys --emit=dep-info,link -L dependency=target/buildDeps --extern gl_generator=/nix/store/m2axask7avh3fsb35wscsk4k9zmass56-rust_gl_generator-0.14.0-lib/lib/libgl_generator-637e653e86.rlib --cap-lints allow --color always
thread 'rustc' panicked at 'Failed to get crate data for crate18', compiler/rustc_metadata/src/creader.rs:136:32
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.53.0-nightly (f82664191 2021-03-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C codegen-units=8 -C incremental --crate-type bin

query stack during panic:
end of query stack
Backtrace
thread 'rustc' panicked at 'Failed to get crate data for crate18', compiler/rustc_metadata/src/creader.rs:136:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f82664191d0e8764b7435b9d72eb0e366b8b1464/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/f82664191d0e8764b7435b9d72eb0e366b8b1464/library/std/src/panicking.rs:435:5
   2: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   3: rustc_metadata::creader::CrateLoader::maybe_process_path_extern
   4: rustc_resolve::Resolver::extern_prelude_get
   5: rustc_resolve::macros::<impl rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope
   6: rustc_resolve::Resolver::resolve_path_with_ribs::{{closure}}
   7: rustc_resolve::Resolver::resolve_path_with_ribs
   8: rustc_resolve::imports::ImportResolver::resolve_imports
   9: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::resolve_imports
  10: rustc_expand::expand::MacroExpander::fully_expand_fragment
  11: rustc_expand::expand::MacroExpander::expand_crate
  12: rustc_session::utils::<impl rustc_session::session::Session>::time
  13: rustc_interface::passes::configure_and_expand_inner
  14: rustc_interface::passes::configure_and_expand::{{closure}}
  15: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  16: rustc_interface::passes::configure_and_expand
  17: rustc_interface::queries::Queries::expansion
  18: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  19: rustc_span::with_source_map
  20: rustc_interface::interface::create_compiler_and_run
  21: scoped_tls::ScopedKey<T>::set

@andir
Copy link

andir commented Jun 17, 2021

I am seeing the same error on stable rustc. The bug consistently only happens during GitHub Action runs when running clippy. The compiler toolchain between GitHub Actions and local execution is bit-by-bit identical.

The build log can be found here: https://github.com/NixOS/ofborg/runs/2848724177#step:5:537

The seemingly relevant information is this:

thread 'rustc' panicked at 'Failed to get crate data for crate4', compiler/rustc_metadata/src/creader.rs:136:32
stack backtrace:
   0: rust_begin_unwind
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:435:5
   2: rustc_metadata::creader::CrateLoader::maybe_resolve_crate
   3: rustc_metadata::creader::CrateLoader::maybe_process_path_extern
   4: rustc_resolve::Resolver::extern_prelude_get
   5: rustc_resolve::macros::<impl rustc_resolve::Resolver>::early_resolve_ident_in_lexical_scope
   6: rustc_resolve::Resolver::resolve_path_with_ribs::{{closure}}
   7: rustc_resolve::Resolver::resolve_path_with_ribs
   8: rustc_resolve::imports::ImportResolver::resolve_imports
   9: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::resolve_imports
  10: rustc_expand::expand::MacroExpander::fully_expand_fragment
  11: rustc_expand::expand::MacroExpander::expand_crate
  12: rustc_session::utils::<impl rustc_session::session::Session>::time
  13: rustc_interface::passes::configure_and_expand_inner
  14: rustc_interface::passes::configure_and_expand::{{closure}}
  15: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  16: rustc_interface::passes::configure_and_expand
  17: rustc_interface::queries::Queries::expansion
  18: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  19: rustc_span::with_source_map
  20: rustc_interface::interface::create_compiler_and_run
  21: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.52.1 (9bc8c42bb 2021-05-09) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 --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 `value-bag`

@kturney
Copy link

kturney commented Jun 22, 2021

According to #85847 (comment) this is probably a duplicate of #56935

@ahcm
Copy link
Author

ahcm commented Jun 22, 2021

According to #85847 fixed by https://github.com/Canop/lazy-regex/pull/6/files.
At least it does not happen in rustc 1.54.0-nightly (ed597e7 2021-06-08) anymore.

@ahcm ahcm closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata 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