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

nvim_get_proc_children() may not return all child processes #28741

Open
altermo opened this issue May 14, 2024 · 1 comment
Open

nvim_get_proc_children() may not return all child processes #28741

altermo opened this issue May 14, 2024 · 1 comment
Labels
api libnvim, Nvim RPC API bug issues reporting wrong behavior platform:linux system
Milestone

Comments

@altermo
Copy link
Contributor

altermo commented May 14, 2024

Problem

nvim_get_proc_children() uses /proc/pid/task/tid/children on Linux systems (most of the time) which sometimes does not contain all child processes.

Steps to reproduce

(In this example firefox is used because I couldn't figure out how to create my own binary that would break it)

echo "
vim.system{'firefox','-P'}
vim.uv.sleep(1000)
local pid=assert(tonumber(vim.iter(vim.split(vim.system{'pgrep','firefox'}:wait().stdout,'\n',{trimempty=true})):nth(-1)))
vim.print('Child processes: '..vim.inspect(vim._os_proc_children(pid)))
vim.print('nvim_get_proc_children: '..vim.inspect(vim.api.nvim_get_proc_children(pid)))
"|nvim -l -

Expected behavior

Make nvim_get_proc_children() return all child processes.

Neovim version (nvim -v)

v0.10.0-dev-c795835

Vim (not Nvim) behaves the same?

N/A

Operating system/version

linux 6.8.9-arch1-2

Terminal name/version

kitty 0.33.1

$TERM environment variable

xterm-kitty

Installation

build from repo

@altermo altermo added the bug issues reporting wrong behavior label May 14, 2024
@zeertzjq zeertzjq added api libnvim, Nvim RPC API platform:linux system labels May 14, 2024
@justinmk
Copy link
Member

/proc/pid/task/tid/children on Linux systems (most of the time) which sometimes does not contain all child processes.

So this is a Linux bug ? :) What is the alternative?

@justinmk justinmk added this to the backlog milestone May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API bug issues reporting wrong behavior platform:linux system
Projects
None yet
Development

No branches or pull requests

3 participants