-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
thread '<unnamed>' panicked at 'index out of bounds: the len is 1 but the index is 1', crates/hir_def/src/nameres/path_resolution.rs:385:33 #10084
Comments
According to the trace, this occurred when hovering over the That doesn't trigger the panic for me, so there might be local changes that shift the line/column numbers around |
I suspect I was replacing |
@jonas-schievink can we write a better assertion message here? Or maybe add something else to the panic context? On a meta level, I don't think we will be very successful at reproducing the exact panics the user sees, as that needs in-memory state of the documents, and also the ability to That being said, with our current architecture, I don't think it would be too too hard to add something which dumps all salsa inputs at the moment of the panic into a ~100mb file which gives us a repro. I don't think we should do that due to the privacy concerts though. So, I'd love us to really be able to look at the panic message, and be able to reverse-engineer the failing input, like in #10083. |
I've opened #10095 to add more debugging info here |
10095: internal: Augment panic context when resolving path r=jonas-schievink a=jonas-schievink Should help with debugging #10084 and similar issues. Might have a perf impact since the string is created on every function call. Co-authored-by: Jonas Schievink <[email protected]>
10095: internal: Augment panic context when resolving path r=jonas-schievink a=jonas-schievink Should help with debugging #10084 and similar issues. Might have a perf impact since the string is created on every function call. Co-authored-by: Jonas Schievink <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Just ran into this while hacking on salsa:
And managed to reproduce this once by hovering over I have no idea why hovering over anything in |
I'm currently getting this error a bunch with RA Nightly. Here's a dump of all the output in the VSCode output panel:
|
10159: Add panic info for `impl_trait`/`trait_data` r=jonas-schievink a=jonas-schievink To debug #10084 further bors r+ Co-authored-by: Jonas Schievink <[email protected]>
I've added some more logging in #10159, so please post another panic message when you encounter this again |
|
10185: minor: include `ImplLoc` in panic context r=jonas-schievink a=jonas-schievink cc #10084 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Looking at the last one in more detail:
We're trying to get the trait implemented by this Now for some reason, it is using the This still makes no sense at all to me, so I added some more info to the context in #10185. @jplatte do you by any chance remember what triggered these panics? I'm still not having any luck reproducing this locally. |
I was working on matrix-org/matrix-rust-sdk#309. Maybe you can fudge around with the code introduced by the second-to-last commit there? I think when writing that I got this (but also earlier when working on the same PR). Either way I'm probably going to work on a followup PR to that in the next days so chances seem high that I'll trigger the bug again 😄 |
Got the panic again, dump:
Repo at or right after the crash: https://github.com/ruma/ruma/tree/ra-panic-2021-09-12 |
Panicking whenever hovering the Interestingly enough, the output of the debug prints you added differs on each panic... and if triggered often enough it stops panicking.
I re-hovered the ident until it stopped panicking at which point it worked normally, here is the entire panic log for this https://gist.github.com/Veykril/9c189877bb965b006bdd0eefa5570ec5 Edit: Just ran into this again, this time hovering std's |
Same issue for me as for @Veykril. Can provide more info if needed. |
Same issue for me. Log: https://gist.github.com/f32by/4ed1151cdb5a71e39fc0d46970fb540a Panicking when hovering impl<T> ExpectLogError<T> for Option<T> {
#[inline]
fn expect_log_err<S>(self, msg: S) -> T
where
S: AsRef<str> + fmt::Display,
{
match self {
Some(v) => v,
None => panic_with_log!(msg),
}
}
} |
After adding some asserts for myself and having fortunately triggered some of them it seems like the tuple in the So we are somehow creating an invalid module_id in an |
Yeah, I've looked at the code in It looks to me like something outside of |
Not sure whether more backtraces are useful, but here is another one and I actually had a closer look. The type being referenced (that's supposed to be resolved?),
|
@jplatte that might come from the |
Hi, seems like a very annoying and persistent problem.. Thanks for investigating.
AFAICT there is currently no workaround, right? |
Just happened again to me after a long time of no such error (I think). Not on hover but on
|
Yes, that |
Also crushed. Error
On that part of code:
When you type dot (.) after |
@jonas-schievink I saw that you were dealing with this problem, it seems that the problem still exists ;( |
@grishy I can't reproduce the crash, which rust-analyzer version are you running? If it crashed after you switched git branches, it's the same problem as here, but we don't have a workaround for it. |
It was a git repo, with only main. Switched to pre-release Error
|
Yeah, sorry, I missed the version in the previous log. Can you reproduce it reliably in your game (original repo)? |
Yes, I can. I'll try to upload this to github or some other way so that the problem reproduces. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
fix: Fix body lowering not using block def maps Fixes the issue in the comment here #10084 (comment), not the general issue unfortunately.
Just got this error:
|
Closing as a duplicate of #5366. |
The text was updated successfully, but these errors were encountered: