mason-org / mason-org/mason.nvim

Mason crashes Neovim with bad argument to fs_fstat

Open
#1,815 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
10.5k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

### I've searched open issues for similar requests

- [X] Yes

### I've recently downloaded the latest plugin version of mason.nvim

- [X] Yes

### Problem description

Using Mason command causes neovim to crash with error:

```
PANIC: unprotected error in call to Lua API (...ocal/share/nvim/plugged/mason.nvim/lua/mason-core/fs.lua:13: bad argument #1 to'fs_fstat' (number expected, got nil))
```

### Expected behavior

neovim does not crash when using Mason commands

### Steps to reproduce

On Wolfi OS with the following packages installed:

```
luajit (2.1_p20210510-r7)
lua5.1-lpeg (1.1.0-r1)
libuv (1.49.2-r0)
lua-luv (1.48.0.2-r2)
msgpack-c (6.1.0-r1)
tree-sitter (0.24.3-r0)
unibilium (2.1.2-r0)
neovim (0.10.2-r0)
```

init.vim (using plug.vim):

```vimrc
call plug#begin()
Plug 'williamboman/mason.nvim'
call plug#end()

lua << EOF
require("mason").setup()
EOF
```

1. install nvim, plug.vim, `:PlugInstall`
2. run `:Mason` command

### Neovim version (>= 0.7)

NVIM v0.10.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

### Operating system/version

Linux 78e974240061 6.10.12-200.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Sep 30 21:38:25 UTC 2024 x86_64 Linux

### Healthcheck output

running `:checkhealth` returns this same error:

```
PANIC: unprotected error in call to Lua API (...ocal/share/nvim/plugged/mason.nvim/lua/mason-core/fs.lua:13: bad argument #1 to'fs_fstat' (number expected, got nil))
```

### Screenshots

_No response_

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.

Research direction

Start by reproducing the crash with the listed Wolfi OS, Neovim 0.10.2, and Mason setup, then inspect lua/mason-core/fs.lua at line 13 and the fs_fstat call. Verify the fix by running :Mason and :checkhealth without a Neovim crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, lua, vim
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.