rust-analyzer: New weekly build crashs reproducily
I’ve doing some work on diesel. Pointing with the cursor to this line reproducibly crashes rust-analyzer with the attached backtrace.
Version: rust-analyzer 90f8378 OS: Ubuntu 20.04 IDE: Emacs
Backtrace:
thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 7', /home/runner/.cargo/git/checkouts/chalk-7b02fa8caa2cec94/28cef6f/chalk-ir/src/fold/subst.rs:56:19
stack backtrace:
0: <unknown>
1: <unknown>
2: <unknown>
3: <unknown>
4: <unknown>
5: <unknown>
6: <unknown>
7: <unknown>
8: <unknown>
9: <unknown>
10: <unknown>
11: <unknown>
12: <unknown>
13: <unknown>
14: <unknown>
15: <unknown>
16: <unknown>
17: <unknown>
18: <unknown>
19: <unknown>
20: <unknown>
21: <unknown>
22: <unknown>
23: <unknown>
24: <unknown>
25: <unknown>
26: <unknown>
27: <unknown>
28: <unknown>
29: <unknown>
30: <unknown>
31: <unknown>
32: <unknown>
33: <unknown>
34: <unknown>
35: <unknown>
36: <unknown>
37: <unknown>
38: <unknown>
39: <unknown>
40: <unknown>
41: <unknown>
42: <unknown>
43: <unknown>
44: <unknown>
45: <unknown>
46: <unknown>
47: <unknown>
48: <unknown>
49: <unknown>
50: <unknown>
51: <unknown>
52: <unknown>
53: <unknown>
54: <unknown>
55: <unknown>
56: <unknown>
57: <unknown>
58: <unknown>
59: <unknown>
60: <unknown>
61: <unknown>
62: <unknown>
63: <unknown>
64: <unknown>
65: <unknown>
66: <unknown>
67: <unknown>
68: <unknown>
69: <unknown>
70: <unknown>
71: <unknown>
72: <unknown>
73: <unknown>
74: <unknown>
75: <unknown>
76: <unknown>
77: <unknown>
78: <unknown>
79: <unknown>
80: <unknown>
81: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 23 (22 by maintainers)
Commits related to this issue
- Fix wrong substitution code We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though)... — committed to flodiebold/rust-analyzer by flodiebold 4 years ago
- Fix wrong substitution code We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though)... — committed to flodiebold/rust-analyzer by flodiebold 4 years ago
- Merge #4106 4106: Fix wrong substitution code r=matklad a=flodiebold We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow tha... — committed to rust-lang/rust-analyzer by bors[bot] 4 years ago
Small guide to minimizing the reproducer for such a crash, in case someone is interested:
rust-analyzer analysis-stats -o internal_into_boxed .causes the crash; otherwise I’d see where the progress bar says we are and hope that’s the right functioninternal_into_boxedso they don’t interfere, and checked that it still crashesdyntype, I commented out the where clause involving thedyn, and indeed then the crash is goneself.order.into();call (keep in mind that we don’t need the result to type-check, just to crash in the same way…)Options andBoxesIn the end I ended up with:
and copied that to a test, where it indeed still crashed. With that, finding and fixing the bug was just a matter of some print debugging 😉
That’s where @edwin0cheng’s page gets its test cases from, IIRC 😄
Actually,
dieselwould be a good example. I’ll add it to CI, once we stop crashing on it.Hm, actually, why re-invent the wheel? We should just re-use https://github.com/rust-lang/rustc-perf/tree/master/collector/benchmarks
Yeah, either
cargo build --releasefrom source (you really need the release build), or download a nightly build from our releases.Ah, so that wasn’t a Deja vu 😃
That’s in
dist.rsYes 😃