X2Go Bug report logs - #806
connection fails with error binding localhost:XXX when creating new session

version graph

Package: x2goclient; Maintainer for x2goclient is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2goclient is src:x2goclient.

Reported by: Jason Alavaliant <alavaliant@ra09.com>

Date: Sat, 7 Mar 2015 02:30:02 UTC

Severity: important

Found in version 4.0.3.2

Full log


🔗 View this message in rfc822 format

X-Loop: owner@bugs.x2go.org
Subject: Bug#806: connection fails with error binding localhost:XXX when creating new session
Reply-To: Jason Alavaliant <alavaliant@ra09.com>, 806@bugs.x2go.org
Resent-From: Jason Alavaliant <alavaliant@ra09.com>
Resent-To: x2go-dev@lists.x2go.org
Resent-CC: X2Go Developers <x2go-dev@lists.x2go.org>
X-Loop: owner@bugs.x2go.org
Resent-Date: Sat, 07 Mar 2015 02:30:02 +0000
Resent-Message-ID: <handler.806.B.142569534627830@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 806
X-X2Go-PR-Package: x2goclient
X-X2Go-PR-Keywords: 
Received: via spool by submit@bugs.x2go.org id=B.142569534627830
          (code B); Sat, 07 Mar 2015 02:30:02 +0000
Received: (at submit) by bugs.x2go.org; 7 Mar 2015 02:29:06 +0000
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=ham
	version=3.3.2
Received: from thetower.ra09.com (ra09.com [202.124.104.240])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 3ACB95E156
	for <submit@bugs.x2go.org>; Sat,  7 Mar 2015 03:29:04 +0100 (CET)
Received: from localhost ([127.0.0.1] helo=private.ra09.com)
	by thetower.ra09.com with esmtp (Exim 4.80)
	(envelope-from <alavaliant@ra09.com>)
	id 1YU4U7-0002jj-TB
	for submit@bugs.x2go.org; Sat, 07 Mar 2015 15:29:00 +1300
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Sat, 07 Mar 2015 15:28:59 +1300
From: Jason Alavaliant <alavaliant@ra09.com>
To: submit@bugs.x2go.org
Message-ID: <cd3e51f3aa4efef71477213e69028753@private.ra09.com>
X-Sender: alavaliant@ra09.com
User-Agent: Roundcube Webmail/1.0.5
Package: x2goclient
Version: 4.0.3.2
Severity: important

All clients trying to create a new sessions on my x2go broker setup 
started failing with the error message

Unable to create ssl tunnel:
Error binding localhost:XXX

and in each case the XXX was a port number lower than 1024


Digging through the client code and looking at the shared session 
database on the backend as far as I can tell the issue is;

1) the session database port numbers have reached values of 65000 and 
greater (for example on the last session I created the database gr_port 
was 65087)

2) the client gets given that data and adds 1000 to it 
(onmainwindows.cpp line "int iport=localGraphicPort.toInt() + 1000;")

3) the resulting port number is over the highest valid port number of 
65535 and hence later on when it is used the value overflows around to 
be port 552

4) ports under 1024 are reserved on Unix and can't be used by normal 
user processes and hence the error and the connection failing.


For now I've worked around the issue by patching the client 
onmainwindows.cpp section under the "int iport=localGraphicPort.toInt() 
+ 1000;" line to add to the various checks an extra check that sees in 
the value is over 65535 and if so to subtract 63382 which causes the 
port value to end up above the 1024 range.        I don't think this is 
a complete fix however since it only covers gr_port (which broke first 
since it gets 1000 added to it which doesn't seem to occur for 
sound_port and fs_port?) and I'm not sure if I what direction I should 
be looking at fixing this in order to make a patch that will be accepted 
upstream.

I'm suspecting this might actually be considered an bug with the 
x2goserver database code (it shouldn't set port so high?)   so I'm 
hoping you can advise on where I should be concentrating on fixing the 
code.       I'm not sure if you'll think it should be patched both in 
the client and in the server code   or if it should only be checked for 
in the server code?

Thanks
Jason

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Thu Nov 21 15:42:00 2024; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.