Bug 147508 - Konsole leaves sockets and other file descriptors open when exec:ing the shell.
Summary: Konsole leaves sockets and other file descriptors open when exec:ing the shell.
Status: RESOLVED INTENTIONAL
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.6
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-03 20:19 UTC by Rickard Närström
Modified: 2008-06-02 07:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rickard Närström 2007-07-03 20:19:16 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 4.1.2 (Gentoo 4.1.2) 
OS:                Linux

Konsole leaves some file descriptors open... from bash running inside konsole:
----
$ ls -l /proc/$$/fd/
totalt 0
lrwx------ 1 ricce_n users 64  3 jul 20.08 0 -> /dev/pts/1
lrwx------ 1 ricce_n users 64  3 jul 20.08 1 -> /dev/pts/1
lrwx------ 1 ricce_n users 64  3 jul 20.08 11 -> socket:[4360335]
lrwx------ 1 ricce_n users 64  3 jul 20.08 12 -> socket:[4360339]
lrwx------ 1 ricce_n users 64  3 jul 20.08 13 -> socket:[4360341]
lrwx------ 1 ricce_n users 64  3 jul 20.08 2 -> /dev/pts/1
lrwx------ 1 ricce_n users 64  3 jul 20.08 255 -> /dev/pts/1
$ netstat -np | grep 4360335
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
unix  3      [ ]         STREAM     CONNECTED     4360335 25810/konsole [kdei
$ netstat -np | grep 4360339
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
unix  3      [ ]         STREAM     CONNECTED     4360339 25810/konsole [kdei
$ netstat -np | grep 4360341
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
unix  3      [ ]         STREAM     CONNECTED     4360341 25810/konsole [kdei
----
Comment 1 Robert Knight 2007-07-04 14:41:38 UTC
Hello,

The /dev/pts/X files are obviously needed for communication between
Konsole and the terminal, but I presume you are mainly talking about
the sockets?

I don't see those socket entries when I run the commands you mentioned
here.  I get the same output in Konsole and xterm as I would hope.

Can you check to see whether the output differs when running the
command in Konsole and xterm?

Regards,
Robert.

On 3 Jul 2007 18:19:17 -0000, Rickard N
Comment 2 Rickard Närström 2007-07-04 15:56:25 UTC
Den Wednesday 04 July 2007 14.41.16 skrev Robert Knight:
> Hello,
>
> The /dev/pts/X files are obviously needed for communication between
> Konsole and the terminal, but I presume you are mainly talking about
> the sockets?


Yes, I am aware of that. -- fd 255 is opened by bash itself... 0, 1 and 2 are 
for stdin, stdout and stderr.

> I don't see those socket entries when I run the commands you mentioned
> here.  I get the same output in Konsole and xterm as I would hope.
>
> Can you check to see whether the output differs when running the
> command in Konsole and xterm?


In xterm (started with ctrl+F2) there are 4 sockets owned by kdesktop (this is 
a bug in kdesktop not in konsole)
When starting xterm from a VT there is no sockets just descriptor 0, 1, 2 and 
255 is open (to /dev/pts/X).
Comment 3 Robert Knight 2008-06-02 07:47:19 UTC
> In xterm (started with ctrl+F2) there are 4 sockets owned by kdesktop (this is
> a bug in kdesktop not in konsole) 

In that case it this should be marked as a bug in kdesktop - but since that is no longer being maintained it is unlikely to be fixed.

Just about all of the code which touches files has been replaced in KDE 4 so that would be a separate bug.