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 for cargo clippy #4653

Closed
tspiteri opened this issue Oct 11, 2019 · 4 comments
Closed

ICE for cargo clippy #4653

tspiteri opened this issue Oct 11, 2019 · 4 comments

Comments

@tspiteri
Copy link
Contributor

tspiteri commented Oct 11, 2019

With the current beta, cargo +beta clippy is giving an ICE for the Rug crate, while cargo +stable clippy works fine, and cargo +beta check works fine too.

$ cargo +stable clippy --version
clippy 0.0.212 (3aea860 2019-09-03)

$ cargo +beta clippy --version
clippy 0.0.212 (157edad 2019-09-22)

$ #Rug version 1.6.0
$ RUST_BACKTRACE=1 cargo +beta clippy
# ...

error: internal compiler error: src/librustc/ty/context.rs:513: node_type: no type for node `expr 8 (hir_id=HirId { owner: DefIndex(3061), local_id: 87 })`

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:812: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:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   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:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  12: std::panicking::begin_panic
  13: rustc_errors::HandlerInner::bug
  14: rustc_errors::Handler::bug
  15: rustc::util::bug::opt_span_bug_fmt::{{closure}}
  16: rustc::ty::context::tls::with_opt::{{closure}}
  17: rustc::ty::context::tls::with_context_opt
  18: rustc::ty::context::tls::with_opt
  19: rustc::util::bug::opt_span_bug_fmt
  20: rustc::util::bug::bug_fmt
  21: rustc::ty::context::TypeckTables::node_type::{{closure}}
  22: rustc::ty::context::TypeckTables::expr_ty
  23: clippy_lints::consts::ConstEvalLateContext::expr
  24: clippy_lints::utils::is_integer_const
  25: <clippy_lints::misc::MiscLints as rustc::lint::LateLintPass>::check_expr
  26: <rustc::lint::context::LateLintPassObjects as rustc::lint::LateLintPass>::check_expr
  27: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  28: rustc::hir::intravisit::walk_expr
  29: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  30: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  31: rustc::hir::intravisit::walk_expr
  32: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  33: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_nested_body
  34: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_local
  35: rustc::hir::intravisit::walk_block
  36: rustc::hir::intravisit::walk_expr
  37: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr
  38: <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_nested_body
  39: rustc::hir::intravisit::walk_item
  40: rustc::hir::intravisit::Visitor::visit_nested_item
  41: rustc::hir::intravisit::walk_crate
  42: rustc::lint::context::late_lint_pass_crate
  43: rustc::lint::context::late_lint_crate
  44: rustc::util::common::time
  45: rustc::util::common::time
  46: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  47: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  48: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  49: rustc_interface::passes::analysis::{{closure}}
  50: rustc::util::common::time
  51: rustc_interface::passes::analysis
  52: rustc::ty::query::__query_compute::analysis
  53: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query
  54: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
  55: rustc_interface::passes::create_global_ctxt::{{closure}}
  56: rustc_interface::interface::run_compiler_in_existing_thread_pool
  57: std::thread::local::LocalKey<T>::with
  58: scoped_tls::ScopedKey<T>::set
  59: syntax::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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-beta.5 (fa5c2f3e5 2019-10-02) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
thread 'rustc' panicked at 'already borrowed: BorrowMutError', src/libcore/result.rs:1165:5
stack backtrace:
   0:     0x7f2909dbbac4 - backtrace::backtrace::libunwind::trace::h79ac9c0cd7ec3fe6
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1:     0x7f2909dbbac4 - backtrace::backtrace::trace_unsynchronized::h8c508a623a4c0e09
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2:     0x7f2909dbbac4 - std::sys_common::backtrace::_print_fmt::h0eecccbb7b8dd912
                               at src/libstd/sys_common/backtrace.rs:76
   3:     0x7f2909dbbac4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc382d503b733e6d1
                               at src/libstd/sys_common/backtrace.rs:60
   4:     0x7f2909df410c - core::fmt::write::h7dcfb7f769b38c9d
                               at src/libcore/fmt/mod.rs:1030
   5:     0x7f2909dafce7 - std::io::Write::write_fmt::h06ffa52aee2a16f6
                               at src/libstd/io/mod.rs:1412
   6:     0x7f2909dc02f5 - std::sys_common::backtrace::_print::h428be0eed57c0161
                               at src/libstd/sys_common/backtrace.rs:64
   7:     0x7f2909dc02f5 - std::sys_common::backtrace::print::h65507de7a79f6eb1
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f2909dc02f5 - std::panicking::default_hook::{{closure}}::h8c97e7bc07409338
                               at src/libstd/panicking.rs:196
   9:     0x7f2909dbffe6 - std::panicking::default_hook::hce02b115c2a7e240
                               at src/libstd/panicking.rs:210
  10:     0x7f290a2f5573 - rustc_driver::report_ice::h8b28325f9a4217f8
  11:     0x7f2909dc0adc - std::panicking::rust_panic_with_hook::hdec54d00a49e94ac
                               at src/libstd/panicking.rs:477
  12:     0x7f2909dc0592 - std::panicking::continue_panic_fmt::h90554080862699ad
                               at src/libstd/panicking.rs:380
  13:     0x7f2909dc0486 - rust_begin_unwind
                               at src/libstd/panicking.rs:307
  14:     0x7f2909deda9a - core::panicking::panic_fmt::h2106f3a8fcef644d
                               at src/libcore/panicking.rs:85
  15:     0x7f2909dedcd7 - core::result::unwrap_failed::h210bc4e738779aa6
                               at src/libcore/result.rs:1165
  16:     0x7f290c0cfed5 - rustc_errors::Handler::force_print_diagnostic::he1287cd1d344a711
  17:     0x7f290b9a7831 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::try_print_query_stack::h592395d34849759c
  18:     0x7f290a2f6185 - rustc_driver::report_ice::h8b28325f9a4217f8
  19:     0x7f2909dc0adc - std::panicking::rust_panic_with_hook::hdec54d00a49e94ac
                               at src/libstd/panicking.rs:477
  20:     0x7f290c0b734d - std::panicking::begin_panic::h51926c1472efc035
  21:     0x7f290c0d0633 - rustc_errors::HandlerInner::bug::h03559d4964051515
  22:     0x7f290c0cf51a - rustc_errors::Handler::bug::hf23e868273a3a097
  23:     0x7f290b965d43 - rustc::util::bug::opt_span_bug_fmt::{{closure}}::hbad2b2fda39153fe
  24:     0x7f290b965573 - rustc::ty::context::tls::with_opt::{{closure}}::h030e71c042157d16
  25:     0x7f290b9654e3 - rustc::ty::context::tls::with_context_opt::h22c0d293e3b13344
  26:     0x7f290b965527 - rustc::ty::context::tls::with_opt::h50ab4f8da3cbb994
  27:     0x7f290b965c58 - rustc::util::bug::opt_span_bug_fmt::h3638a8ae8a4b3580
  28:     0x7f290b965bc2 - rustc::util::bug::bug_fmt::hbc9a4e3a6599da15
  29:     0x7f290bb5bbad - rustc::ty::context::TypeckTables::node_type::{{closure}}::h10c9dc0ffeef5216
  30:     0x7f290bb5c19e - rustc::ty::context::TypeckTables::expr_ty::hf5aa594964e34f06
  31:     0x564c2be4d8b0 - clippy_lints::consts::ConstEvalLateContext::expr::h36f5ff066ef01a9a
  32:     0x564c2bd43f23 - clippy_lints::utils::is_integer_const::h2e6f0a3f7af647bb
  33:     0x564c2bd607c5 - <clippy_lints::misc::MiscLints as rustc::lint::LateLintPass>::check_expr::h929f436a4152187a
  34:     0x7f290b7715a3 - <rustc::lint::context::LateLintPassObjects as rustc::lint::LateLintPass>::check_expr::hc4fea29c7a17cd23
  35:     0x7f290a44a071 - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr::h2f8c6bf12a35e9fe
  36:     0x7f290a3de2d6 - rustc::hir::intravisit::walk_expr::h208c27c80470f4bc
  37:     0x7f290a44a07c - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr::h2f8c6bf12a35e9fe
  38:     0x7f290a44a07c - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr::h2f8c6bf12a35e9fe
  39:     0x7f290a3de10f - rustc::hir::intravisit::walk_expr::h208c27c80470f4bc
  40:     0x7f290a44a07c - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr::h2f8c6bf12a35e9fe
  41:     0x7f290a44abe4 - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_nested_body::hcc5022defd1932e6
  42:     0x7f290a44a45c - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_local::h042edad3da211224
  43:     0x7f290a3d87dc - rustc::hir::intravisit::walk_block::h3f6f8251e0cdacca
  44:     0x7f290a3de17e - rustc::hir::intravisit::walk_expr::h208c27c80470f4bc
  45:     0x7f290a44a07c - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_expr::h2f8c6bf12a35e9fe
  46:     0x7f290a44abe4 - <rustc::lint::context::LateContextAndPass<T> as rustc::hir::intravisit::Visitor>::visit_nested_body::hcc5022defd1932e6
  47:     0x7f290a3deede - rustc::hir::intravisit::walk_item::ha09bd9182253d688
  48:     0x7f290a4598b1 - rustc::hir::intravisit::Visitor::visit_nested_item::h042ca505e8822ed3
  49:     0x7f290a3d89de - rustc::hir::intravisit::walk_crate::h97b6329bc3d46705
  50:     0x7f290a45de07 - rustc::lint::context::late_lint_pass_crate::h4b3339c4de0a31a3
  51:     0x7f290a45d34e - rustc::lint::context::late_lint_crate::h92417ad15ab6a9bb
  52:     0x7f290a3e14e3 - rustc::util::common::time::h338f459a9ec0c455
  53:     0x7f290a3e17fb - rustc::util::common::time::h41de34123777363f
  54:     0x7f2909dd122a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  55:     0x7f290a3662e3 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h9f7a3e76149a5d86
  56:     0x7f2909dd122a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  57:     0x7f290a3e95d2 - rustc_interface::passes::analysis::{{closure}}::hb09ee3765fa56dff
  58:     0x7f290a3e2440 - rustc::util::common::time::h669d63cea4424be3
  59:     0x7f290a3a3fe4 - rustc_interface::passes::analysis::hab2842e60eb74b96
  60:     0x7f290a2b9211 - rustc::ty::query::__query_compute::analysis::h16b0d33070f2d6ff
  61:     0x7f290a2a1572 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hf6315fcc1116de3b
  62:     0x7f290a2c119a - rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::hdd95d0c27953caa5
  63:     0x7f290a42031a - rustc_interface::passes::create_global_ctxt::{{closure}}::h0409a5cd539bbce5
  64:     0x7f290a2c24ae - rustc_interface::interface::run_compiler_in_existing_thread_pool::hbb199514df143133
  65:     0x7f290a2f7682 - std::thread::local::LocalKey<T>::with::hb949a116d0a8656f
  66:     0x7f290a2fc71e - scoped_tls::ScopedKey<T>::set::hbe520439388e11d7
  67:     0x7f290a31c7a2 - syntax::with_globals::h4186acd6c44d73fa
  68:     0x7f290a28b3d0 - std::sys_common::backtrace::__rust_begin_short_backtrace::h332f67b09823822d
  69:     0x7f2909dd122a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  70:     0x7f290a2b4529 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h43aa66d8e67ef81e
  71:     0x7f2909da21cf - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::he9006009e7bfe07a
                               at /rustc/fa5c2f3e5724bce07bf1b70020e5745e7b693a57/src/liballoc/boxed.rs:922
  72:     0x7f2909dcfed0 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h3a6b07163f7d571c
                               at /rustc/fa5c2f3e5724bce07bf1b70020e5745e7b693a57/src/liballoc/boxed.rs:922
  73:     0x7f2909dcfed0 - std::sys_common::thread::start_thread::hb4545fb66183317a
                               at src/libstd/sys_common/thread.rs:13
  74:     0x7f2909dcfed0 - std::sys::unix::thread::Thread::new::thread_start::h51872330c191d8bf
                               at src/libstd/sys/unix/thread.rs:79
  75:     0x7f2909cf74c0 - start_thread
  76:     0x7f2909c0b553 - __clone
  77:                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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.39.0-beta.5 (fa5c2f3e5 2019-10-02) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
thread panicked while processing panic. aborting.
error: could not compile `rug`.

Caused by:
  process didn't exit successfully: `/home/trevor/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --edition=2018 --crate-name rug src/lib.rs --color always --crate-type lib --emit=dep-info,metadata -C debuginfo=2 --cfg 'feature="complex"' --cfg 'feature="default"' --cfg 'feature="float"' --cfg 'feature="gmp-mpfr-sys"' --cfg 'feature="integer"' --cfg 'feature="rand"' --cfg 'feature="rational"' -C metadata=fdfdce0d1d2b078e -C extra-filename=-fdfdce0d1d2b078e --out-dir /home/trevor/gitlab/rug/target/debug/deps -C incremental=/home/trevor/gitlab/rug/target/debug/incremental -L dependency=/home/trevor/gitlab/rug/target/debug/deps --extern gmp_mpfr_sys=/home/trevor/gitlab/rug/target/debug/deps/libgmp_mpfr_sys-fb8244b5d47c388a.rmeta --cfg try_from --cfg maybe_uninit --cfg gmp_limb_bits_64 -L native=/home/trevor/gitlab/rug/target/debug/build/gmp-mpfr-sys-c08dee8df3b91c17/out/lib` (signal: 4, SIGILL: illegal instruction)
@tspiteri
Copy link
Contributor Author

I've just tested on nightly and it's fixed there, I'm guessing by #4590.

Will the beta be updated with that fix before 1.39.0 is released, or will clippy ICE for the duration of the 1.39.0 release?

@mati865
Copy link
Contributor

mati865 commented Oct 11, 2019

I think the fix could be backported given how widespread is this issue.

@flip1995
Copy link
Member

Yeah, I think we should backport it to beta. I'm on it.

bors added a commit to rust-lang/rust that referenced this issue Oct 15, 2019
[Beta] Backport Clippy ICE fix to beta

There was an ICE in Clippy, when compiling `mysql_common`. Since this is a pretty popular crate, and there were a bunch of Clippy issues in the last few days, I think it is worth it to backport the fix (rust-lang/rust-clippy#4590) to beta.

cc rust-lang/rust-clippy#4653

r? @Manishearth
@tspiteri
Copy link
Contributor Author

This is now fixed in beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants