Bug 254836 - krdc opens too many tcp connection to remote vnc port
Summary: krdc opens too many tcp connection to remote vnc port
Status: RESOLVED UPSTREAM
Alias: None
Product: krdc
Classification: Applications
Component: VNC (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 07:38 UTC by GGG
Modified: 2010-11-09 10:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description GGG 2010-10-21 07:38:49 UTC
Version:           unspecified (using KDE 4.5.1) 
OS:                Linux

After several connects/disconnects from KRDC to the same remote VNC session I felt that something is wrong both with server (no more X applications could be started - it reported lack of resources) and client (became slow and unresposive)

`netstat` command showed that there are literally thousand connections from my IP to the same IP:port (5901) of the server. 

Reproducible: Always

Steps to Reproduce:
1. Start KRDC
2. connect to a VNC server
3. Close the connection but don't close KRDC
4. Open the same VNC server
5. Close the VNC connection.
6. Run 
   netstat |grep 5901
7. See that there are several tcp not closed connections to port 5901 of server
8. Repeat connect/disconnect actions, wath with netstat that number of connection to port 5901 increases and never drops.

Actual Results:  
No connection is closed or dropped after VNC session tab is closed.

Expected Results:  
Only one connection should exit after a connection to VNC server is done and none if it was closed.

Of course restarting KRDC kills all the extra tcp connections.
Comment 1 Urs Wolfer 2010-10-24 20:42:56 UTC
That sounds like the VNC thread does not get killed after disconnecting. Can you reproduce this issue also with other VNC servers?
Comment 2 GGG 2010-10-24 21:00:53 UTC
The initial VNC server was TightVNC 1.3.10 on FreeBSD.

I also tried to connect with KRDC to another VNC server (RealVNC ) version 4.1.1+xorg4.3.0-37ubuntu2 - the same issue - connections get open and never closed until the KRDC's termination. So I guess this is not server-specific.
Comment 3 Urs Wolfer 2010-11-07 19:14:53 UTC
I actually can reproduce this issue.

Do you know if this issue also existed in an older version of KRDC (e.g. 4.3)?
Comment 4 Urs Wolfer 2010-11-07 19:35:57 UTC
Okay, I think I have found the issue: it's in libvncclient itself and is already fixed (but not released yet):
http://libvncserver.git.sourceforge.net/git/gitweb.cgi?p=libvncserver/libvncserver;a=blobdiff;f=libvncclient/vncviewer.c;h=752f0a75feebc6c420497d1f9976c18a682f5534;hp=498f14a7717b7fad43bdfa2e13b66c8842a22c13;hb=0e7499fb395ddfe95395bcb70836893dc4c00535;hpb=94d058b35f075cec2d6e8b6e37ee1a94086ea3f8

If you like, you can request a release of an updated version of libvncserver: http://sourceforge.net/projects/libvncserver/
If you do so, please post the task # or mailing list post here. Thanks.
Comment 5 GGG 2010-11-09 10:15:57 UTC
OK, I'll try to do that (if manage to understand how to sent a message for the SF.net project pages)
Comment 6 GGG 2010-11-09 10:24:10 UTC
As this problem is present in Ubuntu distro because of old libraries used in it, I submittted a bug in Ubuntu's tracker instead:

https://bugs.launchpad.net/ubuntu/+source/libvncserver/+bug/672937
Comment 7 GGG 2010-11-09 10:25:07 UTC
As this problem is present in Ubuntu distro because of old libraries used in it, I submittted a bug in Ubuntu's tracker instead:

https://bugs.launchpad.net/ubuntu/+source/libvncserver/+bug/672937