-
Notifications
You must be signed in to change notification settings - Fork 496
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
Update nvim-rs, remove superflous arc-wrapping #2336
Conversation
@KillTheMule thank you! i'll just make sure to use it for a bit to certify everything works flawlessly before approving this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is only a clippy warning that would be nice to be fixed before a merge :)
Done. |
@Zhniing, could you test this? @sid-6581, can you revert your exit hang fix and test with this? I strongly believe that one was also caused by the same bug. And if not, so much has changed in |
I'll check! I'm also experiencing a lot of hangs now while I'm in the middle of using neovide (not when closing), so I'll be running in the debugger while working and checking on both issues. |
@KillTheMule, thanks. I guess it didn't occur to us that it was cloneable. |
@fredizzimo, the freezes I've observed happen a lot, and I haven't seen it recover. From my recollection it also happens without locking the computer or anything like that. If I'm not careful to kill the whole process tree, I get a lot of orphan nvim processes left behind. I just hope it's easily reproducible in a debug build, and not just a race condition that mostly happens in the production build. |
I wish I could help you with that, but all three of my Windows (11) machines are completely stable. One of them with Neovide uptimes of weeks, it's probably one week even now, but that's on the D3D branch. |
Oh no worries at all, I like debugging. There's probably just some system differences causing race conditions to trigger on my machines. As long as it's easily reproducible, I can track it down. |
OK, I tried reverting my fix on this PR and got neovide to hang on the first attempt, just like before. The nvim process is gone, and neovide still doesn't detect it as gone. @KillTheMule have you ever seen this problem? (Also, totally unrelated observation, but neovide no longer compiles on the latest nightly. Something has a dependency on ahash 0.7.7, which is where the problem is.) |
I couldn't really follow along, discussions are quite long... can you spell that out for me? Or link to a specific comment that tells me what you're talking about? |
Apologies, I wasn't sure if you had followed the previous discussions. Here is some context: TLDR; sometimes when the nvim process exits (cleanly, by all appearances), the stdin/stdout pipes aren't broken, and |
@sid-6581, here's a fix for the nightly toolchain: |
Great, that was quick! Thanks! |
Ok, I have not seen this before. It's windows only, and you're the only one to reproduce it? I'll try to see if I can reproduce it... and then I need a windows dev environment... might take some time, but I'll look. I do agree though that the loop @fredizzimo points to looks hellishly suspicious. As far as I can tell though that amounts to busy waiting, i.e. it should put some load on a core. Can you confirm this? Should also fill up the log with debug messages... (e) I guess I can't even read my own loop, for now I think it's fine. Gonna look into the hang. |
@KillTheMule, Since @Zhniing encountered the exact same issue here #2299, with the hashes matching the 1.75.0 toolchain version. IMO they should use an event object there. Although the hang is different from the crash, it could be explained by the same thing, but in this case The last line in this image posted by @sid-6581, also seem to indicate that it's blocking exactly there (although cropped off, so it's impossible to see, but |
There have been a lot of reports of hangs on exit, so unfortunately, it's not just me. I can just assume other's hangs are caused by the same issue, but I can't say for sure without anyone firing up a debugger and checking. When it hangs there's no busy waiting, it's stuck in a Win32 wait function. No debug messages in the log, which makes sense, because it's just stuck in OS land. |
Is it stuck in this function if you are on nightly? Or here in 1.75 That code should probably create an event pass that to NtReadFile, and wait for the event, not wait for the file handle directly. There are some special situations where waiting for the handle is allowed, but I'm not sure they hold here, especially since we are dealing with pipes and not filea https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntreadfile
|
I could not reproduce that. I'm starting neovide from powershell, when the window opens I hit 'a' (having |
That's how I get it to hang easily as well. I start it up and immediately hit my shortcut that does Are you running the latest commit, which includes my workaround for the hang? If so, try changing line 171 in |
No I'm running 0.12.2 from the releases page. I also tried via |
0.12.2 has my workaround for the hang, so you won't be able to reproduce it with that version. |
Oh, ok... so I'm gonna setup a rust dev environment on windows. |
You can also try 0.12.1, which was before the workaround. |
Thanks for that hint, something on MS's end seems to be wrong, so I can't install right now... That being said, I also could not reproduce with 0.12.1. Darn... |
@fredizzimo, I built from this commit with Rust 1.76.0, and the Neovide crashed as before unfortunately. The call stack is the same as #2299 (comment) |
Thank you, I will merge this now to get more testing before we make a new release. It seems like it did not fix any of the hangs and crashes that we had, so I was a bit optimistic, but nevertheless removing the linebuffering seems like a good change. Let's continue discussing the hang issues in: And the Windows 10 crash in I still suspect they are the same issue, but let's keep them separate until proven otherwise. |
What kind of change does this PR introduce?
Did this PR introduce a breaking change?
Updated
nvim-rs
to the latest release. I noticed you're wrapping theNeovim
instance inArc
. That's not really necessary, sincenvim-rs
doesArc
-wrapping for all components anyways.There might be performance implications - this removes an indirection, but cloning the
Neovim
instance now needs to bump 3 counters instead of one. My assumption would be that this is a win, but there aren't any benchmarks in place to decide this.Your choice :)