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

Crash "nvim: /home/runner/work/neovim/neovim/src/nvim/message.c:2392: msg_scroll_flush: Assertion `to_scroll >= 0' failed." #28331

Open
ilan-schemoul opened this issue Apr 14, 2024 · 9 comments
Labels
bug issues reporting wrong behavior bug-crash issue reporting a crash or segfault

Comments

@ilan-schemoul
Copy link

ilan-schemoul commented Apr 14, 2024

Problem

Crash on startup with nvim: /home/runner/work/neovim/neovim/src/nvim/message.c:2392: msg_scroll_flush: Assertion `to_scroll >= 0' failed.

Steps to reproduce

env -i TERM=ansi-256color "$(which nvim-unstable)" --clean -u minimal.lua
Minimal.lua :

for name, url in pairs {
  "https://github.com/folke/noice.nvim",
  "https://github.com/MunifTanjim/nui.nvim",
  "https://github.com/nvim-lua/plenary.nvim",
  "https://github.com/nvim-telescope/telescope.nvim",
} do
  local install_path = vim.fn.fnamemodify('nvim_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("noice").setup()
vim.cmd("set cmdheight=0")
vim.cmd('echohl WarningMsg | echo "The nvim git repository (~/nvim.ilanschemoul.me) is out of sync (must commit/push or pull)" | echohl None')
require("telescope").load_extension("noice")

There is no backtrace. I compiled vim in Debug mode and ran with gdb

thread apply all bt full
run
[Inferior 1 (process 774380) exited with code 0206]
(gdb) bt
No stack.
> ulimit -c unlimited
> coredumpctl -1 gdb
No match found.

If I add a breakpoint at _exit and then thread apply all bt full I have

No locals.
#1  0x00007ffff7cc5552 in __run_exit_handlers (status=134, listp=<optimized out>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:136
No locals.
#2  0x00007ffff7cc5610 in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:143
No locals.
#3  0x00005555557b1387 in os_exit (r=134) at /home/ilan/code/forks/neovim/src/nvim/main.c:700
        __func__ = "os_exit"
#4  0x000055555571db07 in exit_event (argv=0x7fffffffbf98) at /home/ilan/code/forks/neovim/src/nvim/event/process.c:415
        status = 134
        __PRETTY_FUNCTION__ = "exit_event"
#5  0x000055555571bd54 in multiqueue_process_events (self=0x555555bd85e0) at /home/ilan/code/forks/neovim/src/nvim/event/multiqueue.c:149
        event = {handler = 0x55555571da83 <exit_event>, argv = {0x86, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
        __PRETTY_FUNCTION__ = "multiqueue_process_events"
#6  0x000055555571b2b6 in loop_poll_events (loop=0x555555bc61c0 <main_loop>, ms=-1) at /home/ilan/code/forks/neovim/src/nvim/event/loop.c:83
        timeout_expired = false
#7  0x000055555593365d in ui_client_run (remote_ui=false) at /home/ilan/code/forks/neovim/src/nvim/ui_client.c:131
        width = 356
        height = 99
        term = 0x555555c483a0 "xterm-256color"
        rgb = false
#8  0x00005555557b0a91 in main (argc=1, argv=0x7fffffffc358) at /home/ilan/code/forks/neovim/src/nvim/main.c:402
        fname = 0x0
        params = {argc = 1, argv = 0x7fffffffc358, use_vimrc = 0x0, clean = false, n_commands = 0, commands = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, cmds_tofree = "\000\000\000\000\000\000\000\000\000", n_pre_commands = 0, pre_commands = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, luaf = 0x0, lua_arg0 = -1, edit_type = 0, tagname = 0
                                                                                      0x0, use_ef = 0x0, input_istext = false, no_swap_file = 0, use_debug_break_level = -1, window_count = -1, window_layout = 0, diff_mode = 0, listen_addr = 0x0, remote = 0, server_addr = 0x0, scriptin = 0x0, scriptout = 0x0, scriptout_append = false, had_stdin_file = false}
        cwd = 0x0
        has_term = true
        use_builtin_ui = true
        remote_ui = false
        __PRETTY_FUNCTION__ = "main"
        use_remote_ui = true
        listen_and_embed = false
        vimrc_none = false
        __func__ = "main"

Expected behavior

Not crash on startup

Neovim version (nvim -v)

NVIM v0.10.0-dev-2898+g 4c31a1b Build type: RelWithDebInfo LuaJIT 2.1.1710088188 Run "nvim -V1 -v" for more info

Vim (not Nvim) behaves the same?

Cannot test as crash requires lua config

Operating system/version

windows 11 with WSL 2 (5.15.146.1-microsoft-standard-WSL2) ubuntu 22.04

Terminal name/version

Windows terminal

$TERM environment variable

xterm-256color

Installation

Downloaded from git release appimage

@ilan-schemoul ilan-schemoul added the bug issues reporting wrong behavior label Apr 14, 2024
@justinmk justinmk added the bug-crash issue reporting a crash or segfault label Apr 14, 2024
@justinmk
Copy link
Member

is this different than #21056 or the other open issues: https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+msg_scroll_flush+ ?

@justinmk justinmk added the needs:response waiting for reply from the author label Apr 14, 2024
@ilan-schemoul
Copy link
Author

ilan-schemoul commented Apr 14, 2024

is this different than #21056 or the other open issues: https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+msg_scroll_flush+ ?

Cannot reproduce #21056 (could not reproduce with the same commands). My case is more similar to one reply of #21056 as I also have VM (wsl 2 is a sort of light VM), ubuntu 22.04, Noice plugin. The post does not give reproductible steps unlike I do but still likely to be the same problem.

I can reproduce #26505 with the exact same commands so same problem yeah.
I cannot reproduce #22914 first post but I can reproduce the other post

I cannot reproduce this post from #20673

For the record and to be fair both noice.nvim and "set cmdheight=0" are marked as experimental.

@github-actions github-actions bot removed the needs:response waiting for reply from the author label Apr 14, 2024
@clason
Copy link
Member

clason commented Apr 14, 2024

noice plugin

We don't support that. If you can't reproduce without it, it's out of scope here.

@ilan-schemoul
Copy link
Author

ilan-schemoul commented Apr 14, 2024

Why is not supported ?

A popular plugin leading to a crash because it uses experimental API (I assume it's the reason ?) seems like a problem that should be addressed. At the very least by documenting this somewhere (in the help page ? In the assertion failure message ?). Or better by fixing crashes in the software.

It took me +10 hours to debug this I find it a tad suprising the official answer is that you're fine with bugs and crashes without context.

@clason
Copy link
Member

clason commented Apr 14, 2024

Why should we document that someone somewhere is using unstable functions/ABIs without any guarantees? Caveat emptor.

I assume it's the reason ?

You assume wrong.

@zeertzjq
Copy link
Member

Also see #27874

@bfredl
Copy link
Member

bfredl commented Apr 14, 2024

The problem will be addressed but it will be in 0.11 as we are looking to use these API:s in core.

@ilan-schemoul
Copy link
Author

Alright thanks a lot for the explanations and I am glad the issue seems s not totally "out of scope" as said earlier but the issue has been identified and will be taken care of in the next version. I will let know the package manager of Noice that this issue (or another) could be referenced somewhere in the readme or in the list of known issues as many other engineers might lose a lot of precious time otherwise :)

@clason
Copy link
Member

clason commented Apr 14, 2024

To be clear, noice will remain out of scope. If you install a plugin, it's on you to evaluate the pros and cons. There's no guarantee noice will restrict itself to whatever will be declared stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior bug-crash issue reporting a crash or segfault
Projects
None yet
Development

No branches or pull requests

5 participants