rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.3k stars 12.72k forks source link

assert failed ty/query/on_disk_cache.rs:528:5 #58292

Closed Antiarchitect closed 5 years ago

Antiarchitect commented 5 years ago

Have just moved some functions into modules and have fought all warnings when suddenly:

[/home/andrey/Projects/Spotter/api-rust][ruby-2.2.3][master] >>> RUST_BACKTRACE=1 cargo build --verbose
       Fresh semver-parser v0.7.0
       Fresh autocfg v0.1.2
       Fresh rand_core v0.4.0
       Fresh void v1.0.2
       Fresh lazy_static v1.2.0
       Fresh nodrop v0.1.13
       Fresh cfg-if v0.1.6
       Fresh unicode-xid v0.1.0
       Fresh stable_deref_trait v1.1.1
       Fresh memoffset v0.2.1
       Fresh scopeguard v0.3.3
       Fresh cc v1.0.29
       Fresh version_check v0.1.5
       Fresh futures v0.1.25
       Fresh encoding_index_tests v0.1.4
       Fresh matches v0.1.8
       Fresh slab v0.4.2
       Fresh lazycell v1.2.1
       Fresh siphasher v0.2.3
       Fresh rustc-demangle v0.1.13
       Fresh percent-encoding v1.0.1
       Fresh arc-swap v0.3.7
       Fresh quick-error v1.2.2
       Fresh linked-hash-map v0.4.2
       Fresh safemem v0.3.0
       Fresh untrusted v0.6.2
       Fresh bitflags v1.0.4
       Fresh itoa v0.4.3
       Fresh ucd-util v0.1.3
       Fresh fnv v1.0.6
       Fresh dtoa v0.4.3
       Fresh utf8-ranges v1.0.2
       Fresh indexmap v1.0.2
       Fresh string v0.1.3
       Fresh language-tags v0.2.2
       Fresh sha1 v0.6.0
       Fresh termcolor v1.0.4
       Fresh json v0.11.13
       Fresh semver v0.9.0
       Fresh rand_core v0.3.1
       Fresh rand_jitter v0.1.3
       Fresh unreachable v1.0.0
       Fresh thread_local v0.3.6
       Fresh crossbeam-utils v0.6.5
       Fresh log v0.4.6
       Fresh owning_ref v0.4.0
       Fresh tokio-sync v0.1.1
       Fresh tower-service v0.1.0
       Fresh encoding-index-tradchinese v1.20141219.5
       Fresh encoding-index-korean v1.20141219.5
       Fresh encoding-index-japanese v1.20141219.5
       Fresh encoding-index-singlebyte v1.20141219.5
       Fresh encoding-index-simpchinese v1.20141219.5
       Fresh unicode-bidi v0.3.4
       Fresh humantime v1.2.0
       Fresh lru-cache v0.1.1
       Fresh regex-syntax v0.6.5
       Fresh rustc_version v0.2.3
       Fresh libc v0.2.48
       Fresh rand_xorshift v0.1.1
       Fresh rand_isaac v0.1.1
       Fresh rand_hc v0.1.0
       Fresh proc-macro2 v0.4.27
       Fresh smallvec v0.6.8
       Fresh arrayvec v0.4.10
       Fresh tokio-executor v0.1.6
       Fresh byteorder v1.3.1
       Fresh lock_api v0.1.5
       Fresh encoding v0.2.33
       Fresh num-traits v0.2.6
       Fresh ryu v0.2.7
       Fresh crc32fast v1.1.2
       Fresh serde v1.0.87
       Fresh httparse v1.3.3
       Fresh rand_os v0.1.2
       Fresh iovec v0.1.2
       Fresh num_cpus v1.9.0
       Fresh net2 v0.2.33
       Fresh hostname v0.1.5
       Fresh memchr v2.1.3
       Fresh rand v0.5.6
       Fresh socket2 v0.3.8
       Fresh signal-hook v0.1.7
       Fresh time v0.1.42
       Fresh atty v0.2.11
       Fresh rand_chacha v0.1.1
       Fresh quote v0.6.11
       Fresh crossbeam-channel v0.3.8
       Fresh unicode-normalization v0.1.8
       Fresh crossbeam-epoch v0.7.1
       Fresh tokio-current-thread v0.1.4
       Fresh tokio-timer v0.2.10
       Fresh base64 v0.9.3
       Fresh base64 v0.10.1
       Fresh backtrace-sys v0.1.28
       Fresh miniz-sys v0.1.11
       Fresh brotli-sys v0.3.2
       Fresh ring v0.13.5
       Fresh unicase v1.4.2
       Fresh unicase v2.2.0
       Fresh num-integer v0.1.39
       Fresh serde_json v1.0.38
       Fresh bytes v0.4.11
       Fresh futures-cpupool v0.1.8
       Fresh mio v0.6.16
       Fresh resolv-conf v0.6.2
       Fresh nom v4.2.0
       Fresh aho-corasick v0.6.9
       Fresh syn v0.15.26
       Fresh idna v0.1.5
       Fresh crossbeam-deque v0.6.3
       Fresh backtrace v0.3.13
       Fresh flate2 v1.0.6
       Fresh brotli2 v0.3.2
       Fresh phf_shared v0.7.24
       Fresh mime v0.3.13
       Fresh chrono v0.4.6
       Fresh rand_pcg v0.1.1
       Fresh tokio-io v0.1.11
       Fresh http v0.1.15
       Fresh mio-uds v0.6.7
       Fresh regex v1.1.0
       Fresh synstructure v0.10.1
       Fresh v_escape_derive v0.2.1
       Fresh actix_derive v0.3.2
       Fresh serde_derive v1.0.87
       Fresh url v1.7.2
       Fresh phf v0.7.24
       Fresh serde_with v1.0.0
       Fresh rand v0.6.5
       Fresh tokio-codec v0.1.1
       Fresh h2 v0.1.16
       Fresh env_logger v0.6.0
       Fresh failure_derive v0.1.5
       Fresh v_escape v0.3.2
       Fresh serde_urlencoded v0.5.4
       Fresh cookie v0.11.0
       Fresh parking_lot_core v0.4.0
       Fresh phf_generator v0.7.24
       Fresh uuid v0.7.2
       Fresh failure v0.1.5
       Fresh v_htmlescape v0.3.2
       Fresh parking_lot v0.7.1
       Fresh phf_codegen v0.7.24
       Fresh crossbeam v0.6.0
       Fresh tokio-reactor v0.1.8
       Fresh tokio-threadpool v0.1.11
       Fresh tokio-udp v0.1.3
       Fresh tokio-tcp v0.1.3
       Fresh tokio-uds v0.2.5
       Fresh tokio-signal v0.2.7
       Fresh tokio-fs v0.1.5
       Fresh trust-dns-proto v0.6.3
       Fresh trust-dns-proto v0.5.0
       Fresh mime_guess v2.0.0-alpha.6
       Fresh tokio v0.1.15
       Fresh trust-dns-resolver v0.10.3
       Fresh actix v0.7.9
       Fresh actix-net v0.2.6
       Fresh actix-web v0.7.18
   Compiling spotter-api-rust v0.2.0 (/home/andrey/Projects/Spotter/api-rust)
     Running `rustc --edition=2018 --crate-name spotter_api_rust src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=7d9f4daa11c0f14b -C extra-filename=-7d9f4daa11c0f14b --out-dir /home/andrey/Projects/Spotter/api-rust/target/debug/deps -C incremental=/home/andrey/Projects/Spotter/api-rust/target/debug/incremental -L dependency=/home/andrey/Projects/Spotter/api-rust/target/debug/deps --extern actix=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libactix-7ef5262535a1b5fe.rlib --extern actix_web=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libactix_web-55a1bc6ad99cbcb3.rlib --extern bytes=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libbytes-4a075df6f606dfa2.rlib --extern chrono=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libchrono-e77df449469bc4dd.rlib --extern env_logger=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libenv_logger-8d1a98b183a5935f.rlib --extern futures=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libfutures-9876026b2cd27988.rlib --extern json=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libjson-3b030899263fd713.rlib --extern lazy_static=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/liblazy_static-e15de2558ea751ff.rlib --extern log=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/liblog-c3446220cd684946.rlib --extern serde=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde-29c752743a49150b.rlib --extern serde_derive=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde_derive-e2475ec23a5d303a.so --extern serde_json=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde_json-60553b8760404a99.rlib --extern serde_with=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde_with-b99235fe1a6c7a26.rlib --extern spotter_api_rust=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libspotter_api_rust-d50bf6e45425e0f6.rlib -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/backtrace-sys-05c3c35a08944a54/out -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/brotli-sys-2a572b78f51de309/out -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/ring-4310e9816151900b/out -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/miniz-sys-48ce65d304296d7a/out`
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `45231`,
 right: `45295`', src/librustc/ty/query/on_disk_cache.rs:528:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:211
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:227
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:495
   6: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:398
   7: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:353
   8: rustc::ty::query::on_disk_cache::OnDiskCache::load_diagnostics
   9: rustc::dep_graph::graph::DepGraph::try_mark_green
  10: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_mark_green_and_read
  11: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  12: rustc::ty::trait_def::trait_impls_of_provider
  13: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::trait_impls_of<'tcx>>::compute
  14: rustc::ty::context::tls::with_context
  15: rustc::dep_graph::graph::DepGraph::with_task_impl
  16: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  17: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  18: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query
  19: rustc::ty::query::plumbing::force_from_dep_node
  20: rustc::dep_graph::graph::DepGraph::try_mark_green
  21: rustc::dep_graph::graph::DepGraph::try_mark_green
  22: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_mark_green_and_read
  23: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  24: rustc::ty::instance::Instance::resolve
  25: rustc::ty::instance::Instance::resolve_for_vtable
  26: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::spec_extend
  27: <rustc_mir::monomorphize::collector::MirNeighborCollector<'a, 'tcx> as rustc::mir::visit::Visitor<'tcx>>::visit_rvalue
  28: rustc_mir::monomorphize::collector::collect_items_rec
  29: rustc_mir::monomorphize::collector::collect_items_rec
  30: rustc_mir::monomorphize::collector::collect_items_rec
  31: rustc_mir::monomorphize::collector::collect_items_rec
  32: rustc_mir::monomorphize::collector::collect_items_rec
  33: rustc_mir::monomorphize::collector::collect_items_rec
  34: rustc_mir::monomorphize::collector::collect_items_rec
  35: rustc_mir::monomorphize::collector::collect_items_rec
  36: rustc_mir::monomorphize::collector::collect_items_rec
  37: rustc_mir::monomorphize::collector::collect_items_rec
  38: rustc_mir::monomorphize::collector::collect_items_rec
  39: rustc_mir::monomorphize::collector::collect_items_rec
  40: rustc_mir::monomorphize::collector::collect_items_rec
  41: rustc_mir::monomorphize::collector::collect_items_rec
  42: rustc_mir::monomorphize::collector::collect_crate_mono_items::{{closure}}
  43: rustc::util::common::time
  44: rustc_mir::monomorphize::collector::collect_crate_mono_items
  45: rustc::util::common::time
  46: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  47: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::collect_and_partition_mono_items<'tcx>>::compute
  48: rustc::ty::context::tls::with_context
  49: rustc::dep_graph::graph::DepGraph::with_task_impl
  50: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  51: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  52: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::get_query
  53: rustc_codegen_ssa::base::codegen_crate
  54: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  55: rustc::util::common::time
  56: rustc_driver::driver::phase_4_codegen
  57: rustc_driver::driver::compile_input::{{closure}}
  58: rustc::ty::context::tls::enter_context
  59: <std::thread::local::LocalKey<T>>::with
  60: rustc::ty::context::TyCtxt::create_and_enter
  61: rustc_driver::driver::compile_input
  62: rustc_driver::run_compiler_with_pool
  63: <scoped_tls::ScopedKey<T>>::set
  64: rustc_driver::run_compiler
  65: rustc_driver::monitor::{{closure}}
  66: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:102
  67: rustc_driver::run
  68: rustc_driver::main
  69: std::rt::lang_start::{{closure}}
  70: std::panicking::try::do_call
             at src/libstd/rt.rs:59
             at src/libstd/panicking.rs:310
  71: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:102
  72: std::rt::lang_start_internal
             at src/libstd/panicking.rs:289
             at src/libstd/panic.rs:398
             at src/libstd/rt.rs:58
  73: main
  74: __libc_start_main
  75: <unknown>
