Subject: slot argument mismatch in ONMainWindow::slotTunnelOk causes hang during connect

From: Will Wagner <[email-masked]>
Date: Fri, 06 Mar 2015 11:23:46 +0000

Package: x2goclient
Version: 4.0.3.2

When trying to connect to certain servers I get 'Object::connect: No 
such slot ONMainWindow::slotTunnelOk()' in the debugging output of X2Go 
Client for Windows 4.0.3.2. The application hangs without ever connecting.

 From looking at the code in ONMainWindow::slotTunnelOk() it has a check 
to see if winServersReady is true and if not it uses QTimer::singleShot 
to retry 100mS later. However the slot connection has an argument 
mismatch and so slotTunnelOk is never called again and this leads to the 
hang.

The full debug output is:
x2go-INFO-1> "Starting x2goclient..."
x2go-WARNING-1> "Can't load translator: :/x2goclient_en_gb"
x2go-WARNING-2> "Can't load translator: :/qt_en_GB"
x2go-DEBUG-onmainwindow.cpp:1208> Removing apps from tray
x2go-DEBUG-onmainwindow.cpp:1176> Plugging apps in tray.
x2go-DEBUG-onmainwindow.cpp:9817> Getting Xorg settings.
x2go-INFO-3> "Started  x2goclient."
x2go-DEBUG-onmainwindow.cpp:495> "$HOME=C:/Users/willw"
x2go-DEBUG-onmainwindow.cpp:2123> Reading 4 sessions from config file.
x2go-DEBUG-onmainwindow.cpp:9543> Starting win servers...
x2go-DEBUG-onmainwindow.cpp:9895> "C:/Users/willw/.x2go/etc/sshd_config 
created."
x2go-DEBUG-onmainwindow.cpp:9312> got localhost
x2go-DEBUG-onmainwindow.cpp:9334> Port is free: 7022
x2go-DEBUG-onmainwindow.cpp:9951> Creating desktop: x2go_willw
x2go-DEBUG-onmainwindow.cpp:1208> Removing apps from tray
x2go-INFO-8> "Starting connection to server: 172.20.0.2:22"
x2go-DEBUG-onmainwindow.cpp:2702> Start new ssh connection to 
server:"172.20.0.2":"22" krbLogin: false
x2go-DEBUG-sshmasterconnection.cpp:202> starting ssh connection without 
kerberos authentication

x2go-DEBUG-sshmasterconnection.cpp:206> SshMasterConnection, instance 
SshMasterConnection(0x15a8d58)  created
x2go-DEBUG-sshmasterconnection.cpp:442> SshMasterConnection, instance 
SshMasterConnection(0x15a8d58)  entering thread
x2go-DEBUG-sshmasterconnection.cpp:478> libSsh not inited yet, initting

x2go-DEBUG-sshmasterconnection.cpp:522> setting SSH DIR to 
"C:/Users/willw/ssh"
x2go-DEBUG-sshmasterconnection.cpp:789> cserverAuth

x2go-DEBUG-sshmasterconnection.cpp:804> state: 1

x2go-DEBUG-sshmasterconnection.cpp:640> setting SSH DIR to 
"C:/Users/willw/ssh"
x2go-DEBUG-sshmasterconnection.cpp:963> Password authentication

x2go-DEBUG-sshmasterconnection.cpp:654> user auth OK

x2go-DEBUG-onmainwindow.cpp:2797> SSH connection established.
x2go-DEBUG-onmainwindow.cpp:3060> Continue normal x2go session
x2go-DEBUG-sshprocess.cpp:189> executing remote command via SshProcess 
object (0): "export HOSTNAME && x2golistsessions"

x2go-DEBUG-sshmasterconnection.cpp:1434> creating new channel

x2go-DEBUG-sshmasterconnection.cpp:1438> new channel:0x37196b0

x2go-DEBUG-sshmasterconnection.cpp:1469> executing remote: "sh -c 'echo 
X2GODATABEGIN:819aa939-7479-4d86-bbeb-8c9e041031a8; 
PATH=/usr/local/bin:/usr/bin:/bin export HOSTNAME && x2golistsessions; 
echo X2GODATAEND:819aa939-7479-4d86-bbeb-8c9e041031a8;'"

x2go-DEBUG-sshmasterconnection.cpp:1492>  new exec channel created

x2go-DEBUG-sshmasterconnection.cpp:1541> EOF ON CHANNEL 0x37196b0 
(SshProcess: 0)

x2go-DEBUG-sshmasterconnection.cpp:1664> eof sent

x2go-DEBUG-sshmasterconnection.cpp:1668> channel closed

x2go-DEBUG-sshprocess.cpp:449> ssh finished: true - 
"39358|willw-50-1425634735_stDXFCE_dp32|50|waldorf2|S|2015-03-06T09:38:55|b7d8a7118d17318a0f0f5d435a497f0a|172.20.1.8|30001|30002|2015-03-06T09:41:52|willw|267|30003|
" (0).

x2go-DEBUG-onmainwindow.cpp:3404> 
"39358|willw-50-1425634735_stDXFCE_dp32|50|waldorf2|S|2015-03-06T09:38:55|b7d8a7118d17318a0f0f5d435a497f0a|172.20.1.8|30001|30002|2015-03-06T09:41:52|willw|267|30003|
"
x2go-DEBUG-onmainwindow.cpp:1208> Removing apps from tray
x2go-DEBUG-onmainwindow.cpp:1208> Removing apps from tray
x2go-DEBUG-onmainwindow.cpp:9312> got localhost
x2go-DEBUG-onmainwindow.cpp:9334> Port is free: 6000
x2go-DEBUG-onmainwindow.cpp:9400> using internal X: true
x2go-DEBUG-onmainwindow.cpp:9423> WxH:"1024"x"768"
x2go-DEBUG-onmainwindow.cpp:9428> "-multiwindow -notrayicon -clipboard"
x2go-DEBUG-onmainwindow.cpp:9465> Running "C:/Program Files 
(x86)/x2goclient\vcxsrv\vcxsrv.exe" "-multiwindow -notrayicon -clipboard :0"
x2go-DEBUG-sshprocess.cpp:189> executing remote command via SshProcess 
object (1): "x2goresume-session willw-50-1425634735_stDXFCE_dp32 
1024x768 adsl 16m-jpeg-9 us auto 1 both"

x2go-DEBUG-sshmasterconnection.cpp:1434> creating new channel

x2go-DEBUG-sshmasterconnection.cpp:1438> new channel:0x37197b8

x2go-DEBUG-sshmasterconnection.cpp:1469> executing remote: "sh -c 'echo 
X2GODATABEGIN:67634731-3df8-4974-af0a-1f3568ca4bdb; 
PATH=/usr/local/bin:/usr/bin:/bin x2goresume-session 
willw-50-1425634735_stDXFCE_dp32 1024x768 adsl 16m-jpeg-9 us auto 1 
both; echo X2GODATAEND:67634731-3df8-4974-af0a-1f3568ca4bdb;'"

x2go-DEBUG-sshmasterconnection.cpp:1492>  new exec channel created

x2go-DEBUG-sshmasterconnection.cpp:1596> EOF ON CHANNEL 0x37197b8 
(SshProcess: 1)

x2go-DEBUG-sshmasterconnection.cpp:1664> eof sent

x2go-DEBUG-sshmasterconnection.cpp:1668> channel closed

x2go-DEBUG-sshprocess.cpp:449> ssh finished: true - "gr_port=30001
sound_port=30002
fs_port=30003
" (1).

x2go-DEBUG-onmainwindow.cpp:4727> Agent output: "gr_port=30001
sound_port=30002
fs_port=30003
"
x2go-DEBUG-onmainwindow.cpp:4905> New gr_port: "30001"
x2go-DEBUG-onmainwindow.cpp:4912> New sound_port: "30002"
x2go-DEBUG-onmainwindow.cpp:4919> New fs_port: "30003"
x2go-DEBUG-onmainwindow.cpp:9312> got localhost
x2go-DEBUG-onmainwindow.cpp:9334> Port is free: 31001
x2go-DEBUG-sshprocess.cpp:294> Starting tunnel via SshProcess object 
(2): "localhost":30001 -> "localhost":31001

x2go-DEBUG-onmainwindow.cpp:5172> Waiting for win-servers.
Object::connect: No such slot ONMainWindow::slotTunnelOk()
x2go-DEBUG-sshprocess.cpp:157> Direct tunnel: waiting for connections on 
"localhost":31001

x2go-DEBUG-onmainwindow.cpp:9312> got localhost
x2go-DEBUG-onmainwindow.cpp:9340> Port already used: 6000
x2go-DEBUG-onmainwindow.cpp:9494> X is started.
x2go-DEBUG-onmainwindow.cpp:9861> All winservers are started.

---

From: Mihai Moldovan <[email-masked]>
Date: Sat, 07 Mar 2015 03:09:31 +0100

On 06.03.2015 12:23 PM, Will Wagner wrote:
> such slot ONMainWindow::slotTunnelOk()' in the debugging output of
> X2Go Client for Windows 4.0.3.2. The application hangs without ever
> connecting.
>
> From looking at the code in ONMainWindow::slotTunnelOk() it has a
> check to see if winServersReady is true and if not it uses
> QTimer::singleShot to retry 100mS later. However the slot connection
> has an argument mismatch and so slotTunnelOk is never called again and
> this leads to the hang.

Can you please test
http://code.x2go.org/releases/binary-win32/x2goclient/tmp/x2goclient-4.0.4.0-2015.03.07-982268a-setup.exe?

Mihai

---

From: Will Wagner <[email-masked]>
Date: Mon, 09 Mar 2015 12:29:02 +0000

> http://code.x2go.org/releases/binary-win32/x2goclient/tmp/x2goclient-4.0.4.0-2015.03.07-982268a-setup.exe?

I get a access forbidden message when I try to download that URL

Regards
Will

-- 
------------------------------------------------------------------------
Will Wagner                                     [email-masked]
Development Manager                      Office Tel: +44 (0)20 7471 9224
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------

---

From: Will Wagner <[email-masked]>
Date: Mon, 09 Mar 2015 19:45:53 +0000

> http://code.x2go.org/releases/binary-win32/x2goclient/tmp/x2goclient-4.0.4.0-2015.03.07-982268a-setup.exe?

This build appears to fix the issue, I have done 20+ successful session 
resumes.

Thanks
Will

---

From: Mihai Moldovan <[email-masked]>
Date: Mon, 09 Mar 2015 20:50:05 +0100

On 09.03.2015 08:45 PM, Will Wagner wrote:
> This build appears to fix the issue, I have done 20+ successful
> session resumes.

Thanks for testing!

The fix is part of my bugfix/general branch and will be merged into
master once I finish fixing another bug.

In any case, it will be part of x2goclient's next release.

Mihai

---

From: Will Wagner <[email-masked]>
Date: Tue, 10 Mar 2015 10:43:35 +0000

> In any case, it will be part of x2goclient's next release.

So today I can unfortunately still reproduce this issue. It seems like 
yesterday there must have been something going on with my network which 
altered the timing of events.

