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

Segmentation fault when writing "// 1." in c like languages #1021

Closed
2 tasks done
nikolightsaber opened this issue Jun 2, 2022 · 3 comments
Closed
2 tasks done

Segmentation fault when writing "// 1." in c like languages #1021

nikolightsaber opened this issue Jun 2, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@nikolightsaber
Copy link

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config

if has('vim_starting')
  set encoding=utf-8
endif
scriptencoding utf-8

if &compatible
  set nocompatible
endif

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug "hrsh7th/cmp-path"
call plug#end()
PlugInstall | quit

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },

  mapping = {
    ['<CR>'] = cmp.mapping.confirm({ select = true })
  },

  sources = {
    { name = "buffer" },
    { name = "path" },
  },
}
EOF

Description

When I go into a c like file and start writing the comment //1. i get a segmentation fault

I'm pretty sure it is the dot that is doing it.

I feel it is an issue with cmp-path in combination with another cmp source like buffer.

Screenshot from 2022-06-02 20-59-50

I use the lastest neovim from master 0.8-dev (commit: e6652821bd32e4ff8d62a0b67fc2041a5f41e252)

Do I need to make an issue in the main neovim repo. This seems serious.

Steps to reproduce

Go into any c like file and start wring // 1. and the issue should happen.

With the config above of course.

Expected behavior

No segmentation fault.

Actual behavior

Segmentation fault

Additional context

No response

@nikolightsaber nikolightsaber added the bug Something isn't working label Jun 2, 2022
@smjonas
Copy link
Contributor

smjonas commented Jun 2, 2022

Thank you, it's reassuring to confirm that I'm not the only one who has encountered this issue recently. I was about to open a similar issue a few minutes ago but wasn't sure if I reproduced it correctly. I am also on Neovim nightly. For me the segmentation fault happens when typing '*./%.rc in a buffer (sometimes it does not crash immediately). When nvim-cmp is uninstalled the issue does not occur.

See this GIF:

cmp_bug.mp4

Could this be the underlying issue: luvit/luv#603? If yes, it seems to be already fixed by neovim/neovim#18834.

@nikolightsaber
Copy link
Author

Hi thanks for the comment !

I've updated my neovim this morning and indeed the problem seems fixed for me.
neovim/neovim#18834. seems to have don the job

I'll close the issue since it is fixed for me

if it is not fixed for you feel free to re-open

@smjonas
Copy link
Contributor

smjonas commented Jun 3, 2022

Fixed for me as well after upgrading to latest master 👍

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

No branches or pull requests

2 participants