plenary.async.uv: Attempt to yield across C-call boundary

Open
#252 3 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
lua
Domain
devtools

Research direction

Start with the minimal init.lua reproduction and the async example in the README, then inspect plenary.async.uv.fs_open and reproduce the failure with the direct :lua call. Determine why the call yields across a C-call boundary in the reported Neovim environment. Done means the documented usage no longer raises this error, with the reproduction verified against the relevant Neovim version.

Written by the indexing model from the issue text.

Description

I'm starting to write a very minimalistic plugin with async example from README. Basically there's only init.lua file with:

local a = require("plenary.async")

read = function(path)
  local err, fd = a.uv.fs_open(path, "r", 438)
  assert(not err, err)
end

return { read_token = read }

But it fails with the following error, whenever I try to call the function:

E5108: Error executing lua ...te/pack/packer/start/myplugin.nvim/lua/myplugin/init.lua:4: attempt to yield across C-call boundary

Although in fact I see the same error even when call it directly:

:lua require("plenary.async").uv.fs_open("/etc/fstab", "r", 438)

:version output:

:version
NVIM v0.6.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by antonparkhomenko

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/nix/store/nzy87w4j77l1jiyrmxlifn9nv6i1jyc1-neovim-unwrapped-master/share/nvim"
Dominant language
Lua
Stars
3.5k
Forks
340
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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-lua/plenary.nvim

All issues in nvim-lua/plenary.nvim

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.