Closed ConradIrwin closed 5 months ago
Narrowing down the code a little bit, it seems to be caused by this: https://github.com/zed-industries/zed/blob/3bc1a41fd46028700b2900661800b293a88d202b^/crates/collab/src/db/queries/channels.rs#L577-L600.
Git bisect blames https://github.com/rust-lang/rust-analyzer/commit/0927f86247ec454e7b48e22595783bb58f6a2cd1, though from scanning the diff it's not very obvious why that change would cause this.
cc @Veykril
Potentially https://github.com/rust-lang/rust-analyzer/issues/17017, which is just surfaced by my PR
I'm getting panics from chalk as well since a couple of days ago, but a different error. They happen very frequently, almost every time I request code completion while working on https://github.com/holochain/holochain.
thread 'Worker' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chalk-ir-0.97.0/src/lib.rs:1455:33:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::option::unwrap_failed
4: <chalk_ir::SubstFolder<I,A> as chalk_ir::fold::TypeFolder<I>>::fold_free_var_lifetime
5: chalk_ir::fold::TypeSuperFoldable::super_fold_with
6: chalk_ir::_::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::DynTy<I>>::try_fold_with
7: chalk_ir::fold::TypeSuperFoldable::super_fold_with
8: chalk_ir::fold::boring_impls::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::GenericArg<I>>::try_fold_with
9: <core::iter::adapters::GenericShunt<I,R> as core::iter::traits::iterator::Iterator>::next
10: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
11: chalk_ir::fold::boring_impls::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::Substitution<I>>::try_fold_with
12: chalk_ir::fold::TypeSuperFoldable::super_fold_with
13: chalk_ir::fold::boring_impls::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::GenericArg<I>>::try_fold_with
14: <core::iter::adapters::GenericShunt<I,R> as core::iter::traits::iterator::Iterator>::next
15: <smallvec::SmallVec<A> as core::iter::traits::collect::Extend<<A as smallvec::Array>::Item>>::extend
16: chalk_ir::fold::boring_impls::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::Substitution<I>>::try_fold_with
17: chalk_ir::fold::TypeSuperFoldable::super_fold_with
18: chalk_ir::_::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::WhereClause<I>>::try_fold_with
19: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
20: chalk_ir::fold::boring_impls::<impl chalk_ir::fold::TypeFoldable<I> for chalk_ir::QuantifiedWhereClauses<I>>::try_fold_with
21: chalk_solve::infer::instantiate::<impl chalk_solve::infer::InferenceTable<I>>::instantiate_binders_existentially
22: <chalk_solve::infer::unify::Unifier<I> as chalk_ir::zip::Zipper<I>>::zip_binders
23: chalk_solve::infer::unify::Unifier<I>::relate_ty_ty
24: <chalk_solve::infer::unify::Unifier<I> as chalk_ir::zip::Zipper<I>>::zip_tys
25: chalk_ir::zip::Zipper::zip_substs
26: chalk_solve::infer::unify::Unifier<I>::relate_ty_ty
27: <chalk_solve::infer::unify::Unifier<I> as chalk_ir::zip::Zipper<I>>::zip_tys
28: chalk_solve::infer::unify::Unifier<I>::relate_ty_ty
29: chalk_solve::infer::unify::Unifier<I>::relate_var_ty
30: chalk_solve::infer::unify::Unifier<I>::relate_ty_ty
31: <chalk_solve::infer::unify::Unifier<I> as chalk_ir::zip::Zipper<I>>::zip_tys
32: chalk_ir::zip::Zipper::zip_substs
33: chalk_ir::_::<impl chalk_ir::zip::Zip<I> for chalk_ir::WhereClause<I>>::zip_with
34: chalk_solve::infer::unify::Unifier<I>::relate
35: chalk_solve::infer::unify::<impl chalk_solve::infer::InferenceTable<I>>::relate
36: chalk_recursive::solve::SolveIteration::solve_iteration
37: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_goal
38: chalk_recursive::fixed_point::RecursiveContext<K,V>::solve_root_goal
39: hir_ty::traits::solve::{{closure}}
40: hir_ty::traits::trait_solve_query
41: std::panicking::try
42: salsa::derived::slot::Slot<Q,MP>::execute
43: salsa::derived::slot::Slot<Q,MP>::read
44: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
45: <DB as hir_ty::db::HirDatabase>::trait_solve
46: hir_ty::infer::unify::InferenceTable::callable_sig
47: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
48: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::check_call_arguments
49: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
50: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
51: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
52: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
53: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
54: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_coerce
55: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_block
56: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_expr_inner
57: hir_ty::infer::expr::<impl hir_ty::infer::InferenceContext>::infer_return
58: hir_ty::infer::infer_query
59: salsa::Cycle::catch
60: salsa::derived::slot::Slot<Q,MP>::execute
61: salsa::derived::slot::Slot<Q,MP>::read
62: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::fetch
63: <DB as hir_ty::db::HirDatabase>::infer
64: hir::DefWithBody::diagnostics
65: hir::Module::diagnostics
66: hir::Module::diagnostics
67: hir::Module::diagnostics
68: ide_diagnostics::diagnostics
69: salsa::Cancelled::catch
70: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
71: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
72: rust_analyzer::diagnostics::fetch_native_diagnostics
73: core::ops::function::FnOnce::call_once{{vtable.shim}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic context:
> fetch_native_diagnostics
Any updates on this? I've had to revert to an older version for https://github.com/xmtp/libxmtp
@neekolas #17017 was just fixed. I've triggered a nightly, it should be ready in 20 minutes or so. You can then download it or enable pre-release versions in Code in order to test it.
@lnicola Thank you! Just switched over now. Will let you know if I run into the same issue with the new version.
Hello, A fix was pushed with PR #17190 and it was released as part of today's release (version number: 0.4.1949). Can you please test it and report whether the issue is fixed for you or not? Thanks.
Thanks! It looks like it's working on the code above, thank you!
Mmh, I had downgraded to 0.3.1860 and the latest I can update to is 0.3.1950
Is this still only on nightly? Second question, why are there no version numbers on the release page?
It's not only on nightly, the fix is released with the weekly release. If you can try to upgrade to last version and use Show RA version
on command view of VSCode and see if that point to the commit: c4618fe
No, it doesn't show that commit
Ah, after updating it shows that commit, even though it mentions version 0.3.1950
This is a serious regression in nightly and it's important to fix it before the next release.
Since Friday last week, I (and one other colleague) have been getting panics from rust-analyzer when working on https://github.com/zed/zed.
The full log is here: https://gist.github.com/ConradIrwin/823575d9f9279844c9b61b8eb7571829, but the salient piece seem to be:
Although it seems like the panic is in chalk, and chalk was recently updated, the crash from Friday was on the prior version: https://gist.github.com/ConradIrwin/4af43965942a9f5e98d173528b5f2fee .
Running
"/Users/conrad/Library/Application Support/Zed/languages/rust-analyzer/rust-analyzer-2024-04-15" analysis-stats .
reproduces the crash: