Skip to content

clippy rustc panic #6493

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

Closed
tdyas opened this issue Dec 22, 2020 · 2 comments
Closed

clippy rustc panic #6493

tdyas opened this issue Dec 22, 2020 · 2 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@tdyas
Copy link

tdyas commented Dec 22, 2020

cargo version: cargo 1.48.0 (65cbdd2dc 2020-10-14)
rustc version: rustc 1.48.0 (7eac88abb 2020-11-16)

I encountered a rustc panic while running cargo clippy. I made a source code change and then the panic occurred. After reverting the source code change, the panic still occurs even though clippy ran just fine on the code before the change.

Panic message:

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `1002111927320821928687967599834759150`', compiler/rustc_middle/src/ty/query/on_disk_cache.rs:553:5
stack backtrace:
   0:        0x103478aa4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcfc48256a5ab8835
   1:        0x1034df590 - core::fmt::write::haf3903118f694c48
   2:        0x10346a0a6 - std::io::Write::write_fmt::h7385463ac87804ed
   3:        0x10347d46f - std::panicking::default_hook::{{closure}}::h91bd4c58cf71392b
   4:        0x10347d13d - std::panicking::default_hook::h7bd29c87df967048
   5:        0x102d1a790 - clippy_driver::report_clippy_ice::ha6f8893b9494152a
   6:        0x10347db9e - std::panicking::rust_panic_with_hook::hae2b05f08a320721
   7:        0x10347d6fb - std::panicking::begin_panic_handler::{{closure}}::h72d68d3a77e0b718
   8:        0x103478f18 - std::sys_common::backtrace::__rust_end_short_backtrace::h7c5e286792f94edb
   9:        0x10347d6ba - _rust_begin_unwind
  10:        0x103503e4b - std::panicking::begin_panic_fmt::h6826a3ebe3a95a51
  11:        0x10ec65c21 - rustc_middle::ty::query::on_disk_cache::OnDiskCache::new::hbdcff5bfe914d997
  12:        0x10df2ad24 - rustc_incremental::persist::load::load_query_result_cache::h9d7279d740050e3e
  13:        0x10ac4d178 - rustc_interface::passes::create_global_ctxt::h0a00e9a607f14bd6
  14:        0x10ac7e33d - rustc_interface::queries::Queries::global_ctxt::he0bb274ddf484806
  15:        0x10aa7d1ea - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::heacbf49337f5fb9d
  16:        0x10aa5a321 - rustc_span::with_source_map::h3927afb6bcf6a169
  17:        0x10aa787c9 - scoped_tls::ScopedKey<T>::set::h5608e7cc9397961b
  18:        0x10aa80644 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9b82f31f81e95856
  19:        0x10aa135bc - core::ops::function::FnOnce::call_once{{vtable.shim}}::h5baa2aca5ae17340
  20:        0x10348bb7d - std::sys::unix::thread::Thread::new::thread_start::he3e6719579180a65
  21:     0x7fff6ae5a109 - __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-clippy/issues/new

note: Clippy version: clippy 0.0.212 (7eac88abb 2020-11-16)

query stack during panic:
end of query stack
error: could not compile `engine`

I ran cargo clean and re-ran clippy again with the code change, and now it works fine.

I suspect some form of corruption of the on-disk cache given the panic originated in on_disk_cache.rs and was fixed by wiping the cache.

@giraffate
Copy link
Contributor

Thaks for your report!

It might be a rustc bug, not Clippy. This is similar to rust-lang/rust#71733.

@giraffate giraffate added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 22, 2020
@giraffate
Copy link
Contributor

Thanks for your comment on rust-lang/rust.

I'm closing this because it seems to be a rustc bug, not Clippy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants