SIGSEGV when typing ":TSInstall "

Open
#4,356 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
lua, vim
Domain
cli, tooling

Research direction

Start by reproducing the crash while typing :TSInstall with the shown wilder.nvim configuration, then inspect the stack entry points f_getcompletion, ExpandFromContext, nlua_call_user_expand_func, and nlua_call. Use the provided gdb backtrace and Neovim v0.8.3 environment as the baseline; done means the command-line completion path no longer causes a SIGSEGV.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

When typing ":TSInstall ", nvim crashes with the following stacktrace:

coredumctl dump nvim

           PID: 1540947 (nvim)
           UID: 1000 (ea)
           GID: 1000 (ea)
        Signal: 11 (SEGV)
     Timestamp: Tue 2023-02-21 09:30:00 CST (37s ago)
  Command Line: nvim
    Executable: /home/ea/.local/share/bob/stable/nvim-linux64/bin/nvim
 Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-5916f06e-e16f-4051-b5fb-549c834547ee.scope
          Unit: user@1000.service
     User Unit: vte-spawn-5916f06e-e16f-4051-b5fb-549c834547ee.scope
         Slice: user-1000.slice
     Owner UID: 1000 (ea)
       Boot ID: 9df5dcf9237842b3a3f9a2ce3de77bc7
    Machine ID: b2215c86dec8459aae9a219024cb0138
      Hostname: pc
       Storage: /var/lib/systemd/coredump/core.nvim.1000.9df5dcf9237842b3a3f9a2ce3de77bc7.1540947.1676943000000000.zst (present)
  Size on Disk: 5.3M
       Message: Process 1540947 (nvim) of user 1000 dumped core.
                
                Stack trace of thread 1540947:
                #0  0x00005591eb8a4845 n/a (/home/ea/.local/share/bob/stable/nvim-linux64/bin/nvim + 0x1f2845)
                ELF object binary architecture: AMD x86-64

sudo coredumpctl gdb PID

Reading symbols from /home/ea/.local/share/bob/stable/nvim-linux64/bin/nvim...
[New LWP 1540947]
[New LWP 1540948]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `nvim'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00005591eb8a4845 in nlua_call ()
[Current thread is 1 (Thread 0x7f513d026740 (LWP 1540947))]
(gdb) where
#0  0x00005591eb8a4845 in nlua_call ()
#1  0x00005591ebad55f6 in lj_BC_FUNCC ()
#2  0x00005591ebac19f6 in lua_pcall (L=0x7f513d33d380, nargs=<optimized out>, nresults=1, 
    errfunc=<optimized out>) at lj_api.c:1116
#3  0x00005591eb89cda8 in nlua_pcall ()
#4  0x00005591eb8a25ea in nlua_call_user_expand_func ()
#5  0x00005591eb7aa400 in ExpandFromContext ()
#6  0x00005591eb7aaa4e in ExpandOne ()
#7  0x00005591eb7ac85c in f_getcompletion ()
#8  0x00005591eb7f1356 in call_internal_func ()
#9  0x00005591eb816194 in call_func ()
#10 0x00005591eb8a4ab6 in nlua_call ()
#11 0x00005591ebad55f6 in lj_BC_FUNCC ()

To Reproduce

Another plugin is relativated

  ["gelguy/wilder.nvim"] = {
    config = function()
      local wilder = require('wilder')
      wilder.setup({modes = {':', '/', '?'}})
    end,
  },

when input "TSInstall"and "<space" in cmdline, no autocomplete commands. neovim crash

Expected behavior

No response

Output of :checkhealth nvim-treesitter
nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v19.6.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 12.2.1 20230201
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## OS Info:
{
  machine = "x86_64",
  release = "5.15.91-1-MANJARO",
  sysname = "Linux",
  version = "#1 SMP PREEMPT Wed Feb 1 12:03:19 UTC 2023"
}

## Parser/Features         H L F I J
  - lua                 ✓ ✓ ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - c                   ✓ ✓ ✓ ✓ ✓
  - help                ✓ . . . ✓
  - vim                 ✓ ✓ ✓ . ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - rust                ✓ ✓ ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}
Output of nvim --version
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az183-550

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
Additional context

No response

Dominant language
Tree-sitter Query
Stars
14.4k
Forks
1.4k
Avg merge
4h 35m
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nvim-treesitter/nvim-treesitter

All issues in nvim-treesitter/nvim-treesitter

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.