Closed noib3 closed 3 years ago
Thanks for the report! I'm not very familiar with NixOS, but the search paths in your error message don't look right. Another user recently mentioned that nix
sometimes renames paths in a way that breaks things for this (https://github.com/wbthomason/packer.nvim/issues/235#issuecomment-786811424) - could you please send the output of tree ~/.local/share/nvim/site/pack
, so that we can see if the paths there are as expected?
@wbthomason sure, here it is
$ tree ~/.local/share/nvim/site/pack
/home/nix/.local/share/nvim/site/pack
└── packer
├── opt
│ └── packer.nvim
│ ├── doc
│ │ └── packer.txt
│ ├── LICENSE
│ ├── lua
│ │ ├── packer
│ │ │ ├── async.lua
│ │ │ ├── clean.lua
│ │ │ ├── compile.lua
│ │ │ ├── display.lua
│ │ │ ├── handlers.lua
│ │ │ ├── install.lua
│ │ │ ├── jobs.lua
│ │ │ ├── load.lua
│ │ │ ├── log.lua
│ │ │ ├── luarocks.lua
│ │ │ ├── plugin_types
│ │ │ │ ├── git.lua
│ │ │ │ └── local.lua
│ │ │ ├── plugin_types.lua
│ │ │ ├── plugin_utils.lua
│ │ │ ├── result.lua
│ │ │ ├── update.lua
│ │ │ └── util.lua
│ │ └── packer.lua
│ └── README.md
└── start
8 directories, 21 files
Wait, I'm sorry. I think I know what's happening here. Just to check, does :PackerInstall
fail if you hit enter
to get past the initial error messages when you open Neovim?
What's going on is that you already have a packer_compiled
in place, but don't have any plugins installed. So, when you start Neovim, packer_compiled
gets sourced and tries to load things that aren't there yet.
If PackerInstall
is there after the errors, then just running that should work. Otherwise, we can figure out a way to make sure the install happens before packer_compiled
is sourced.
Just to check, does :PackerInstall fail if you hit enter to get past the initial error messages when you open Neovim?
Yes, it fails in the exact same way if I just open neovim, hit enter to get past the errors and issue a :PackerInstall
(basically what I did in the video minus the :PackerCompile
step).
What's going on is that you already have a packer_compiled in place, but don't have any plugins installed. So, when you start Neovim, packer_compiled gets sourced and tries to load things that aren't there yet.
I'm not that's what's going on here. If I delete my packer_compiled
I get no initial error when opening neovim, instead I get it after issuing a :PackerCompile
. After that, :PackerInstall
still crashes.
What happens if you:
packer_compiled
PackerInstall
PackerCompile
Running PackerCompile
before things are installed will cause the errors you're seeing, because packer
will source the compiled file. I admit I have no idea why Neovim is segfaulting when you run :PackerInstall
after pushing past the errors, but I'm hopeful that avoiding the errors entirely will let the install work.
You can also run PackerSync
to do the install and compile all together, in proper sequence.
It still segfaults when I run a PackerInstall
, same with PackerSync
. Deleting my packer_compiled
gets rid of the errors, but I don't think it's got much to do with neovim segfaulting. That happens with PackerInstall
, PackerUpdate
and PackerSync
.
Fascinating. I think the segfault is separate from the other errors, then.
Do you think you could get a core dump so we can figure out what's triggering the segfault? I wonder if this is an upstream issue.
Do you think you could get a core dump so we can figure out what's triggering the segfault?
Sure, how do I do that?
This has a pretty good overview: https://jvns.ca/blog/2018/04/28/debugging-a-segfault-on-linux/ (skipping the step about valgrind
unless you feel like doing that too, but it's not necessary for a core dump)
@wbthomason here's the backtrace of the core dump:
(gdb) bt
#0 0x00007f5319f12751 in __strlen_avx2 () from /nix/store/hp8wcylqr14hrrpqap4wdrwzq092wfln-glibc-2.32-37/lib/libc.so.6
#1 0x00000000004fb657 in tv_dict_add_str ()
#2 0x00000000004dfb57 in f_environ.lto_priv ()
#3 0x0000000000503855 in call_func ()
#4 0x0000000000587144 in nlua_call ()
#5 0x00007f5319f849d5 in ?? () from /nix/store/jzyd44q72bg1agcsnr0khzyfj1nd9ijn-luajit-2.1.0-2020-12-28/lib/libluajit-5.1.so.2
#6 0x00007f5319f85825 in ?? () from /nix/store/jzyd44q72bg1agcsnr0khzyfj1nd9ijn-luajit-2.1.0-2020-12-28/lib/libluajit-5.1.so.2
#7 0x00007f5319fda159 in lua_pcall () from /nix/store/jzyd44q72bg1agcsnr0khzyfj1nd9ijn-luajit-2.1.0-2020-12-28/lib/libluajit-5.1.so.2
#8 0x00000000005879f1 in nlua_schedule_event ()
#9 0x0000000000505509 in multiqueue_process_events ()
#10 0x00000000005d4c4f in nv_event.lto_priv ()
#11 0x00000000005ca97e in normal_execute.lto_priv ()
#12 0x000000000068109d in state_enter ()
#13 0x00000000005c614b in normal_enter ()
#14 0x00000000004479e3 in main ()
Thanks, and sorry for the radio silence! This looks like it might be an issue with a non-null-terminated string? (given the crash seems to happen in strlen
) Of course, I have no idea where such a malformed string might be coming from.
Do you have anything in ~/.cache/nvim/packer.nvim.log
? That might help us narrow down where the install is failing.
This isn't due to packer but because colorizer.so is failing to load (probably due to cpath). A similar issue happens with sql.nvim which depends on sqlite3 https://github.com/tami5/sql.nvim/pull/36 https://github.com/tami5/sql.nvim/issues/28
Glad to see anothe nixos user ;)
Not sure if relevant, I am using home-manager by symlink-ing $XDG_CONFG_HOME/nvim via
xdg.configFile."nvim".source = ./config/nvim;
The problem is, usually, $XDG_CONFIG_HOME may not be writable if the runtimepath you are using is linked to a read-only overlay file system pointing to /nix/store
. packer.nvim by default writes the packer_compiled.vim
to $XDG_CONFIG_HOME via compile_path = util.join_paths(vim.fn.stdpath('config'), 'packer_compiled.vim')
.
To avoid this issue, simply use config.lib.file.mkOutOfStoreSymlink
provided by home-manager when you do symlink-ing or set the compile_path to $XDG_DATA_HOME.
Thanks @mjlbach and @Congee for the additional context! I'm closing this for now, since it seems (1) not caused by packer
and (2) solved by the fix @Congee shared, but please feel free to reopen if I've misunderstood.
os: NixOS 20.09 (Nightingale)
nvim --version
: NVIM v0.5.0-devI'm trying to use packer on a remote server running nixos, but every time I try to
:PackerInstall
neovim just crashes.When I open neovim I get this error message:
this is my
packer_compiled.vim
and this is my
plugins.lua
(also found in my dotfiles right here)it may seem that the plugin
nvim-colorizer.lua
is the problem, but if I comment that out I get the same exact error message, this time withnvim-treesitter
. It seems that packer can't locate the modules it needs, possibly because of the unusual way NixOS file system is structured?Finally, this is a video of the crash happening
https://user-images.githubusercontent.com/59321248/109642871-ca367280-7b53-11eb-93c9-4fc03cd6c163.mov