X2Go Bug report logs - #515
"connectedHost" variable contains wrong IP, reason unknown (was: Re: [X2Go-User] Pb with x2go agent on ppc64 system)

version graph

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

Reported by: x2go-dev@lists.x2go.org

Date: Wed, 11 Jun 2014 21:55:02 UTC

Severity: normal

Tags: pending

Found in version 3.5.0.24

Fixed in version 2:3.5.0.25

Done: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit@bugs.x2go.org (full text, mbox, reply):

Received: (at submit) by bugs.x2go.org; 11 Jun 2014 21:51:07 +0000
From newsgroups.mail2@stefanbaur.de  Wed Jun 11 23:51:05 2014
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
	ymir.das-netzwerkteam.de
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED
	autolearn=ham version=3.3.2
X-Greylist: delayed 305 seconds by postgrey-1.34 at ymir.das-netzwertkeam.de; Wed, 11 Jun 2014 23:51:05 CEST
Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187])
	by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 460005DB26
	for <submit@bugs.x2go.org>; Wed, 11 Jun 2014 23:51:05 +0200 (CEST)
Received: from [192.168.0.3] (dslb-188-105-127-189.pools.arcor-ip.net [188.105.127.189])
	by mrelayeu.kundenserver.de (node=mreue007) with ESMTP (Nemesis)
	id 0MEg2P-1WxMWE27D7-00FmwY; Wed, 11 Jun 2014 23:45:59 +0200
Message-ID: <5398CE20.4090601@stefanbaur.de>
Date: Wed, 11 Jun 2014 23:46:08 +0200
From: Stefan Baur <newsgroups.mail2@stefanbaur.de>
Reply-To: x2go-dev@lists.x2go.org
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
CC: x2go-user@lists.x2go.org, x2go-dev@lists.x2go.org, 
 submit@bugs.x2go.org, sebastien chabrolles <s.chabrolles@fr.ibm.com>
Subject: "connectedHost" variable contains wrong IP, reason unknown (was:
 Re: [X2Go-User] Pb with x2go agent on ppc64 system)
References: <OF63CDD2EA.AB0207C6-ONC1257CF4.0033135B-C1257CF4.0039D4E6@fr.ibm.com> <20140611113037.Horde.qsAKjfq9P_p1svkMBI8Mtg1@mail.das-netzwerkteam.de> <539842C3.6010208@stefanbaur.de> <20140611124358.Horde.3fgisOaRzDKMd2835Ld1uA4@mail.das-netzwerkteam.de>
In-Reply-To: <20140611124358.Horde.3fgisOaRzDKMd2835Ld1uA4@mail.das-netzwerkteam.de>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:C9uqn+JfdRtW+3eLazUADCUKCjEvDgOhfIkiakWmmWA
 /FVJF1GYEDxgM7mEcpf249AZZ3JPRWGrJIkTagoLR/9/k3fiaA
 /MXhkqAtXovkmSWdeD+R6qn5CdlYIih10sIKEye6RqmFCqkm/I
 mByK9lYSJRfXFhF6+aDpQSqiQpoI6llyhgKA7x5Z7ZLVNgRlyl
 ST1Y6my7L1vBnnd9Zm56dUZ2n66I9vBQ+hPvRsBAOsfwSheCbW
 rO68kPZ+KGQuHUIhMA9abEigCKTL/CAQyhBwigvw3Cxr/oO1so
 jnxT9KAcFAXe5TiXbOJdNr0NeicCYYuUu5E5+GmYAEqYSCDKwU
 7CINHn89BNr5kWuK+jNEzFJNnmuYPO0Enoq4c4n36
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Package: x2goagent
severity: normal
version: 3.5.0.24

Note: Crossposting and Reply-To'ing to X2Go-Dev due to the need for a
C/C++ coder, also, turning it into a bug so we can keep track of this.

Here's the output the user gets as the connection refuses to establish
itself:

quoting Sebastien Chabrolles:

> running as X2Go Agent
> 
> NXAGENT - Version 3.5.0
> 
> Copyright (C) 2001, 2011 NoMachine. See http://www.nomachine.com/
> for more information.
> 
> Info: Agent running with pid '24808'. Session: Starting session at
> 'Sat Jun  7 15:37:37 2014'. Info: Proxy running in server mode with
> pid '24808'. Info: Waiting for connection from 'localhost' on port
> '30003'. Warning: Refusing connection from '225.3.10.80'. .80' on
> port '30003'. I don't know what is this IP address !!!!!

And at a later attempt, Sebastien received this output:
> running as X2Go Agent
> 
> 
> NXAGENT - Version 3.5.0
> 
> 
> Copyright (C) 2001, 2011 NoMachine.
>  See http://www.nomachine.com/ for more information.
> 
> 
> Info: Agent running with pid '10710'.
>  Session: Starting session at 'Wed Jun 11 23:02:09 2014'.
>  Info: Proxy running in server mode with pid '10710'.
>  Info: Waiting for connection from 'localhost' on port '30006'.
>  Warning: Refusing connection from '141.168.10.80'.
>  Info: Aborting the procedure due to signal '1'.
>  Error: Aborting session with 'Unable to open display
> 'nx/nx,options=/root/.x2go/C-root-51-1402520526_stRWWWBROWSER_dp24/options:51''.
>  Session: Aborting session at 'Wed Jun 11 23:02:19 2014'.
>  Session: Session aborted at 'Wed Jun 11 23:02:19 2014'.


My first guess is/was that there's something endianess-related going
wrong, as he's running X2Go on a ppc64 architecture instead of x86/x64.
However, the fact that the two "wrong" IPs change at random speak
against that, so I may be totally wrong with this and there's a much
simpler reason and solution.

quoting myself, replying to Mike Gabriel there:

>> Do you think you could at least give him a hint as to where that 
>> message is pulling the IP from and how it is being
>> mangled/processed before that?
>> 
>> My guess is that there's some self-made conversion routine
>> somewhere that only works on little-endian architectures like x86
>> and x64.
>> 
>> PPC64 is big-endian by default.


quoting Mike Gabriel:

> you can get the nx-libs sources from git.x2go.org [1] and grep
> through the sources.
> 
> I am currently doing the same to get NX fixed on systems with 
> poly-instantiated /tmp directories.

Here's what I was able to find out so far:

I was able to locate the message in Loop.cpp.
It uses the variable "connectedHost".
So "connectedHost" contains the wrong IP.

connectedHost gets populated (also in Loop.cpp) like this:

char *connectedHost = inet_ntoa(newAddr.sin_addr);

so either newAddr.sin_addr already contains a wrong value (I'm not sure
how to check that, though), or inet_ntoa does something wrong, or both.

I haven't touched C/C++ code since the year 2002 or so, so debugging
this further is way beyond my ken.

Any one of the more experienced coders willing to jump in?


Here's some more info about the X2Go server system as provided by
Sebastien Chabrolles:

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4
localhost4.localdomain4
::1         localhost localhost.localdomain localhost6
localhost6.localdomain6
10.7.19.161     fc20-161

# cat /etc/resolv.conf
nameserver 129.35.160.4

#cat /etc/nsswitch.conf
passwd:     files
shadow:     files
group:      files
###
#this strange-looking entry was present during the first tries.
#
#hosts:      files mdns4_minimal [NOTFOUND=return] dns myhostname
#
# it was changed to the one below for the last try, which gave
# the result with the different, but still wrong, IP.
###
hosts:      files dns
bootparams: nisplus [NOTFOUND=return] files
ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files
netgroup:   files
publickey:  nisplus
automount:  files
aliases:    files nisplus

# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.7.19.161  netmask 255.255.255.0  broadcast 10.7.19.255

        inet6 fe80::f816:3eff:feec:ecb8  prefixlen 64  scopeid
0x20<link>
        ether fa:16:3e:ec:ec:b8  txqueuelen 1000  (Ethernet)

        RX packets 90677  bytes 5717673 (5.4 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 89102  bytes 32828059 (31.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 76  bytes 5248 (5.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 76  bytes 5248 (5.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref
Use Iface
0.0.0.0         10.7.19.254     0.0.0.0         UG    0      0
0 eth0
10.7.19.0       0.0.0.0         255.255.255.0   U     0      0
0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0
0 eth0


- -Stefan


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTmM4gAAoJEG7d9BjNvlEZ1MYH/0X8PNPuZUCxkhkUGndLFaez
O0fARZVEa8VWby4jMWUlujgux3lxzcEU1MJ5JluduoTgPwWXUrqlouymEqX1eUqX
AnO4W2OKUiOdHEvj89zWFFQIuL8msBdnfJqC1CE1Z7MZ45vA94eztZ8E1wpwtgRd
jJq4pa9sR4iz20CamAhWNbu75pBdxGxMYf1KtQFkFOo1kL7RiPA0Z/dNZspeVI3A
zVT8CwvnRe+SY3RczOZvlkgXK2CWFaOsATt44hK752ky8v9JCo90wchFrXC++v8r
OBtZDOlG5h7aq25VZjP/YWOdTLIyIyGE+tgNDaN+D1Ip+Y/uDFbTGtcMCLx29d0=
=ii4y
-----END PGP SIGNATURE-----


Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Wed Dec 4 08:40:14 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.