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

NvimServer segfaults when used with --headless --cmd #1001

Open
ibhagwan opened this issue Feb 16, 2023 · 4 comments
Open

NvimServer segfaults when used with --headless --cmd #1001

ibhagwan opened this issue Feb 16, 2023 · 4 comments

Comments

@ibhagwan
Copy link

ibhagwan commented Feb 16, 2023

Hi,

I maintain the fzf-lua neovim plugin, the plugin relies heavily on processing commands with a headless neovim instance, this seems to segfault the neovim build that comes with VimR, for example:

fzf-lua takes the path from v:progpath

'</path/to/>/VimR.app/Contents/Resources/NvimView_NvimView.bundle/Contents/Resources/NvimServer' -n --headless --cmd 'lua print("test")'
zsh: segmentation fault   -n --headless --cmd 'lua print("test")

Vs a normal build:

❯ nvim -n --headless --cmd 'lua print("test\n"); os.exit(0)'
test

This was discovered as part of ibhagwan/fzf-lua#651

Edit: This seems to be related to #984 and #993, neogit also uses --headless and has the same issue NeogitOrg/neogit#438

@SolaWing
Copy link
Contributor

VIMR encapsulates the NVIM command-line interface and directly couples the GUI's startup parameters.

I tried modifying the vimr to expose the original interface and capabilities of the NVIM, which worked under my simple tests, but I wasn't too sure that there would be other unanticipated effects. The corresponding commit is in my own branch: https://github.com/SolaWing/vimr/tree/nvim-binary and https://github.com/SolaWing/neovim/tree/nvim-binary. if it's ok I can push a pr.

By the way, NVIM 0.9 mentioned that ui_bridge will be removed, see #996, maybe migrating to RPC and using the original unchanged core NVIM is a better approach.

What do you think @qvacua

@georgeharker
Copy link
Collaborator

georgeharker commented Feb 28, 2023

Same here with neogit, it would be awesome to understand what's going on here - looking at the above PR by @SolaWing this looks pretty reasonable. I'd +1 to migrating to RPC though

@georgeharker
Copy link
Collaborator

Can confirm the above changes work (after some code signing headaches, but that's nothing to do with the changes)

@georgeharker
Copy link
Collaborator

@SolaWing could you file a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants