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

Random crashes occuring #216

Closed
DanielVolchek opened this issue Mar 27, 2024 · 15 comments
Closed

Random crashes occuring #216

DanielVolchek opened this issue Mar 27, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@DanielVolchek
Copy link

Not sure how to debug this as no errors pop up

Screen.Recording.2024-03-27.at.10.38.47.AM.mov

This is my config

return {
  "ggandor/leap.nvim",
  keys = {
    {
      "s",
      function()
        vim.cmd("normal m'")

        local leap = require("leap")
        leap.leap({ target_windows = { vim.fn.win_getid() } })
      end,
    },
  },
  config = function()
    local leap = require("leap")
    leap.opts.safe_labels = {}
  end,
}

Please let me know if you need any additional information to help get this resolved

@ggandor
Copy link
Owner

ggandor commented Mar 28, 2024

Hi!

  1. Since when? Or is this your first time using the plugin?
  2. How frequently does this problem occur? Always? Sometimes? Any pattern?

Config sidenotes:

@DanielVolchek
Copy link
Author

Since when

I've been using it for a while but only just upgraded from packer to lazy and at the same time updated the plugin. Not sure what old version I was using but it wasn't occurring before I made the change

How frequently

It seems to happen randomly. Sometimes it will be the very first time I use it, other times it will happen after 4-5 leaps. No pattern I've been able to figure out so far. I've only seen it occur in bigger files, so maybe that.

I tried changing the config to this

return {
	"ggandor/leap.nvim",
	lazy = false,

	config = function()
		local leap = require("leap")
		leap.opts.safe_labels = {}

		vim.keymap.set("n", "s", "<Plug>(leap)")
		vim.keymap.set("n", "S", "<Plug>(leap-from-window)")
		vim.keymap.set({ "x", "o" }, "s", "<Plug>(leap-forward)")
		vim.keymap.set({ "x", "o" }, "S", "<Plug>(leap-backward)")
	end,
}

but it is still happening

@ufUNnxagpM
Copy link

+1 I can confirm that I'm experiencing the same issue even in small files. My config is fairly minimal

-- lazy installation
require('lazy').setup({
...
  "ggandor/leap.nvim",
...
}
-- keybinds (declared in a separate file)
vim.keymap.set({'n', 'x', 'o'}, '<leader>s', '<Plug>(leap)')
vim.keymap.set({'n', 'x', 'o'}, '<leader>S', function ()
  local focusable_windows = vim.tbl_filter(
    function (win) return vim.api.nvim_win_get_config(win).focusable end,
    vim.api.nvim_tabpage_list_wins(0)
  )
  require('leap').leap { target_windows = focusable_windows }
end)

@ggandor ggandor added bug Something isn't working help wanted Extra attention is needed labels Mar 29, 2024
@ggandor
Copy link
Owner

ggandor commented Mar 29, 2024

Not sure what old version I was using but it wasn't occurring before I made the change

Well, this is good news, but then it's up to you guys to bisect and find the guilty commit (since I cannot reproduce).

@DanielVolchek
Copy link
Author

DanielVolchek commented Mar 29, 2024

I restarted my computer and it seems to have fixed it. I'd guess some ghost files in the cache conflicting with Lazy or something like that. I'll keep this open if @ufUNnxagpM continues experiencing it but for me it is resolved.

@edward-s
Copy link

edward-s commented Mar 29, 2024

Hi,
i'm also getting crashes after commit cc0be53, no issue with b8728bd

CleanShot.2024-03-30.at.1.36.19-converted.mp4

in the video above, i pressed "s e", and it crashes with that error

return {
	{
		"ggandor/flit.nvim",
		keys = function()
			local ret = {}
			for _, key in ipairs({ "f", "F", "t", "T" }) do
				ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key }
			end
			return ret
		end,
		opts = { labeled_modes = "nx" },
	},
	{
		"ggandor/leap.nvim",
		keys = {
			{ "s", mode = { "n", "x", "o" }, desc = "Leap forward to" },
			{ "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" },
		},
		commit = "b8728bd",
		config = function(_, opts)
			require("leap").add_default_mappings(true)
			vim.keymap.set("n", "s", function()
				local current_window = vim.fn.win_getid()
				require("leap").leap({ target_windows = { current_window } })
			end)
			vim.keymap.set({ "o", "x" }, "S", "<Plug>(leap-backward-till)")
			vim.keymap.set({ "o", "x" }, "s", "<Plug>(leap-forward-till)")
		end,
	},
}

@kkpattern
Copy link

i'm also getting crashes after commit cc0be53, no issue with b8728bd

I can also confirm this. Switching to commit cc0be53 will get crashes, and there will be no issue with b8728bd.

Also, I didn't seem to get the crashes on the Windows platform. Only on macos. I'm using iTerm.

@ggandor
Copy link
Owner

ggandor commented Mar 31, 2024

I am in the dark here, cc0be53 seems a totally safe refactoring to me. Since I cannot reproduce, I cannot experiment either, so please try to find out where the actual problem is, if you can follow the logic, it's a pretty small diff. (Just tweak the compiled lua code if you don't have fennel at hand.)

What are the values of in1 and ?in2 right before this line? (just insert print(in1, _3fin2); vim.cmd.sleep('2000m'))
(lua) cc0be53#diff-35d5e086704b9dbc34e22f4f5976a5bb775bb74ae624473176eabcadf406adb5R680
(fennel) cc0be53#diff-1efecb4315c2ab92d505fd3f6d75ca27abc987cd4b6f95afcc7ad3e83462002eR642

@edward-s
Copy link

edward-s commented Apr 1, 2024

I tried to help out by adding the print line at ~/.local/share/nvim/lazy/leap.nvim/lua/leap/main.lua
but have no idea where or what to do next (lua noob)

anyways, i upgraded to the latest commit and am still able to consistently crash neovim with Error: Process exited with error code 139 by just doing s e, back to b8728bd for now

@edward-s
Copy link

edward-s commented Apr 1, 2024

This is further proof that cc0be53 is the crash culprit for me

CleanShot.2024-04-01.at.11.21.18-converted.mp4

@ggandor
Copy link
Owner

ggandor commented Apr 1, 2024

I tried to help out by adding the print line at ~/.local/share/nvim/lazy/leap.nvim/lua/leap/main.lua
but have no idea where or what to do next (lua noob)

It crashes before printing then?

@edward-s
Copy link

no longer crashing for me after updating to the latest release, thanks!

@ggandor
Copy link
Owner

ggandor commented Apr 10, 2024

I have no idea what fixed the problem in the meanwhile (if it is indeed fixed), so could you guys please search for the commit again? This is probably the most mysterious bug I've encountered here so far.

@kkpattern
Copy link

Seems 1f38806 fixed the crash for me.

@edward-s
Copy link

I can also confirm that 1f38806 fixed the crash for me.
the commit before that (7a9407d) consistently crashes for me

@ggandor ggandor removed the help wanted Extra attention is needed label May 20, 2024
@ggandor ggandor closed this as completed May 20, 2024
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

5 participants