Segmentation faults with loadview
Prerequisites
- [X] I have read contribution guidelines
- [X] I am using the latest version of the plugin
- [X] I am using either 0.6 stable or the latest compiled neovim version
Neovim Version
NVIM v0.8.0-dev-1120-ga0e6e767a
Neorg setup
Happens even with an empty require("neorg").setup().
Actual behavior
Neovim crashes with segmentation fault (core dumped)
Expected behavior
Neovim doesn't crash.
Steps to reproduce
I narrowed this down to the combination of Neorg and an autocmd that automatically saves and loads views.
- Add these
autocmds to yourinit.lua:
local create_autocmd = vim.api.nvim_create_autocmd
local create_augroup = vim.api.nvim_create_augroup
local saveAndLoadViews = create_augroup("saveAndLoadViews", { clear = true })
create_autocmd({ "BufWinLeave" }, {
pattern = "?*",
command = "mkview!",
group = saveAndLoadViews,
desc = "Save view on leaving buffer",
})
create_autocmd("BufWinEnter", {
pattern = "?*",
command = "silent! loadview",
group = saveAndLoadViews,
desc = "Load view on entering buffer",
})
- create an empty file for which no shada file exists (e.g.
touch asdklqwjelqwej) - Open the file with neovim from the terminal (i.e.
nvim asdklqwjelqwej)
The crash only happens when I open a file which I haven't opened before (and which therefore doesn't have shada files). It only happens if I open the file directly when starting neovim in the terminal. It doesn't happen if I e.g. open it with Telescope from a running neovim instance.
Potentially conflicting plugins
No response
Other information
No response
Help
No
Implementation help
No response
is this the whole setup needed? (just because I don't see a neorg setup there)
Yeah, for me it happens even with just an empty "require("neorg").setup()"
I'm closing this for now as I have now come across an instance of the issue with neorg disabled. It does happen more often with neorg enabled, but I think it's a neovim issue of some sort.
:thinking: gotta love random segfaults with no indication of where they are coming from :sweat_smile: