Start konsole from the start menu. In the shell run: $ lsof -p $$ | grep inotify bash 4183 test 21r a_inode 0,14 0 10036 inotify $ lsof -p $(pidof konsole) | grep inotify konsole 4171 test 9r a_inode 0,14 0 10036 inotify konsole 4171 test 21r a_inode 0,14 0 10036 inotify $ lsof -p $(pidof plasmashell) | grep inotify plasmashe 3594 test 9r a_inode 0,14 0 10036 inotify plasmashe 3594 test 18r a_inode 0,14 0 10036 inotify plasmashe 3594 test 21r a_inode 0,14 0 10036 inotify
This also happens when konsole is started from krunner.
I can confirm this bug on both Debian 12 and Arch Linux, where it looks like the following: $ ls -l /proc/$$/fd/ total 0 lrwx------ 1 colo colo 64 1. Nov 13:37 0 -> /dev/pts/3 lrwx------ 1 colo colo 64 1. Nov 13:37 1 -> /dev/pts/3 lrwx------ 1 colo colo 64 1. Nov 13:37 2 -> /dev/pts/3 lr-x------ 1 colo colo 64 1. Nov 13:37 24 -> anon_inode:inotify lrwx------ 1 colo colo 64 1. Nov 13:37 255 -> /dev/pts/3 $ pstree -s -p $$ systemd(1)───systemd(616)───plasmashell(754)───konsole(60566)───bash(60581)───pstree(61213) $ ls -l /proc/60566/fd/24 lr-x------ 1 colo colo 64 1. Nov 14:02 /proc/60566/fd/24 -> anon_inode:inotify $ ls -l /proc/754/fd/24 lr-x------ 1 colo colo 64 1. Nov 14:02 /proc/754/fd/24 -> anon_inode:inotify $ sudo ls -l /proc/616/fd/24 lrwx------ 1 colo colo 64 1. Nov 14:03 /proc/616/fd/24 -> 'socket:[18811]' I stumbled over this because the fd broke another project's test suite I was running in my Konsole-spawned shell.
I cannot reproduce on my Plasma 6 setup.
I think it's here: https://github.com/libimobiledevice/libusbmuxd/blob/master/src/libusbmuxd.c I can't see a fcntl(inot_fd, F_SETFD, FD_CLOEXEC); Will try to build locally to confirm
regardless it should really use inotify_init1 which allows setting FD_CLOEXEC without race FWIW
https://github.com/libimobiledevice/libusbmuxd/pull/133 If you are able to confirm this fixes the leak that would be appreciated
With that patch the leak is gone.
Thanks for confirming