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 in import resolution with renamed crate import #64143

Closed
shawntabrizi opened this issue Sep 4, 2019 · 7 comments
Closed

ICE in import resolution with renamed crate import #64143

shawntabrizi opened this issue Sep 4, 2019 · 7 comments
Labels
A-resolve Area: Name resolution I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@shawntabrizi
Copy link

I tried renaming a crate import and a bunch of dependent uses of the crate, and ended up seeing a unexpected panic in the compiler.

Log is here: https://gitlab.parity.io/parity/substrate/-/jobs/223357

Compiling srml-support v2.0.0 (/builds/parity/substrate/srml/support)
thread 'rustc' panicked at 'src/librustc_resolve/resolve_imports.rs:847: inconsistent resolution for an import', src/librustc/util/bug.rs:37:26
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: rustc::util::common::panic_hook
   7: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:481
   8: std::panicking::begin_panic
   9: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  10: rustc::ty::context::tls::with_opt::{{closure}}
  11: rustc::ty::context::tls::with_context_opt
  12: rustc::ty::context::tls::with_opt
  13: rustc::util::bug::opt_span_bug_fmt
  14: rustc::util::bug::span_bug_fmt
  15: rustc_resolve::resolve_imports::ImportResolver::finalize_import
  16: rustc_resolve::resolve_imports::ImportResolver::finalize_imports
  17: rustc_resolve::Resolver::resolve_crate
  18: rustc::util::common::time
  19: rustc_interface::passes::configure_and_expand_inner
  20: rustc_interface::passes::configure_and_expand::{{closure}}
  21: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  22: rustc_interface::passes::configure_and_expand
  23: rustc_interface::queries::Query<T>::compute
  24: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::expansion
  25: rustc_interface::interface::run_compiler_in_existing_thread_pool
  26: std::thread::local::LocalKey<T>::with
  27: scoped_tls::ScopedKey<T>::set
  28: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stack during panic:
end of query stack

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.39.0-nightly (9af17757b 2019-09-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C panic=abort -C link-arg=--export-table -C link-arg=--export=__heap_base --crate-type rlib

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

error: Could not compile `srml-support`.

To learn more, run the command again with --verbose.

warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `node-runtime v2.0.0 (/builds/parity/substrate/node/runtime)`

Caused by:
  process didn't exit successfully: `/builds/parity/substrate/target/release/build/node-runtime-8543150fed0dc4f2/build-script-build` (exit code: 1)
--- stdout
Executing build command: "rustup" "run" "nightly" "cargo" "build" "--target=wasm32-unknown-unknown" "--manifest-path=/builds/parity/substrate/target/release/wbuild/node-runtime/Cargo.toml" "--release"

This was the specific commit, but errors may have started one commit before:

paritytech/substrate@ba2ec61

@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 4, 2019
@hellow554
Copy link
Contributor

I can confirm the ICE with paritytech/substrate@9a60704 and rustc 1.39.0-nightly (dfd43f0fd 2019-09-01)

@Centril Centril added A-resolve Area: Name resolution T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-nominated labels Sep 5, 2019
@estebank
Copy link
Contributor

estebank commented Sep 5, 2019

CC @petrochenkov

@petrochenkov petrochenkov self-assigned this Sep 5, 2019
@nikomatsakis nikomatsakis changed the title rust compiler bug report IC in import resolution with renamed crate import Sep 5, 2019
@nikomatsakis nikomatsakis changed the title IC in import resolution with renamed crate import ICE in import resolution with renamed crate import Sep 5, 2019
@nikomatsakis nikomatsakis added P-medium Medium priority and removed I-nominated labels Sep 5, 2019
@nikomatsakis
Copy link
Contributor

check-in from compiler triage:

I'm going with medium priority on this; it looks like @petrochenkov is working on it already in any case. In particular, this isn't marked as a regression, and I think the ICE is primarily affecting an "in-progress" change, so it's not blocking anything on crates.io from building or anything like that (right?).

@shawntabrizi
Copy link
Author

This ICE is not blocking anything on my side.

@petrochenkov
Copy link
Contributor

petrochenkov commented Oct 5, 2019

@shawntabrizi
Could you clarify, does the issue happen only during cross-compilation to wasm?
That's what I see in the log:

Executing build command: "rustup" "run" "nightly" "cargo" "build" "--target=wasm32-unknown-unknown" "--manifest-path=/builds/parity/substrate/target/release/wbuild/node-template-runtime/Cargo.toml" "--release"

In that case this is a duplicate of #56935 or #64450.

I wasn't able to reproduce the cross-compilation testing locally, and without cross-compilation the build completes successfully at least for srml-support.

@petrochenkov
Copy link
Contributor

In general, help with a minimized reproduction would be appreciated.
It's hard to reproduce issues in a crate with 600 dependencies and a bunch of non-Rust pre-requisites some of which don't build on my platform.

@petrochenkov petrochenkov removed their assignment Oct 5, 2019
@shawntabrizi
Copy link
Author

@petrochenkov Sorry, I wont be able to help with a minimal reproduction step. It is just something I ran into and reported. I will close this issue, and allow you to reopen if you feel you can further investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority 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

7 participants