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

Analysis never finishes on servo #1805

Closed
matthiaskrgr opened this issue Sep 10, 2019 · 5 comments
Closed

Analysis never finishes on servo #1805

matthiaskrgr opened this issue Sep 10, 2019 · 5 comments
Labels
A-perf performance issues A-ty type system / type inference / traits / method resolution S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@matthiaskrgr
Copy link
Member

repro:

git clone https://github.com/servo/servo --depth=1
cd servo
git checkout 6ed204d692182e58b7b44b5a02cac4e758d70a14 
RUST_BACKTRACE=full ra_cli analysis-stats

backtrace:

Database loaded, 554 roots, 1.555925852s
Crates in this dir: 99
Total modules found: 1074
Total declarations: 41171
Total functions: 15950
Item Collection: 30.380988131s, 0b allocated 0b resident
███████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 1113/15950
processing: get_root_flow_background_color
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/slice/mod.rs:2715:10
stack backtrace:
   0:     0x56164483cf32 - backtrace::backtrace::libunwind::trace::h8a645919789e8d0b
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/libunwind.rs:88
   1:     0x56164483cf32 - backtrace::backtrace::trace_unsynchronized::h2b00fcd64a6db2a8
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.35/src/backtrace/mod.rs:66
   2:     0x56164483cf32 - std::sys_common::backtrace::_print::hb48dd402e7e4ee13
                               at src/libstd/sys_common/backtrace.rs:47
   3:     0x56164483cf32 - std::sys_common::backtrace::print::h5afe7278b7ee9221
                               at src/libstd/sys_common/backtrace.rs:36
   4:     0x56164483cf32 - std::panicking::default_hook::{{closure}}::h06704ce56e3f2eb7
                               at src/libstd/panicking.rs:200
   5:     0x56164483cc16 - std::panicking::default_hook::h79bfafe0b6650e1b
                               at src/libstd/panicking.rs:214
   6:     0x56164483d685 - std::panicking::rust_panic_with_hook::h9fb440f8b04cb795
                               at src/libstd/panicking.rs:477
   7:     0x56164483d222 - std::panicking::continue_panic_fmt::h50588d05bf19779b
                               at src/libstd/panicking.rs:384
   8:     0x56164483d116 - rust_begin_unwind
                               at src/libstd/panicking.rs:311
   9:     0x56164485cafa - core::panicking::panic_fmt::hd2f9751e01df4ba2
                               at src/libcore/panicking.rs:85
  10:     0x56164485cab5 - core::panicking::panic_bounds_check::h7a07aff6d2deb493
                               at src/libcore/panicking.rs:61
  11:     0x561644769d06 - <usize as core::slice::SliceIndex<[T]>>::index::h7f97c50d1352a336
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/slice/mod.rs:2715
  12:     0x561644769d06 - core::slice::<impl core::ops::index::Index<I> for [T]>::index::hf0212d61d86e8349
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/slice/mod.rs:2566
  13:     0x561644769d06 - <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index::h74e4ec5f06095a83
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/liballoc/vec.rs:1792
  14:     0x561644769d06 - <&chalk_ir::Substitution as chalk_ir::fold::FreeVarFolder>::fold_free_var_ty::hab9a43660922e241
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/lib.rs:1084
  15:     0x561644771b76 - chalk_ir::fold::super_fold_ty::h5b73c49f0f54d6a3
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:339
  16:     0x5616447255d7 - <T as chalk_ir::fold::TypeFolder>::fold_ty::h141fa0871f073b82
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:90
  17:     0x5616447674a9 - <chalk_ir::Ty as chalk_ir::fold::Fold>::fold_with::hfc25bef56bd6a7e8
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:331
  18:     0x5616447674a9 - <chalk_ir::ParameterKind<T,L> as chalk_ir::fold::Fold>::fold_with::h0b0f7d02ff13c603
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:509
  19:     0x5616447674a9 - <chalk_ir::Parameter as chalk_ir::fold::Fold>::fold_with::h0928c822fd52c957
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:461
  20:     0x561644770635 - <core::slice::Iter<T> as core::iter::traits::iterator::Iterator>::try_fold::h71cc56c3a5c80351
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/slice/mod.rs:0
  21:     0x561644770635 - <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold::h98e23db8556b14ba
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/adapters/mod.rs:686
  22:     0x561644770635 - <core::iter::adapters::ResultShunt<I,E> as core::iter::traits::iterator::Iterator>::try_fold::hd3dcb6ed242ad1ef
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/adapters/mod.rs:2390
  23:     0x561644770635 - core::iter::traits::iterator::Iterator::try_for_each::h2fc727fc56e5fd61
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/traits/iterator.rs:1736
  24:     0x561644770635 - core::iter::traits::iterator::Iterator::find::he7bb1f12e93991b7
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/traits/iterator.rs:1982
  25:     0x561644770635 - <core::iter::adapters::ResultShunt<I,E> as core::iter::traits::iterator::Iterator>::next::h6e5f5e40535c4702
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/adapters/mod.rs:2372
  26:     0x561644770251 - <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter::hadec1c2891325e30
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/liballoc/vec.rs:1919
  27:     0x561644770cf9 - <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter::h804a54cb6ad25d9e
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/liballoc/vec.rs:1832
  28:     0x561644770cf9 - core::iter::traits::iterator::Iterator::collect::hf2842875a62004b0
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/traits/iterator.rs:1478
  29:     0x561644770cf9 - <core::result::Result<V,E> as core::iter::traits::collect::FromIterator<core::result::Result<A,E>>>::from_iter::{{closure}}::h0791ff9e0529b9bf
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/result.rs:1427
  30:     0x561644770cf9 - core::iter::adapters::process_results::h3bad6b16733b10fb
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/adapters/mod.rs:2362
  31:     0x56164476a683 - <core::result::Result<V,E> as core::iter::traits::collect::FromIterator<core::result::Result<A,E>>>::from_iter::he61f25c9418fe47f
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/result.rs:1427
  32:     0x56164476a683 - core::iter::traits::iterator::Iterator::collect::h5e51c315a16c0880
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libcore/iter/traits/iterator.rs:1478
  33:     0x56164476a683 - <alloc::vec::Vec<T> as chalk_ir::fold::Fold>::fold_with::hee484c48f2f3fb81
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:282
  34:     0x56164476a683 - <chalk_ir::TraitRef as chalk_ir::fold::Fold>::fold_with::h22fb792a4573c07a
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:660
  35:     0x56164476a683 - <chalk_ir::WhereClause as chalk_ir::fold::Fold>::fold_with::h42bc6778baf887fb
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:509
  36:     0x56164476a683 - <chalk_ir::DomainGoal as chalk_ir::fold::Fold>::fold_with::hec1539eb29a129ac
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:509
  37:     0x56164476acbc - <chalk_ir::LeafGoal as chalk_ir::fold::Fold>::fold_with::h35bd8f5b77332539
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:509
  38:     0x56164476acbc - <chalk_ir::Goal as chalk_ir::fold::Fold>::fold_with::hd2d66c8081519ce6
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:509
  39:     0x56164472b75f - <chalk_ir::InEnvironment<F> as chalk_ir::fold::Fold>::fold_with::h4677ea908226861c
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-ir/src/fold.rs:660
  40:     0x5616446ef24f - chalk_solve::infer::InferenceTable::from_canonical::h736bc00123f1e61f
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-solve/src/infer.rs:62
  41:     0x561644734fb1 - <chalk_solve::solve::slg::SlgContextOps as chalk_engine::context::ContextOps<chalk_solve::solve::slg::SlgContext>>::instantiate_ucanonical_goal::hb98293e7e75ce378
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-solve/src/solve/slg.rs:149
  42:     0x561644700f2c - chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::push_initial_strands::h54165f85d7733582
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-engine/src/logic.rs:793
  43:     0x561644700f2c - chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::get_or_create_table_for_ucanonical_goal::ha80eff747c3aabeb
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-engine/src/logic.rs:775
  44:     0x561644701263 - chalk_engine::forest::Forest<C>::iter_answers::hf2ee30cbb9beadc5
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-engine/src/forest.rs:81
  45:     0x561644701263 - chalk_engine::forest::Forest<C>::solve::h82ad847256ce5915
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-engine/src/forest.rs:99
  46:     0x5616446f15c7 - chalk_solve::solve::Solver::solve::h44bdde73d1a96b3c
                               at /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/6a532fc/chalk-solve/src/solve.rs:128
  47:     0x561643f255cc - ra_hir::ty::traits::TraitSolver::solve::hcf70915f8a887cac
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/traits.rs:41
  48:     0x561643f255cc - ra_hir::ty::traits::trait_solve_query::h5f92b5fa4ebb2ac1
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/traits.rs:180
  49:     0x561643f2c38a - <ra_hir::db::TraitSolveQuery as salsa::plumbing::QueryFunction<DB>>::execute::hc6468a37f4c23ee0
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/db.rs:149
  50:     0x561643f2c38a - salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade::{{closure}}::hbb4fd511965af676
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived/slot.rs:203
  51:     0x561643f2c38a - salsa::runtime::Runtime<DB>::execute_query_implementation::h5057078496bb88e8
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/runtime.rs:351
  52:     0x5616440f97da - salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade::hfd7b9b29a8def93e
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived/slot.rs:200
  53:     0x561644109d3a - salsa::derived::slot::Slot<DB,Q,MP>::read::h72680be2ddb3a177
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived/slot.rs:140
  54:     0x561644019647 - <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch::h30aac445f8093f6b
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived.rs:140
  55:     0x561644091a91 - salsa::QueryTable<DB,Q>::get::ha8d37fcaa82a54db
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/lib.rs:471
  56:     0x56164408853f - <T as ra_hir::db::HirDatabase>::trait_solve::ha9a7594ae98308ff
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/db.rs:149
  57:     0x56164408853f - ra_hir::ty::infer::InferenceContext<D>::resolve_obligations_as_possible::h7472e984321685d6
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:347
  58:     0x56164408853f - ra_hir::ty::infer::InferenceContext<D>::resolve_ty_as_possible::h35e81a137683bb55
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:373
  59:     0x56164408761b - ra_hir::ty::infer::InferenceContext<D>::normalize_associated_types_in::he9ced1e9993bb6f2
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:433
  60:     0x56164408761b - ra_hir::ty::infer::InferenceContext<D>::infer_method_call::h20d7365696e9e557
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:975
  61:     0x561644082a80 - ra_hir::ty::infer::InferenceContext<D>::infer_expr_inner::h2d1632d5a13383ce
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:1097
  62:     0x56164407f56a - ra_hir::ty::infer::InferenceContext<D>::infer_expr::h1d001c5ec853d690
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:991
  63:     0x561644082214 - ra_hir::ty::infer::InferenceContext<D>::infer_expr_inner::h2d1632d5a13383ce
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:1263
  64:     0x56164407f56a - ra_hir::ty::infer::InferenceContext<D>::infer_expr::h1d001c5ec853d690
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:991
  65:     0x5616440819a2 - ra_hir::ty::infer::InferenceContext<D>::infer_expr_inner::h2d1632d5a13383ce
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:1009
  66:     0x56164407f56a - ra_hir::ty::infer::InferenceContext<D>::infer_expr::h1d001c5ec853d690
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:991
  67:     0x561644081cec - ra_hir::ty::infer::InferenceContext<D>::infer_block::h458afeb239838b82
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:1418
  68:     0x561644081cec - ra_hir::ty::infer::InferenceContext<D>::infer_expr_inner::h2d1632d5a13383ce
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:1022
  69:     0x56164407f56a - ra_hir::ty::infer::InferenceContext<D>::infer_expr::h1d001c5ec853d690
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:991
  70:     0x56164407eb73 - ra_hir::ty::infer::InferenceContext<D>::infer_body::h8b6ae877dd6dfcab
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:1442
  71:     0x56164407eb73 - ra_hir::ty::infer::infer_query::h5ba444c0b5421fc8
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/ty/infer.rs:73
  72:     0x561643f2df15 - <ra_hir::db::InferQuery as salsa::plumbing::QueryFunction<DB>>::execute::h57e68328905c86e1
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/db.rs:149
  73:     0x561643f2df15 - salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade::{{closure}}::hac65c145bbf80b5d
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived/slot.rs:203
  74:     0x561643f2df15 - salsa::runtime::Runtime<DB>::execute_query_implementation::h70f3b5e68991642a
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/runtime.rs:351
  75:     0x5616440d6419 - salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade::h65a4a1ffba77e1e4
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived/slot.rs:200
  76:     0x5616441053a7 - salsa::derived::slot::Slot<DB,Q,MP>::read::h240e8555d4a41fcb
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived/slot.rs:140
  77:     0x5616440253c4 - <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch::hc967c6867f9a069b
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/derived.rs:140
  78:     0x561644092501 - salsa::QueryTable<DB,Q>::get::he815d474235863f8
                               at /home/matthias/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.13.0/src/lib.rs:471
  79:     0x561643f36063 - <T as ra_hir::db::HirDatabase>::infer::h9c19489674f75369
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/db.rs:149
  80:     0x561643f36063 - ra_hir::code_model::Function::infer::h4565b50848f7e906
                               at /home/matthias/vcs/github/rust-analyzer/crates/ra_hir/src/code_model.rs:663
  81:     0x561643f36063 - ra_cli::analysis_stats::run::h518809e351baefc7
                               at crates/ra_cli/src/analysis_stats.rs:87
  82:     0x561644159f43 - ra_cli::main::h849f7fc1807464aa
                               at crates/ra_cli/src/main.rs:78
  83:     0x561643f3e743 - std::rt::lang_start::{{closure}}::h52a534bb4d1482c4
                               at /rustc/c6e9c76c59e3c10acd63ca9ec157a8894ea1a068/src/libstd/rt.rs:64
  84:     0x56164483d0b3 - std::rt::lang_start_internal::{{closure}}::h886ba8710662e0ce
                               at src/libstd/rt.rs:49
  85:     0x56164483d0b3 - std::panicking::try::do_call::hf9383917f63fc317
                               at src/libstd/panicking.rs:296
  86:     0x56164484503a - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:80
  87:     0x56164483dc3d - std::panicking::try::h3bb4caf318c2ef30
                               at src/libstd/panicking.rs:275
  88:     0x56164483dc3d - std::panic::catch_unwind::h6458650ce45ec87a
                               at src/libstd/panic.rs:394
  89:     0x56164483dc3d - std::rt::lang_start_internal::h2228998aafc0f6b1
                               at src/libstd/rt.rs:48
  90:     0x56164415aa48 - main
  91:     0x7f5f73647ee3 - __libc_start_main

RA @ 5fbdf57

@matthiaskrgr
Copy link
Member Author

I found a crash when checking sccache which might be the same as this one:

Database loaded, 328 roots, 473.573826ms
Crates in this dir: 7
Total modules found: 85
Total declarations: 1712
Total functions: 1143
Item Collection: 32.621870403s, 0b allocated 0b resident
375/1143 32% processing: server::compiler_infothread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /home/matthias/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/039fc90/chalk-ir/src/fold/subst.rs:56:19
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1439
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   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:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:511
  11: rust_begin_unwind
             at src/libstd/panicking.rs:419
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  13: core::panicking::panic_bounds_check
             at src/libcore/panicking.rs:69
  14: <chalk_ir::fold::subst::Subst<I> as chalk_ir::fold::Folder<I>>::fold_free_var_ty
  15: <chalk_ir::Ty<I> as chalk_ir::fold::SuperFold<I,TI>>::super_fold_with
  16: chalk_ir::fold::boring_impls::<impl chalk_ir::fold::Fold<I,TI> for chalk_ir::Parameter<I>>::fold_with
  17: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
  18: core::iter::adapters::process_results
  19: <chalk_ir::WhereClause<I> as chalk_ir::fold::Fold<I,_TI>>::fold_with
  20: chalk_ir::fold::binder_impls::<impl chalk_ir::fold::Fold<I,TI> for chalk_ir::Binders<T>>::fold_with
  21: chalk_solve::clauses::program_clauses_for_goal
  22: <chalk_solve::solve::slg::SlgContextOps<I> as chalk_engine::context::ContextOps<chalk_solve::solve::slg::SlgContext<I>>>::program_clauses
  23: chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::get_or_create_table_for_ucanonical_goal
  24: chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::get_or_create_table_for_subgoal
  25: chalk_engine::logic::SolveState<C,CO>::ensure_root_answer
  26: chalk_engine::logic::<impl chalk_engine::forest::Forest<C>>::root_answer
  27: <chalk_engine::forest::ForestSolver<C,CO> as chalk_engine::context::AnswerStream<C>>::next_answer
  28: chalk_solve::solve::slg::aggregate::<impl chalk_engine::context::AggregateOps<chalk_solve::solve::slg::SlgContext<I>> for chalk_solve::solve::slg::SlgContextOps<I>>::make_solution
  29: chalk_engine::forest::Forest<C>::solve
  30: ra_hir_ty::traits::trait_solve_query
  31: salsa::runtime::Runtime<DB>::execute_query_implementation
  32: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  33: salsa::derived::slot::Slot<DB,Q,MP>::read
  34: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  35: salsa::QueryTable<DB,Q>::get
  36: <T as ra_hir_ty::db::HirDatabase>::trait_solve
  37: ra_hir_ty::infer::coerce::<impl ra_hir_ty::infer::InferenceContext>::coerce
  38: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  39: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  40: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  41: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  42: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr
  43: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  44: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  45: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  46: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr
  47: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  48: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  49: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  50: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  51: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  52: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::check_call_arguments
  53: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_method_call
  54: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  55: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  56: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::check_call_arguments
  57: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  58: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  59: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  60: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  61: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  62: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  63: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  64: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  65: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  66: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  67: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  68: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::check_call_arguments
  69: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_method_call
  70: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  71: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  72: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  73: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  74: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  75: ra_hir_ty::infer::infer_query
  76: salsa::runtime::Runtime<DB>::execute_query_implementation
  77: salsa::derived::slot::Slot<DB,Q,MP>::read_upgrade
  78: salsa::derived::slot::Slot<DB,Q,MP>::read
  79: <salsa::derived::DerivedStorage<DB,Q,MP> as salsa::plumbing::QueryStorageOps<DB,Q>>::try_fetch
  80: ra_hir_ty::db::infer_wait
  81: rust_analyzer::cli::analysis_stats::analysis_stats
  82: rust_analyzer::main
  83: std::rt::lang_start::{{closure}}
  84: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  85: std::panicking::try::do_call
             at src/libstd/panicking.rs:331
  86: std::panicking::try
             at src/libstd/panicking.rs:274
  87: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  88: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  89: main
  90: __libc_start_main
  91: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@lnicola
Copy link
Member

lnicola commented Apr 8, 2020

This still happens on servo after #3868:

986/20887 4% processing: values::computed::font::iterthread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', crates/ra_hir_ty/src/infer/unify.rs:123:41
stack backtrace:
  [snip]
  14: <ra_hir_ty::Ty as ra_hir_ty::TypeWalk>::walk_mut_binders
  15: <ra_hir_ty::Ty as ra_hir_ty::TypeWalk>::walk_mut_binders
  16: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  17: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  18: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  19: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  20: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  21: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_block
  22: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_inner
  23: ra_hir_ty::infer::expr::<impl ra_hir_ty::infer::InferenceContext>::infer_expr_coerce
  24: ra_hir_ty::infer::infer_query
  [snip]

@bjorn3
Copy link
Member

bjorn3 commented Sep 12, 2020

There is now a new panic message:

Database loaded 82.11s, 646mi
Crates in this dir: 99
Total modules found: 1030
Total declarations: 23539
Total functions: 17937
Item Collection: 46.30s, 219109mi
857/17937 4% processing: hash_map::test_map::test_retainthread 'main' panicked at 'var_universe invoked on bound variable', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/macros.rs:13:23
stack backtrace:
[...]
  11: std::panicking::begin_panic
  12: chalk_solve::infer::unify::Unifier<I>::unify_ty_ty
  13: <chalk_ir::Substitution<I> as chalk_ir::zip::Zip<I>>::zip_with
  14: chalk_solve::infer::unify::Unifier<I>::unify_ty_ty
  15: chalk_ir::_DERIVE_chalk_ir_zip_Zip_I_FOR_DomainGoal::<impl chalk_ir::zip::Zip<I> for chalk_ir::DomainGoal<I>>::zip_with
  16: chalk_solve::infer::unify::Unifier<I>::unify
  17: chalk_solve::infer::unify::<impl chalk_solve::infer::InferenceTable<I>>::unify
  18: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::new_with_clause
  19: chalk_recursive::recursive::Solver<I>::solve_new_subgoal
  20: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  21: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::prove
  22: chalk_recursive::fulfill::Fulfill<I,Solver,Infer>::solve
  23: chalk_recursive::recursive::Solver<I>::solve_new_subgoal
[frames 20-23 repeated a few times]
  36: <chalk_recursive::recursive::Solver<I> as chalk_recursive::solve::SolveDatabase<I>>::solve_goal
  37: <chalk_recursive::recursive::RecursiveSolver<I> as chalk_solve::solve::Solver<I>>::solve_limited
  38: hir_ty::traits::trait_solve_query
  39: salsa::runtime::Runtime::execute_query_implementation
  40: salsa::derived::slot::Slot<Q,MP>::read_upgrade
  41: salsa::derived::slot::Slot<Q,MP>::read
  42: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
  43: <DB as hir_ty::db::HirDatabase>::trait_solve::__shim
  44: <DB as hir_ty::db::HirDatabase>::trait_solve
  45: hir_ty::infer::InferenceContext::resolve_ty_as_possible
  46: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  47: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
  48: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
  49: hir_ty::infer::infer_query
[...]

@lnicola
Copy link
Member

lnicola commented Jan 25, 2021

The good news is that we're not crashing any more. The bad news is that analysis-stats still diverges -- it never finishes.

Tested at 7ac8b749e3d9b1d178258ef71ed108f26bca4f8a.

$ rust-analyzer analysis-stats . -vv -o traversal::resolve_style

@lnicola lnicola changed the title index out of bounds while checking servo Analysis never finishes on servo Jan 25, 2021
@lnicola lnicola added A-perf performance issues A-ty type system / type inference / traits / method resolution S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Jan 25, 2021
@jonas-schievink
Copy link
Contributor

rust-analyzer analysis-stats . --with-deps --parallel now finishes on servo. If this issue reappears, please file a new issue that includes the specific commit needed to reproduce the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-perf performance issues A-ty type system / type inference / traits / method resolution S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

4 participants