Node.js can become unkillable even with kill -9
on Linux 6.1.113 or 6.6.57
#355567
Labels
0.kind: bug
Something is broken
2.status: duplicate
This is a duplicate of another issue or PR
6.topic: kernel
The Linux kernel
6.topic: nodejs
Describe the bug
A Node.js program can get stuck after running for a while.
Only reproduceable on Linux kernel 6.1.113 or 6.6.57 (or later versions of 6.1 or 6.6).
Steps To Reproduce
Warning
If you reproduce the bug, your computer cannot be shut down normally because the unkillable process prevents it.
In
configuration.nix
, set the kernel version to 6.1 or 6.6:Also, install the
node
package by adding it to eitherusers.users.xxx.packages
orenvironment.systemPackages
.Set the root nixpkgs to a rev no earlier than f142a76 (if using Linux 6.6) or 0dffe83 (if using Linux 6.1) (they are the exact first bad commits that I found by bisecting nixpkgs). You can do this by running
(or by simply upgrading to the latest nixos-24.05).
Reboot. Run
uname --kernel-release
and check that kernel version satisfies6.1.113 <= version < 6.2 || 6.6.57 <= version < 6.7
.Run the following command (the Node.js version is 20.15.1, but I think it should be reproduceable with any Node.js 20.x):
Wait for a while until it outputs around 100 numbers or more.
Hit Ctrl+C to try to stop it. If it cannot be killed this way, you reproduce the bug. It is unkillable even with
kill -9
if you try that.Expected behavior
The process gets killed by Ctrl+C.
Additional context
I first talked about this symptom in #351774 (comment).
I thought this is an upstream bug of arRPC, so I opened OpenAsar/arrpc#120. There are some people commenting in that issue saying that they experience the same problem and that they all use NixOS. Therefore, I thought this may be a bug that only affects NixOS.
I tried to reproduce the bug on Arch Linux VM (installing the kernel via the package linux-lts), and it was not reproduced.
I then read the source code of arRPC and tried to find a short program that can reproduce this bug. The
node
command pasted above is the reproducing command that I found.Notify maintainers
Metadata
"x86_64-linux"
Linux 6.6.59, NixOS, 24.05 (Uakari), 24.05.6258.dba414932936
yes
yes
nix-env (Nix) 2.18.8
"nixos-24.05, nixos-hardware, nixos-unstable"
/nix/var/nix/profiles/per-user/root/channels/nixos
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: