-
Notifications
You must be signed in to change notification settings - Fork 1.7k
rust-analyzer crashes when loading tokio projects #14192
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
Comments
This seems pretty awful... Double free with Arc? I don't think this is a bug of rust-analyzer per se, but we can try identifying the problem. Can you share a reproducing repository with us? |
@lowr Here's one. If I open any file that isn't lib.rs it crashes so I don't think it has anything to do with file size actually. |
I'm thinking of trying on a different computer to see what happens. Also, I've found this to be the smallest example where rust-analyzer would crash. It will load fine, then when I enter use tokio::net::TcpListener;
#[tokio::main]
async fn main() {
let s = TcpListener::bind("0.0.0.0:8080");
} I've opened some projects that don't use tokio and they work fine, so I wonder if that has anything to do with it. |
Sounds like it might be related to proc macros? |
I tried without
I'm still getting the same logs as before in helix though. |
I tried on a different Mac and it worked fine 😔. Could be something up with my Mac but I have no idea what it could be |
Thanks for checking. Maybe you can try on a different account -- you'll have to install again rustup and the Rust toolchain. |
I will try that soon and let you know. I think I've narrowed down the cause a bit further: a project that uses tokio will load fine if I open it on a file that doesn't import anything from tokio, but as soon as I switch to a file that does it crashes. |
I'm having the same issue on an intel Mac. Here is the crash report, maybe it can help somehow
|
For completeness mine is also Intel. I got it to work on an M1 with the same OS version (macOS 12.6.3) |
FWIW, |
Seems similar to rust-lang/rust#92173. Rustc itself sometimes crashes unless Jemalloc is used. Maybe a bug in the macOS memory allocator? |
To add other details, I downgraded to version 2023-02-27 and it works without problems, I experience the crash only with version 2023-03-06. |
But @xt4l reported this on Feb 22... |
I know 😢 , that's the reason why I added the details on the version |
@visd0m if you can reproduce this reliably, especially with |
I tried downgrading and still have the same problem on that version. |
I started walking back one week at a time with no luck. I jumped back to 2022-06-06 and that worked. |
@marcbowes Can you try building from source and using jemalloc? |
Or try one from October. |
I get this same issue with the chumsky package. |
Does anyone have a work around for now? |
You can try building with jemalloc
|
Updating my system seems to have fixed it though I can't be sure if that was it |
I was facing the same issue on rust-analyzer installed using homebrew. After doing the following steps the issue got fixed.
|
Closing this as it is most likely a rustc bug |
rust-analyzer version: rust-analyzer 0.0.0 (a6603fc 2023-02-16)
rustc version: rustc 1.67.1 (d5a82bbd2 2023-02-07)
relevant settings: Not sure if any environment variables are being set. Using helix editor.
I've noticed that rust-analyzer crashes when loading tokio projects. The lightest projects I've noticed this in only have either tokio + redis or tokio + chrono as dependencies. Here's what I get from
rust-analyzer analysis-stats .
:Here's the full crash report:
Crash Report
The text was updated successfully, but these errors were encountered: