Zulip Chat Archive

Stream: general

Topic: neovim stalled by strange errors…


Antoine Chambert-Loir (Apr 07 2025 at 20:38):

I get a lot of errors like this tonight, which end up stalling neovim… What could happen?

Error executing vim.schedule lua callback: ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:274: Invalid 'end_col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:274: in function 'f'
        ...Cellar/neovim/0.11.0/share/nvim/runtime/lua/vim/iter.lua:207: in function 'filter'
        ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:254: in function 'handler'
        .../neovim/0.11.0/share/nvim/runtime/lua/vim/lsp/client.lua:1109: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Julian Berman (Apr 07 2025 at 20:49):

Does it happen with any file, or if not anything you can share to help me reproduce?

Antoine Chambert-Loir (Apr 07 2025 at 20:50):

It happens with the file Mathlib/RingTheory/Polynomial/Eisenstein/Generalized.lean of #23710

Julian Berman (Apr 07 2025 at 20:57):

I can't reproduce with that file yet -- could I ask if you could double check you're up to date on lean.nvim? Is there anything in particular I should do? Or it happens for you just from moving around?

Julian Berman (Apr 07 2025 at 20:57):

Meanwhile I'll also try to do it with your dotfiles that you shared.

Matthew Ballard (Apr 16 2025 at 15:18):

I am getting this over and over now. It seems pretty sporadic.

Antoine Chambert-Loir (Apr 16 2025 at 15:20):

Probably not a coincidence : at the same time, top shows that nvim takes 100% of CPU.

Matthew Ballard (Apr 16 2025 at 15:21):

Does it have something to do with auto-indent? I seem to get it when pushing text to the next line.

Antoine Chambert-Loir (Apr 16 2025 at 15:21):

It happens very often when I delete lines (dd).

Matthew Ballard (Apr 16 2025 at 15:22):

Separately, overall performance is more sluggish but I can't tell whether the culprit is the async elab features, nvim, the extension, or else.

Julian Berman (Apr 16 2025 at 20:22):

Can I confirm both of you are up to date? And I don't suppose either of you has anything that can help me reproduce? Not that I've done a lot of lean (as opposed to lean.nvim dev itself) recently so it's possible it's easy to reproduce and I just need to try. If it's exactly the traceback from above I could put in something to simply make it go away but I would like to avoid doing so if possible in favor of reproducing and seeing what/where the actual issue is :/

Antoine Chambert-Loir (Apr 16 2025 at 20:24):

The best I can do to claim I'm “up to date” is entering :Lazy, and typing U. Is that OK?

Julian Berman (Apr 16 2025 at 20:24):

Yes, that should mean you are!

Matthew Ballard (Apr 16 2025 at 20:26):

I'll give you the commit in my local clone in a 5, 4, 3,...

Julian Berman (Apr 16 2025 at 20:27):

I was about to tell you to just show me checkhealth lean, but I see the version info there is... broken :( so I am fixing that now too

Matthew Ballard (Apr 16 2025 at 20:28):

ddb881407213d27

Matthew Ballard (Apr 16 2025 at 20:28):

It is from March 30 so let me update

Antoine Chambert-Loir (Apr 16 2025 at 20:28):

lean.nvim (v4.19.0-rc3-72-g6c1b01338c) ~
- OK Neovim is new enough.
- `vim.version()`:  0.11.0
- OK Lake is runnable.
- `lake --version`:  Lake version 5.0.0-045d07d (Lean version 4.19.0-rc3)

Adam Topaz (Apr 16 2025 at 20:30):

FWIW I have also noticed speed issues in nvim primarily when jumping to a definition which lands me in the middle of some large file.

Matthew Ballard (Apr 16 2025 at 20:31):

Hmm. Packer is telling me things are not very much out of date but the local clone is way off... I might be looking the wrong place. Either way I should be up to date now. I will report back if I see more issues.

Julian Berman (Apr 16 2025 at 20:35):

OK, I'll also follow up with some instructions on how to collect a profile shortly, but one of the two things I'm trying to get finished right now is some memoization, so there's not much point doing so until I'm done given that's a source of slowness that I'm already aware of and is affecting things.

Matthew Ballard (Apr 16 2025 at 20:52):

Still there -- dd is triggering it

Julian Berman (Apr 16 2025 at 20:56):

So open some random file and dd and you get a traceback?

Antoine Chambert-Loir (Apr 16 2025 at 20:57):

By opening a random file, do you wish that I open /dev/random?

Antoine Chambert-Loir (Apr 16 2025 at 20:58):

typically, yes.

Julian Berman (Apr 16 2025 at 20:58):

No sorry I just meant arbitrary

Antoine Chambert-Loir (Apr 16 2025 at 20:58):

It has to be a lean file. I don't get this otherwise.

Matthew Ballard (Apr 16 2025 at 20:59):

Error executing vim.schedule lua callback: ...e/nvim/site/pack/packer/start/lean.nvim/lua/lean/lsp.lua:219: Invalid 'end_col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...e/nvim/site/pack/packer/start/lean.nvim/lua/lean/lsp.lua:219: in function 'f'
        ...Cellar/neovim/0.11.0/share/nvim/runtime/lua/vim/iter.lua:207: in function 'filter'
        ...e/nvim/site/pack/packer/start/lean.nvim/lua/lean/lsp.lua:199: in function 'handler'
        .../neovim/0.11.0/share/nvim/runtime/lua/vim/lsp/client.lua:1109: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Same as above

Julian Berman (Apr 16 2025 at 20:59):

As in you deterministically are getting a traceback if you open any old Mathlib file and delete a line?

Antoine Chambert-Loir (Apr 16 2025 at 20:59):

Yes.

Matthew Ballard (Apr 16 2025 at 21:00):

Line 79 in Mathlib.RingTheory.Valuation.ValuationSubring

Julian Berman (Apr 16 2025 at 21:01):

So strange, that definitely does not happen to me, so I really would love to know what's different. Let me try that file.

Antoine Chambert-Loir (Apr 16 2025 at 21:01):

I didn't expect it to be deterministic. But I just open Mathlib/GroupTheory/Abelianization.lean, I'm at line 39, and 8dd, followed by u, triggers it (at undo).

Matthew Ballard (Apr 16 2025 at 21:01):

I did it 5 or so times in a row

Matthew Ballard (Apr 16 2025 at 21:01):

Cursor positioned in the first column

Julian Berman (Apr 16 2025 at 21:01):

Aha! Perfect, that does it! Thank you (both of you)!

Matthew Ballard (Apr 16 2025 at 21:02):

God forbid you dd and then u

Julian Berman (Apr 16 2025 at 21:03):

Of course it happened once and now has not happened again the next 5 times, but OK at least I have seen it once.

Antoine Chambert-Loir (Apr 16 2025 at 21:04):

Sometimes I get one of these error messages, and sometimes a full screen of them. (10 times the same stuff, more or less…)

Matthew Ballard (Apr 16 2025 at 21:04):

Yes, I thought I had crashed the editor but enough returns got me back

Matthew Ballard (Apr 16 2025 at 21:05):

I did a few more times. It is not 100% but still happens more often than not

Julian Berman (Apr 16 2025 at 21:12):

OK I put in a fix (at least I haven't seen a traceback leak through now in 10 tries). Please update again and let me know if you still see them!

Julian Berman (Apr 16 2025 at 21:12):

(None of this will have anything to do with stalling unfortunately)

Antoine Chambert-Loir (Apr 16 2025 at 21:14):

I still have it. Line 51 of Abelianization, 8dd/u.

Julian Berman (Apr 16 2025 at 21:15):

Can you show me what the traceback looks like now?

Antoine Chambert-Loir (Apr 16 2025 at 21:15):

Error executing vim.schedule lua callback: ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:219: Invalid 'end_col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:219: in function 'f'
        ...Cellar/neovim/0.11.0/share/nvim/runtime/lua/vim/iter.lua:207: in function 'filter'
        ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:199: in function 'handler'
        .../neovim/0.11.0/share/nvim/runtime/lua/vim/lsp/client.lua:1109: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

Julian Berman (Apr 16 2025 at 21:22):

OK, one more try then... Lazy update and cross our fingers.

Antoine Chambert-Loir (Apr 16 2025 at 21:24):

Same…

Error executing vim.schedule lua callback: ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:219: Invalid 'end_col': out of range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:219: in function 'f'
        ...Cellar/neovim/0.11.0/share/nvim/runtime/lua/vim/iter.lua:207: in function 'filter'
        ...ambert/.local/share/nvim/lazy/lean.nvim/lua/lean/lsp.lua:199: in function 'handler'
        .../neovim/0.11.0/share/nvim/runtime/lua/vim/lsp/client.lua:1109: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

and if I press Enter, the same message repeats over and over.

Antoine Chambert-Loir (Apr 16 2025 at 21:24):

image.png

Antoine Chambert-Loir (Apr 16 2025 at 21:27):

A new error message, from satellite (Major Tom to Ground Control…)

error(satellite.nvim): handler=gitsigns buf=6 row=20 opts={ id = 21, priority = 20, sign_hl_group = "SatelliteGitSignsChange", sign_text = " │" }, err="Invalid 'line':
error(satellite.nvim): handler=gitsigns buf=6 row=20 opts={ id = 21, priority = 20, sign_hl_group = "SatelliteGitSignsChange", sign_text = " " }, err="Invalid 'line':
error(satellite.nvim): handler=gitsigns buf=6 row=20 opts={ id = 21, priority = 20, sign_hl_group = "SatelliteGitSignsAdd", sign_text = " │" }, err="Invalid 'line': ou
error(satellite.nvim): handler=gitsigns buf=6 row=20 opts={ id = 21, priority = 20, sign_hl_group = "SatelliteGitSignsChange", sign_text = " " }, err="Invalid 'line':
 out of range"

Julian Berman (Apr 16 2025 at 21:28):

:/ -- But something is strange because the line numbers are off there from what's on main after my commits I think. Can you show me :checkhealth lean now?

Julian Berman (Apr 16 2025 at 21:29):

You're sure you ran Lazy update again right?

Antoine Chambert-Loir (Apr 16 2025 at 21:29):

lean.nvim (v2024.12.2-193-gf1d9e79)

Julian Berman (Apr 16 2025 at 21:30):

That's correct :/ OK, back to the drawing board then, even though I have not seen this again yet, will keep trying.


Last updated: May 02 2025 at 03:31 UTC