query stack during panic:
#0 [trait_impls_of] trait impls of `std::any::Any`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
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.32.0 (9fda7c223 2019-01-16) running on x86_64-unknown-linux-gnu

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

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

error: Could not compile `spotter-api-rust`.

Caused by:
  process didn't exit successfully: `rustc --edition=2018 --crate-name spotter_api_rust src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=7d9f4daa11c0f14b -C extra-filename=-7d9f4daa11c0f14b --out-dir /home/andrey/Projects/Spotter/api-rust/target/debug/deps -C incremental=/home/andrey/Projects/Spotter/api-rust/target/debug/incremental -L dependency=/home/andrey/Projects/Spotter/api-rust/target/debug/deps --extern actix=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libactix-7ef5262535a1b5fe.rlib --extern actix_web=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libactix_web-55a1bc6ad99cbcb3.rlib --extern bytes=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libbytes-4a075df6f606dfa2.rlib --extern chrono=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libchrono-e77df449469bc4dd.rlib --extern env_logger=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libenv_logger-8d1a98b183a5935f.rlib --extern futures=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libfutures-9876026b2cd27988.rlib --extern json=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libjson-3b030899263fd713.rlib --extern lazy_static=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/liblazy_static-e15de2558ea751ff.rlib --extern log=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/liblog-c3446220cd684946.rlib --extern serde=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde-29c752743a49150b.rlib --extern serde_derive=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde_derive-e2475ec23a5d303a.so --extern serde_json=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde_json-60553b8760404a99.rlib --extern serde_with=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libserde_with-b99235fe1a6c7a26.rlib --extern spotter_api_rust=/home/andrey/Projects/Spotter/api-rust/target/debug/deps/libspotter_api_rust-d50bf6e45425e0f6.rlib -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/backtrace-sys-05c3c35a08944a54/out -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/brotli-sys-2a572b78f51de309/out -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/ring-4310e9816151900b/out -L native=/home/andrey/Projects/Spotter/api-rust/target/debug/build/miniz-sys-48ce65d304296d7a/out` (exit code: 101)
hellow554 commented 5 years ago

Do you have a small piece of code that you can show us that leads to the panic?

Antiarchitect commented 5 years ago

@hellow554 I'm trying to pick out one, but no success yet.

memoryruins commented 5 years ago

If you have a branch of the code that produces the ICE, we can try to help minimize it with you.

Antiarchitect commented 5 years ago

The problem is - I cannot reproduce it anymore. At least on another machine.

memoryruins commented 5 years ago

Based on the panic, it was an issue that occurred during incremental compilation. To reproduce, you would most likely need to build the project, make a similar change that led up to the ICE, then try to compile again.

Antiarchitect commented 5 years ago

Sorry guys, cannot reproduce :(

hellow554 commented 5 years ago

Maybe it has been fixed in the mean time (unlikely ^^). I guess you can close this. When it comes up again and you know how to do it, just reopen it. Thanks anyway for the report! <3