nvim-rs: Nvim crash on 10th request

I stumbled upon this issue https://github.com/neovim/neovim/issues/23781 while using this library.

I’m using a nvim_rs::create::new_parent (like thing), which uses tokio::io::Stdout underneath the hood.

This seems to have line buffering on it since whenever I hit the 10th message neovim crashes.

The 10th message id emits 0x0A (10 in positive fix int in the msgpack encoding) which flushes a partial message.

I’ve switched to unsafe { File::from_raw_fd(1) } and it seems to continue beyond the 10th request.

This might not be a viable solution because of unsafe code, but the flushing (to often / out of control) seems to be an issue over local unix io streams.

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

Thanks for all your hard work on this @KillTheMule , really is appreciated 👏

Sorry for posting and running, life got busy.

Looks you two are more familiar with nvim. I was just spelunking through the code base and running gdb, but it’s hard to track of what’s going on for me.

I’m fine with this being closed out with out me being involved.

Also using unsafe is fine for me since it’s just in an application where I’m using unsafe any way. But I’m sure it should be used in this crate.

A lot of your conclusions looked similar to mine. The linked PRs did nothing to fix this and after a day or two of trying to figure out a fix I gave up, seemed hard. Seems like something is amiss in the RPC itself that you wouldn’t trigger in Lua (as per most nvim plugins).