The debug log I get now is:
x2go-INFO-1> "Starting x2goclient..."
x2go-WARNING-1> "Can't load translator: :/x2goclient_en_gb"
x2go-WARNING-2> "Can't load translator: :/qt_en_GB"
x2go-DEBUG-../src/onmainwindow.cpp:1208> Removing apps from tray
x2go-DEBUG-../src/onmainwindow.cpp:1176> Plugging apps in tray.
x2go-DEBUG-../src/onmainwindow.cpp:9821> Getting Xorg settings.
x2go-INFO-3> "Started  x2goclient."
x2go-DEBUG-../src/onmainwindow.cpp:495> "$HOME=C:/Users/willw"
x2go-DEBUG-../src/onmainwindow.cpp:2123> Reading 4 sessions from config 
file.
x2go-DEBUG-../src/sessionbutton.cpp:319> creating QPixmap with session 
icon: '":/img/icons/128x128/x2gosession.png"'.
x2go-DEBUG-../src/sessionbutton.cpp:319> creating QPixmap with session 
icon: '"C/:/Users/willw/Documents/scooter.jpg"'.
QPixmap::scaled: Pixmap is a null pixmap
x2go-DEBUG-../src/sessionbutton.cpp:319> creating QPixmap with session 
icon: '"C/:/Users/willw/Documents/waldorf.jpg"'.
QPixmap::scaled: Pixmap is a null pixmap
x2go-DEBUG-../src/sessionbutton.cpp:319> creating QPixmap with session 
icon: '"C/:/Users/willw/Documents/animal.jpg"'.
QPixmap::scaled: Pixmap is a null pixmap
x2go-DEBUG-../src/onmainwindow.cpp:9547> Starting win servers...
x2go-DEBUG-../src/onmainwindow.cpp:9899> 
"C:/Users/willw/.x2go/etc/sshd_config created."
x2go-DEBUG-../src/onmainwindow.cpp:9316> got localhost
x2go-DEBUG-../src/onmainwindow.cpp:2601> creating QPixmap with session 
icon: '"C/:/Users/willw/Documents/animal.jpg"'.
QPixmap::scaled: Pixmap is a null pixmap
x2go-DEBUG-../src/onmainwindow.cpp:9338> Port is free: 7022
x2go-DEBUG-../src/onmainwindow.cpp:9955> Creating desktop: x2go_willw
x2go-DEBUG-../src/onmainwindow.cpp:1208> Removing apps from tray
x2go-INFO-8> "Starting connection to server: animal.office.carallon.com:22"
x2go-DEBUG-../src/onmainwindow.cpp:2702> Start new ssh connection to 
server:"animal.office.carallon.com":"22" krbLogin: false
x2go-DEBUG-../src/sshmasterconnection.cpp:202> starting ssh connection 
without kerberos authentication

x2go-DEBUG-../src/sshmasterconnection.cpp:206> SshMasterConnection, 
instance SshMasterConnection(0x35673f8)  created
x2go-DEBUG-../src/sshmasterconnection.cpp:442> SshMasterConnection, 
instance SshMasterConnection(0x35673f8)  entering thread
x2go-DEBUG-../src/sshmasterconnection.cpp:478> libSsh not inited yet, 
initting

x2go-DEBUG-../src/sshmasterconnection.cpp:522> setting SSH DIR to 
"C:/Users/willw/ssh"
x2go-DEBUG-../src/sshmasterconnection.cpp:789> cserverAuth

x2go-DEBUG-../src/sshmasterconnection.cpp:804> state: 1

x2go-DEBUG-../src/sshmasterconnection.cpp:640> setting SSH DIR to 
"C:/Users/willw/ssh"
x2go-DEBUG-../src/sshmasterconnection.cpp:963> Password authentication

x2go-DEBUG-../src/sshmasterconnection.cpp:654> user auth OK

x2go-DEBUG-../src/onmainwindow.cpp:2797> SSH connection established.
x2go-DEBUG-../src/onmainwindow.cpp:3064> Continue normal x2go session
x2go-DEBUG-../src/sshprocess.cpp:189> executing remote command via 
SshProcess object (0): "export HOSTNAME && x2golistsessions"

x2go-DEBUG-../src/sshprocess.cpp:194> running 
masterCon->addChannelConnection(this, 
'"aaa08901-5dfe-4de4-9ef2-00b12e2a8e43"', '"sh -c 'echo 
X2GODATABEGIN:aaa08901-5dfe-4de4-9ef2-00b12e2a8e43; 
PATH=/usr/local/bin:/usr/bin:/bin export HOSTNAME && x2golistsessions; 
echo X2GODATAEND:aaa08901-5dfe-4de4-9ef2-00b12e2a8e43;'"');
x2go-DEBUG-../src/sshmasterconnection.cpp:1245> locking SSH channel 
connection MUTEX.
x2go-DEBUG-../src/sshmasterconnection.cpp:1247> passing con to 
channelConnections.
x2go-DEBUG-../src/sshmasterconnection.cpp:1249> unlocking SSH channel 
connection MUTEX.
x2go-DEBUG-../src/sshmasterconnection.cpp:1437> creating new channel

x2go-DEBUG-../src/sshmasterconnection.cpp:1441> new channel:0x35c6608

x2go-DEBUG-../src/sshmasterconnection.cpp:1472> executing remote: "sh -c 
'echo X2GODATABEGIN:aaa08901-5dfe-4de4-9ef2-00b12e2a8e43; 
PATH=/usr/local/bin:/usr/bin:/bin export HOSTNAME && x2golistsessions; 
echo X2GODATAEND:aaa08901-5dfe-4de4-9ef2-00b12e2a8e43;'"

x2go-DEBUG-../src/sshmasterconnection.cpp:1495>  new exec channel created

x2go-DEBUG-../src/sshmasterconnection.cpp:1599> EOF ON CHANNEL 0x35c6608 
(SshProcess: 0)

x2go-DEBUG-../src/sshmasterconnection.cpp:1667> eof sent

x2go-DEBUG-../src/sshmasterconnection.cpp:1671> channel closed

x2go-DEBUG-../src/sshprocess.cpp:450> ssh finished: true - 
"3250|willw-51-1425923107_stDXFCE_dp32|51|animal|S|2015-03-09T17:45:07|bbdb13440494d0f6823c0b35b8f37d85|172.20.1.8|30004|30005|2015-03-10T10:38:37|willw|60814|30006|
" (0).

x2go-DEBUG-../src/onmainwindow.cpp:3408> 
"3250|willw-51-1425923107_stDXFCE_dp32|51|animal|S|2015-03-09T17:45:07|bbdb13440494d0f6823c0b35b8f37d85|172.20.1.8|30004|30005|2015-03-10T10:38:37|willw|60814|30006|
"
x2go-DEBUG-../src/onmainwindow.cpp:1208> Removing apps from tray
x2go-DEBUG-../src/onmainwindow.cpp:1208> Removing apps from tray
x2go-DEBUG-../src/onmainwindow.cpp:9316> got localhost
x2go-DEBUG-../src/onmainwindow.cpp:9344> Port already used: 6000
x2go-DEBUG-../src/onmainwindow.cpp:9316> got localhost
x2go-DEBUG-../src/onmainwindow.cpp:9338> Port is free: 6001
x2go-DEBUG-../src/onmainwindow.cpp:9404> using internal X: true
x2go-DEBUG-../src/onmainwindow.cpp:9427> WxH:"1280"x"1024"
x2go-DEBUG-../src/onmainwindow.cpp:9432> "-multiwindow -notrayicon 
-clipboard"
x2go-DEBUG-../src/onmainwindow.cpp:9469> Running "C:/Program Files 
(x86)/x2goclient\vcxsrv\vcxsrv.exe" "-multiwindow -notrayicon -clipboard :1"
x2go-DEBUG-../src/sshprocess.cpp:189> executing remote command via 
SshProcess object (1): "x2goresume-session 
willw-51-1425923107_stDXFCE_dp32 1280x1024 adsl 16m-jpeg-9 us auto 1 both"

x2go-DEBUG-../src/sshprocess.cpp:194> running 
masterCon->addChannelConnection(this, 
'"40720929-3f5e-46de-a282-dd035a1add5c"', '"sh -c 'echo 
X2GODATABEGIN:40720929-3f5e-46de-a282-dd035a1add5c; 
PATH=/usr/local/bin:/usr/bin:/bin x2goresume-session 
willw-51-1425923107_stDXFCE_dp32 1280x1024 adsl 16m-jpeg-9 us auto 1 
both; echo X2G"');
x2go-DEBUG-../src/sshmasterconnection.cpp:1245> locking SSH channel 
connection MUTEX.
x2go-DEBUG-../src/sshmasterconnection.cpp:1247> passing con to 
channelConnections.
x2go-DEBUG-../src/sshmasterconnection.cpp:1249> unlocking SSH channel 
connection MUTEX.
x2go-DEBUG-../src/sshmasterconnection.cpp:1437> creating new channel

x2go-DEBUG-../src/sshmasterconnection.cpp:1441> new channel:0x35c6710

x2go-DEBUG-../src/sshmasterconnection.cpp:1472> executing remote: "sh -c 
'echo X2GODATABEGIN:40720929-3f5e-46de-a282-dd035a1add5c; 
PATH=/usr/local/bin:/usr/bin:/bin x2goresume-session 
willw-51-1425923107_stDXFCE_dp32 1280x1024 adsl 16m-jpeg-9 us auto 1 
both; echo X2GODATAEND:40720929-3f5e-46de-a282-dd035a1add5c;'"

x2go-DEBUG-../src/sshmasterconnection.cpp:1495>  new exec channel created

x2go-DEBUG-../src/sshmasterconnection.cpp:1544> EOF ON CHANNEL 0x35c6710 
(SshProcess: 1)

x2go-DEBUG-../src/sshmasterconnection.cpp:1667> eof sent

x2go-DEBUG-../src/sshmasterconnection.cpp:1671> channel closed

x2go-DEBUG-../src/sshprocess.cpp:450> ssh finished: true - "gr_port=30004
sound_port=30005
fs_port=30006
" (1).

x2go-DEBUG-../src/onmainwindow.cpp:4731> Agent output: "gr_port=30004
sound_port=30005
fs_port=30006
"
x2go-DEBUG-../src/onmainwindow.cpp:4909> New gr_port: "30004"
x2go-DEBUG-../src/onmainwindow.cpp:4916> New sound_port: "30005"
x2go-DEBUG-../src/onmainwindow.cpp:4923> New fs_port: "30006"
x2go-DEBUG-../src/onmainwindow.cpp:9316> got localhost
x2go-DEBUG-../src/onmainwindow.cpp:9338> Port is free: 31004
x2go-DEBUG-../src/sshprocess.cpp:295> Starting tunnel via SshProcess 
object (2): "localhost":30004 -> "localhost":31004

x2go-DEBUG-../src/onmainwindow.cpp:5176> Waiting for win-servers.
QObject::connect: Incompatible sender/receiver arguments
         QSingleShotTimer::timeout() --> ONMainWindow::slotTunnelOk(int)
x2go-DEBUG-../src/sshprocess.cpp:157> Direct tunnel: waiting for 
connections on "localhost":31004

x2go-DEBUG-../src/onmainwindow.cpp:9316> got localhost
x2go-DEBUG-../src/onmainwindow.cpp:9344> Port already used: 6001
x2go-DEBUG-../src/onmainwindow.cpp:9498> X is started.
x2go-DEBUG-../src/onmainwindow.cpp:9865> All winservers are started.

Looking at the change you made I don't believe you are allowed to 
connect a signal emitting no arguments to a slot that requires an 
argument and hence the incompatible sender/receiver argument error.

Regards
Will

---

From: Mihai Moldovan <[email-masked]>
Date: Tue, 10 Mar 2015 17:22:28 +0100

On 10.03.2015 11:43 AM, Will Wagner wrote:
> So today I can unfortunately still reproduce this issue. It seems
> like yesterday there must have been something going on with my
> network which altered the timing of events.

Btw, I think this has nothing to do with the network. On Windows, Xorg
(and sshd) must be started whenever X2Go Client starts up, so if you
start X2Go Client and connect to a session *fast enough* after startup,
you can trigger this race condition.

> The debug log I get now is: [...]

Yes. The problem at hand is that this parameter is purely optional
anyway and never used.

I totally missed that "this" in that context does not refer to
slotTunnelOk(int) but QSingleShotTimer::timeout(), which has no parameter.

http://code.x2go.org/releases/binary-win32/x2goclient/tmp/x2goclient-4.0.4.0-2015.03.10-ffc56f3-setup.exe

Mihai

---

From: Will Wagner <[email-masked]>
Date: Thu, 12 Mar 2015 13:09:41 +0000

> http://code.x2go.org/releases/binary-win32/x2goclient/tmp/x2goclient-4.0.4.0-2015.03.10-ffc56f3-setup.exe

Have test repeatedly and I can't make it go wrong any more. Thanks for 
fixing this.

Regards
Will

---

From: Mihai Moldovan <[email-masked]>
Date: Thu, 12 Mar 2015 14:21:52 +0100

On 12.03.2015 02:09 PM, Will Wagner wrote:
>> [URL]

Thank you for getting back!

I have merged the fix-fix into our master branch.

Mihai