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

Hang when opening rust file #129

Closed
thequver opened this issue Feb 21, 2024 · 10 comments
Closed

Hang when opening rust file #129

thequver opened this issue Feb 21, 2024 · 10 comments
Assignees
Labels
bug Something isn't working ready for release windows Windows Operating System

Comments

@thequver
Copy link

Hey, I downloaded the latest 0.5.1 release and encountered a program hang when opening a rust .rs file. Basically any .rs file makes the program hang but I made an example just in case:
test.txt
please rename this into test.rs (github doesnt allow uploading .rs)

@SpartanJ SpartanJ self-assigned this Feb 21, 2024
@SpartanJ SpartanJ added the bug Something isn't working label Feb 21, 2024
@SpartanJ
Copy link
Owner

Ups. Please can you provide me your OS? I cannot reproduce any issue with that file renamed as test.rs. Do you have rust-analyzer available? It's running in a directory with a Cargo file?

@thequver
Copy link
Author

Windows 11, I have rust-analyzer but it doesn't run when I'm opeing the file

@SpartanJ
Copy link
Owner

App crashes or just freezes? Can you record some logs for me?
You can open the app with the debug info enabled:
ecode.exe -ldebug -v, open the file, wait for the hang.
Then you can send me the logs located at: C:\Users\{username}\AppData\ecode\ecode.log (replace username with your username).

Thanks

@thequver
Copy link
Author

ecode.log
The app freezes, no crash. I see

error: 'rust-analyzer.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'

in the log but I do have rust-analyzer, ecode even sees it in the languages health tool
2024-02-21

@SpartanJ
Copy link
Owner

Sorry I forgot to ask, this is working well in the previous version 0.5.0?
I think that rust-analyzer is hanging the editor for some reason, since it's being initialized but with errors, and the last logged line is the rust-analyzer error:
error: 'rust-analyzer.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'.
Can you try to disable the LSP plugin for a moment so we can confirm it?

@thequver
Copy link
Author

Previous version hangs too, I disabled LSP plugin and now it works!

@SpartanJ
Copy link
Owner

Cool. You'll probably be able to fix it by fixing the rust-analyzer installation. I have no idea how the error hangs ecode, I'll try to reproduce your broken installation and hope for the worst. My rust-analyzer is also broken on Linux but doesn't hang, so this could be a Windows only issue.

@thequver
Copy link
Author

Found more info, it seems I didn't actually have the rust-analyzer installed and what ecode detects "C:\Users\ACER\.cargo\bin\rust-analyzer.exe" is something else but not full rust-analyzer. The same issue here:
https://stackoverflow.com/questions/77453247/error-rust-analyzer-is-not-installed-for-the-toolchain-stable-x86-64-unknown

I had to run the command:
rustup component add rust-analyzer, after it I don't have the hang anymore with the LSP plugin enabled.
Maybe you can reproduce the hang if you do rustup component remove rust-analyzer if you actually have it installed.

@SpartanJ
Copy link
Owner

Excellent, thank you very much! This is a great hint to solve the issue. I'm also glad it's not hanging anymore.

@SpartanJ
Copy link
Owner

I'm 90% sure I found the issue and I was able to reproduce it in a similar scenario. Also already pushed a fix but I'll continue testing. Basically some Window API interaction with WriteFile + FlushFileBuffers gets locked forever, I don't know much about the Windows API and I barely tested ecode on Windows since I don't use it, so I've no doubt there much more polishing needed for the Windows version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for release windows Windows Operating System
Projects
None yet
Development

No branches or pull requests

2 participants