#1070807 konsole: Konsole did not close redundant FDs when creating shell process in terminal session

Package:
konsole
Source:
konsole
Description:
X terminal emulator
Submitter:
anthony
Date:
2024-05-10 05:21:03 UTC
Severity:
normal
#1070807#5
Date:
2024-05-09 14:11:48 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?
   The terminal did not close redundant FDs when creating shell process.
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   The shell process has many unexpected redundant FDs, and those FDs
   were inherit from konsole.
   * What outcome did you expect instead?
   The terminal emulator should not leave any redundant FDs for shell
   process.

   Today I found my Zsh comes with 157 FDs, in common sense zsh won't
   create such large amount open files. Then I tried command
   'konsole -e /bin/sleep 10000', even through, the sleep process also
   has 100+ FDs that shouldn't exists.

   By comparing the FDs' number, those FDs were inherit from konsole.

   I thought you may close redundant FDs before creating shell process,
   or use CLOEXEC flag.


   This is my test output in konsole:
   % uname -r
   6.1.27.xeon.ll
   % ls /proc/self/fd | wc -l
   157
   % ls /proc/$PPID/fd | wc -l
   179
   % cat /proc/$PPID/cmdline| tr '\0' ' '
   /usr/bin/konsole --new-tab
   %

#1070807#10
Date:
2024-05-10 05:19:03 UTC
From:
To:
Dear Maintainer,

This may not be Konsole's bug.

By deep dive into the problem, I found those redundant FDs were coming from
kwin_wayland, the wayland implementation of KWin. Today I tried to start a
Konsole Terminal in another desktop environment rather than KDE Plasma, and
the redundant FDs problem did not reproduce this time.

So you may close this bug ticket.

So this
LANGUAGE=en_US:en