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

NeoVIM Crashing when Scrolling Files w/o Error Message #344

Closed
tsndr opened this issue Oct 9, 2023 · 12 comments
Closed

NeoVIM Crashing when Scrolling Files w/o Error Message #344

tsndr opened this issue Oct 9, 2023 · 12 comments
Labels
bug Something isn't working upstream issue

Comments

@tsndr
Copy link

tsndr commented Oct 9, 2023

Description

When scolling through files NeoVIM will crash.

Here's a screen recording on what we've already acomplished in the treesitter issue #5501:

NeoVIM Crashing when Scrolling Files w/o Error Message
https://youtu.be/t968TqB8vyI

Neovim version

NVIM v0.9.2
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.9.2/share/nvim"

Run :checkhealth for more info

Expected behavior

NeoVIM keeps on going.

Actual behavior

NeoVIM closes itself without any error message.

Minimal config

local plugins = {
  treesitter = 'https://github.com/nvim-treesitter/nvim-treesitter',
  treesitter_context = 'https://github.com/nvim-treesitter/nvim-treesitter-context',
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.o.runtimepath = install_path..','..vim.o.runtimepath
end

vim.opt.number = true
vim.opt.relativenumber = true

require('nvim-treesitter.configs').setup {
  ensure_installed = { 'typescript' },
  sync_install = false,
  auto_install = true,
  highlight = {
    enable = true,
    additional_vim_regex_highlighting = false,
  }
}

Steps to reproduce

  1. nvim --clean -u minimal.lua src/index.ts
  2. Scroll up and down
@tsndr tsndr added the bug Something isn't working label Oct 9, 2023
@lewis6991
Copy link
Member

Sorry, this isn't something we can help with here. My guess is this is related to the built parser objects being corrupt in some way.

@tsndr
Copy link
Author

tsndr commented Oct 10, 2023

And there's nothing I can do to fix this? Do I have to live without treesitter-context now? 🥺

@lewis6991
Copy link
Member

Not if you don't know how to properly debug this.

Ts-context is just using normal treesitter APIs. If usage of those API's causes a crash, then an issue lives in the implementation behind those APIs, not the application.

Ts-context just found a codepath to trigger a bug, but there is no bug in ts-context itself.

What I would do would be to reduce this problem as much as possible. That includes reducing down the logic in ts-context until you have a minimal testcase (0 plugins). Obviously this is difficult and time consuming.

But like I said, this is likely caused by incorrectly built parsers. You'll be able to find out more if you can get a stacktrace of some kind.

@lewis6991
Copy link
Member

Stacktrace please. However this is likely not an issue with this plugin.

Crashes should be reported to neovim core with a stacktrace.

@tsndr
Copy link
Author

tsndr commented Nov 30, 2023

For me the only solution was to uninstall treesitter-context, not had a single crash since then.

@mendesbarreto
Copy link

mendesbarreto commented Nov 30, 2023

I'm facing the same issue too:

neovim-problem

@lewis6991
Copy link
Member

Can't help without a stacktrace. Sorry

@lewis6991 lewis6991 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
@mendesbarreto
Copy link

Can't help without a stacktrace. Sorry

I tried to log everything, but the crash is happening and no logs are been generated

@wookayin
Copy link
Member

https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux

@mendesbarreto
Copy link

Can't help without a stacktrace. Sorry

If you give us some way to generate, I will be happy to try

@lewis6991
Copy link
Member

Look at the link provided by @wookayin

@mkarbo
Copy link

mkarbo commented Jan 20, 2024

I have the same issue, and I have the following logs from running with

vim.cmd("set verbosefile=~/nvim.log")
vim.cmd("set verbose=15")
vim.cmd('let $NVIM_LOG_FILE = expand("~/nvim.log")')

logs:

... <- successful logs
                                                                                                      Error executing vim.schedule lua callback: ...vim-treesitter-context/lua/treesitter-context/render.lua:68: 'height' key must be a positive Integer
                                                                                                      stack traceback:
                                                                                                      	[C]: in function 'nvim_win_set_config'
                                                                                                      	...vim-treesitter-context/lua/treesitter-context/render.lua:68: in function 'display_window'
                                                                                                      	...vim-treesitter-context/lua/treesitter-context/render.lua:337: in function 'open'
                                                                                                      	.../lazy/nvim-treesitter-context/lua/treesitter-context.lua:50: in function 'open'
                                                                                                      	.../lazy/nvim-treesitter-context/lua/treesitter-context.lua:111: in function <.../lazy/nvim-treesitter-context/lua/treesitter-context.lua:92>
... <- cleanup logs

I don't know why it's indented, it's outputted like that.

Note: I use lazyvim - don't know if that helps with anything.

Neovim version: 0.9.4, mac m2, running nvim-treesitter-content on head dbcd938 I had this issue.

@lewis6991 let me know if you need more info

@nvim-treesitter nvim-treesitter locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working upstream issue
Projects
None yet
Development

No branches or pull requests

5 participants