Skip to content

Assertion failed in coroutineΒ #847

@scallaway

Description

@scallaway

Description

This is very similar to #814, but happening in a slightly different part of hunks.lua.

I can't work out quite when this crash happens, but I've found it to happen pretty consistently in a Python file that is open for a minute or so. Of course when the error shows, the git signs completely vanish.


I had a run through the hunks.lua file and found the assert thats failing. I commented it out and had a play around with the minimum config again and that seems to do the job, but I can't be sure that's not absolutely required in the plugin.

Neovim version

nightly

Operating system and version

debian

Expected behavior

No response

Actual behavior

Error output is the following;

Error executing vim.schedule lua callback: ...gitsigns_issue/gitsigns//lua/gitsigns/async.lua:76: The coroutine failed with this message: ...gitsigns_issue/gitsigns//lua/gitsigns/hunks.lua:172: assertion failed!
stack traceback:
        [C]: in function 'assert'
        ...gitsigns_issue/gitsigns//lua/gitsigns/hunks.lua:172: in function 'calc_signs'
        ...gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:59: in function 'apply_win_signs0'
        ...gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:81: in function 'apply_win_signs'
        ...gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:454: in function 'fn'
        ...tform/gitsigns_issue/gitsigns//lua/gitsigns/debounce.lua:76: in function 'update'
        ...gitsigns_issue/gitsigns//lua/gitsigns/watcher.lua:88: in function <...gitsigns_issue/gitsigns//lua/gitsigns/watcher.lua:59>
stack traceback:
        [C]: in function 'error'
        ...gitsigns_issue/gitsigns//lua/gitsigns/async.lua:76: in function 'cb'
        ...gitsigns_issue/gitsigns//lua/gitsigns/async.lua:113: in function 'cb'
        ...gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:36: in function <...gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:34>

Minimal config

for name, url in pairs({
	gitsigns = "https://github.com/lewis6991/gitsigns.nvim",
	-- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
	nvim_lspconfig = "https://github.com/neovim/nvim-lspconfig",
}) do
	local install_path = vim.fn.fnamemodify("gitsigns_issue/" .. name, ":p")
	if vim.fn.isdirectory(install_path) == 0 then
		vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
	end
	vim.opt.runtimepath:append(install_path)
end

require("gitsigns").setup({
	debug_mode = true, -- You must add this to enable debug messages
	-- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
})

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

require("lspconfig").pyright.setup({})

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. Wait for a little bit

Gitsigns debug messages

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunable to reproduceUnable to reproduce problem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions