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

unexpectedly panick when compiling mysql_common #4584

Closed
sylvain101010 opened this issue Sep 13, 2019 · 14 comments · Fixed by #4590
Closed

unexpectedly panick when compiling mysql_common #4584

sylvain101010 opened this issue Sep 13, 2019 · 14 comments · Fixed by #4590
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@sylvain101010
Copy link

Compiler panics when compiling mysql_common 0.18.0.

I tried to lint a project using mysql_common as dependencies using cargo clippy but I got the following error:

error: internal compiler error: src/librustc/ty/context.rs:516: node_type: no type for node `expr 5 (hir_id=HirId { owner: DefIndex(228), local_id: 255 })`

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:644:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


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.38.0-nightly (8a58268b5 2019-07-31) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 --crate-type lib

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

error: Could not compile `mysql_common`

I got the same error with the following Rust versions:

  • nightly-2019-08-01
  • nightly-2019-08-17
  • nightly-2019-09-11
  • nightly-2019-09-13

But it works with:

nightly-2019-07-19

@Centril
Copy link
Contributor

Centril commented Sep 13, 2019

Please provide a backtrace as the message above suggests.

@sylvain101010
Copy link
Author

sylvain101010 commented Sep 19, 2019

Hi,

with RUST_BACKTRACE=1

error: internal compiler error: src/librustc/ty/context.rs:515: node_type: no type for node `expr 5 (hir_id=HirId { owner: DefIndex(228), local_id: 255 })`

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:643:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:61
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:65
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:50
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:214
  10: rustc::util::common::panic_hook
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:481
  12: std::panicking::begin_panic
  13: rustc_errors::Handler::bug
  14: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  15: rustc::ty::context::tls::with_opt::{{closure}}
  16: rustc::ty::context::tls::with_context_opt
  17: rustc::ty::context::tls::with_opt
  18: rustc::util::bug::opt_span_bug_fmt
  19: rustc::util::bug::bug_fmt
  20: rustc::ty::context::TypeckTables::node_type::{{closure}}
  21: rustc::ty::context::TypeckTables::expr_ty
  22: clippy_lints::consts::ConstEvalLateContext::expr
  23: clippy_lints::consts::constant_simple
  24: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  25: clippy_lints::utils::hir_utils::SpanlessHash::hash_tykind
  26: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  27: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  28: clippy_lints::utils::hir_utils::SpanlessHash::hash_block
  29: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  30: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  31: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  32: clippy_lints::utils::hir_utils::SpanlessHash::hash_block
  33: clippy_lints::utils::hir_utils::SpanlessHash::hash_expr
  34: <clippy_lints::copies::CopyAndPaste as rustc::lint::LateLintPass>::check_expr
  35: <rustc::lint::context::LateLintPassObjects as rustc::lint::LateLintPass>::check_expr
  36: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  37: rustc::hir::intravisit::walk_expr
  38: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  39: rustc::hir::intravisit::walk_arm
  40: rustc::hir::intravisit::walk_expr
  41: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  42: rustc::hir::intravisit::walk_expr
  43: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  44: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_nested_body
  45: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_fn
  46: rustc::hir::intravisit::walk_impl_item
  47: rustc::hir::intravisit::Visitor::visit_nested_impl_item
  48: rustc::hir::intravisit::walk_item
  49: rustc::hir::intravisit::Visitor::visit_nested_item
  50: rustc::hir::intravisit::walk_item
  51: rustc::hir::intravisit::Visitor::visit_nested_item
  52: rustc::hir::intravisit::walk_crate
  53: rustc::lint::context::late_lint_pass_crate
  54: rustc::lint::context::late_lint_crate
  55: rustc::util::common::time
  56: rustc::util::common::time
  57: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  58: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  59: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  60: rustc_interface::passes::analysis::{{closure}}
  61: rustc::util::common::time
  62: rustc_interface::passes::analysis
  63: rustc::ty::query::__query_compute::analysis
  64: rustc::dep_graph::graph::DepGraph::with_task_impl
  65: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  66: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  67: rustc_interface::passes::create_global_ctxt::{{closure}}
  68: rustc_interface::interface::run_compiler_in_existing_thread_pool
  69: std::thread::local::LocalKey<T>::with
  70: scoped_tls::ScopedKey<T>::set
  71: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error


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 (eb48d6bde 2019-09-12) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 --crate-type lib

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

error: Could not compile `mysql_common`.

@sylvain101010
Copy link
Author

sylvain101010 commented Sep 19, 2019

here is the repository to reproduce: https://gitlab.com/bloom42/phaser, just run make lint with one of the affected Rust versions

Please note it does not panic when compiling, just when clippy is 'checking'

@spease
Copy link

spease commented Sep 26, 2019

I’m seeing this error in stable now when I run clippy. Haven’t localized it to a package yet. This may block us from adopting 1.38

EDIT: Host tuple x86_64-apple-darwin

@Centril
Copy link
Contributor

Centril commented Sep 26, 2019

@Manishearth Manishearth transferred this issue from rust-lang/rust Sep 26, 2019
@Manishearth
Copy link
Member

Transferred to clippy

@Manishearth
Copy link
Member

(It might be worth replacing the ICE message when compiling in clippy mode)

@mati865
Copy link
Contributor

mati865 commented Sep 26, 2019

Tracked with details in #4579

(It might be worth replacing the ICE message when compiling in clippy mode)

^^ #2734 (comment)

@sylvain101010
Copy link
Author

@spease as as workaround you can do cargo +nightly-2019-07-19 clippy while waiting for a fix

@flip1995
Copy link
Member

flip1995 commented Oct 1, 2019

@Manishearth I have a fix for this ICE in #4590, currently waiting for a review 😉

@flip1995 flip1995 mentioned this issue Oct 1, 2019
@Manishearth
Copy link
Member

perfect, will land after rustup

bors added a commit that referenced this issue Oct 1, 2019
Fix ICE #4579

Fixes #4579
Fixes #4584

r? @phansch

changelog: Fix ICE caused by Clippys const-utils
@sylvain101010
Copy link
Author

hi, @Manishearth, a rather noobish question but at which nightly release can we expect the fix since it's merged?

bors added a commit that referenced this issue Oct 2, 2019
Fix ICE #4579

Fixes #4579
Fixes #4584

r? @phansch

changelog: Fix ICE caused by Clippys const-utils
@phansch phansch added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Oct 2, 2019
bors added a commit that referenced this issue Oct 2, 2019
Fix ICE #4579

Fixes #4579
Fixes #4584

r? @phansch

changelog: Fix ICE caused by Clippys const-utils
@flip1995
Copy link
Member

flip1995 commented Oct 2, 2019

#4590 is currently waiting on bors. After this a rust PR has to be created, which bumps the Clippy submodule in the compiler (Most of the time such PRs are only created if Clippy needs a fix because of a rustc breakage). Once this PR is merged, the fix will be in the next nightly.

TL;DR: Probably 2019-10-03 or 2019-10-04, no guarantees though.

@sylvain101010
Copy link
Author

Ack, Thank you!

@bors bors closed this as completed in 83f90aa Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants