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 on startup (bc. nvim_treesitter not found in runtime path?) #6769

Closed
henriman opened this issue Jun 14, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@henriman
Copy link

Describe the bug

On opening a file for which there is an appropriate parser installed, Neovim freezes (due to a segmentation fault).

In the log file, these lines might be relevant:
not found in runtime path: "autoload/nvim_treesitter.vim"
not found in runtime path: "ftdetect/*.{vim,lua}"

Error detected while processing C:\Users\henri\AppData\Local\nvim\init.lua..nvim_exec2() called at C:\Users\henri\AppData\Local\nvim\init.lua:0:
E216: No such group or event: FileExplorer *

To Reproduce

  1. Install nvim-treesitter on Windows 11 using lazy.nvim. Relevant part of config:
  {
    'nvim-treesitter/nvim-treesitter',
    build = ':TSUpdate',
    opts = {
      ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
      auto_install = true,
      highlight = {
        enable = true,
        additional_vim_regex_highlighting = { 'ruby' },
      },
      indent = { enable = true, disable = { 'ruby' } },
    },
    config = function(_, opts)
      require('nvim-treesitter.configs').setup(opts)
    end,
  }
  1. Open a file; if there is an appropriate parser installed already, Neovim freezes now. Otherwise, it automatically installs the appropriate parser; while remaining in the same Neovim "session", everything works properly, however after quitting and restarting Neovim on the same file, it now freezes too.

Expected behavior

Neovim not freezing and the file to be syntax highlighted etc. appropriately.

Output of :checkhealth nvim-treesitter

nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK `node` found v20.14.0 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `gcc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: gcc (GCC) 11.4.0
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "10.0.22631",
  sysname = "Windows_NT",
  version = "Windows 11 Home"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - c                   ✓ ✓ ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - luadoc              ✓ . . . .
  - markdown            ✓ . ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

Output of nvim --version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

Additional context

I am using Windows 11 and lazy.nvim package manager. Some of the tools, e.g. gcc, are provided by Cygwin. The same config worked without problems on a machine running Manjaro.

@henriman henriman added the bug Something isn't working label Jun 14, 2024
@henriman henriman changed the title Segmentation fault on startup (bc nvim_treesitter not found in runtime path?) Segmentation fault on startup (bc. nvim_treesitter not found in runtime path?) Jun 14, 2024
@clason
Copy link
Contributor

clason commented Jun 14, 2024

Don't lazy-load nvim-treesitter; that is not supported.

@clason clason closed this as completed Jun 14, 2024
@clason
Copy link
Contributor

clason commented Jun 14, 2024

(And segmentation faults are parser issues; make sure you have the latest version installed (remove all and reinstall; otherwise report the issue at the corresponding parser repo.)

@henriman
Copy link
Author

I have configured nvim-treesitter exactly as described here; however, also setting lazy = false doesn't help.

The reason I have opened the issue here is because this is a problem for at least 3 file types (lua, vim, python) and because of the mentioned line not found in runtime path: "autoload/nvim_treesitter.vim" in the log file.

I will open an issue on the corresponding parser repos, thank you for your support.

@clason
Copy link
Contributor

clason commented Jun 14, 2024

not found in runtime path: "autoload/nvim_treesitter.vim

Which means that nvim-treesitter isn't correctly loaded (or installed), so it's not an nvim-treesitter issue ;)

Do try to create a minimal repro without lazy that can be tested with nvim --clean -u test.lua.

Also, how do you know that the freeze is due to a "segmentation fault"? A segmentation fault would crash the editor and return you to the shell.

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