neorg icon indicating copy to clipboard operation
neorg copied to clipboard

Segmentation faults with loadview

Open jghauser opened this issue 3 years ago • 2 comments

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.

  1. Add these autocmds to your init.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",
})
  1. create an empty file for which no shada file exists (e.g. touch asdklqwjelqwej)
  2. 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

jghauser avatar Sep 20 '22 19:09 jghauser

is this the whole setup needed? (just because I don't see a neorg setup there)

max397574 avatar Sep 20 '22 19:09 max397574

Yeah, for me it happens even with just an empty "require("neorg").setup()"

jghauser avatar Sep 21 '22 05:09 jghauser

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.

jghauser avatar Sep 22 '22 09:09 jghauser

:thinking: gotta love random segfaults with no indication of where they are coming from :sweat_smile:

vhyrro avatar Sep 22 '22 09:09 vhyrro