From unknown Tue May 19 05:30:28 2026
X-Loop: owner@bugs.x2go.org
Subject: Bug#187: Destroying SshMasterConnection off the main thread leads to a diagnostic from Qt debug libs
Reply-To: Gary Kratkin <gary@surfcrew.com>, 187@bugs.x2go.org
Resent-From: Gary Kratkin <gary@surfcrew.com>
Resent-To: x2go-dev@lists.berlios.de
Resent-CC: X2Go Developers <x2go-dev@lists.berlios.de>
X-Loop: owner@bugs.x2go.org
Resent-Date: Tue, 23 Apr 2013 19:18:01 +0000
Resent-Message-ID: <handler.187.B.136674452525103@bugs.x2go.org>
Resent-Sender: owner@bugs.x2go.org
X-X2Go-PR-Message: report 187
X-X2Go-PR-Package: x2goclient
X-X2Go-PR-Keywords: 
Received: via spool by submit@bugs.x2go.org id=B.136674452525103
          (code B); Tue, 23 Apr 2013 19:18:01 +0000
Received: (at submit) by bugs.x2go.org; 23 Apr 2013 19:15:25 +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.3 required=5.0 tests=HTML_MESSAGE,MANY_SPAN_IN_TEXT,
	RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2
Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182])
	by ymir (Postfix) with ESMTPS id 7175B5DB20
	for <submit@bugs.x2go.org>; Tue, 23 Apr 2013 21:15:24 +0200 (CEST)
Received: by mail-gg0-f182.google.com with SMTP id u2so141112ggn.27
        for <submit@bugs.x2go.org>; Tue, 23 Apr 2013 12:15:23 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-received:from:content-type:subject:message-id:date:to
         :mime-version:x-mailer:x-gm-message-state;
        bh=FHVuT1veQTtO0sYBVfcxlolU2SBaCOUPz22XW00fDLc=;
        b=ItzYjFEj60DLGf+oVLTVBZyHfE/swwwnEI88L+20UEDoP88ZtEoBkZ/QMWcq7uG9F3
         kt88wn3HsUK3He37A7d7M4ohNlvtZdzi9XGNd8+9OZWbdymCxOOd4Sdq3FxZctlLDRQv
         cpsImZE0hkE/OTWd0UOpIytk0vf6MFSZjaY7McxZ9/t/gTHBi/rsQLaq2HIIXkCM13VN
         oeK4xLTzRycVY/Ajj4i8zs92E49igFpDCVoyZQs1cdY94QJSVoQ45wpCyDo1aSp4XbOZ
         rbK4jSqFAHK/wlOwPNxbGKIZopQYP+AhJwidwsF1/iNp3xStj01tt2VOx33ZaE2pfU7Y
         i/TQ==
X-Received: by 10.236.148.14 with SMTP id u14mr1979589yhj.62.1366744522854;
        Tue, 23 Apr 2013 12:15:22 -0700 (PDT)
Received: from [192.168.19.89] (c-76-21-91-75.hsd1.ca.comcast.net. [76.21.91.75])
        by mx.google.com with ESMTPS id u33sm50632634yhn.7.2013.04.23.12.15.20
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 23 Apr 2013 12:15:21 -0700 (PDT)
From: Gary Kratkin <gary@surfcrew.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_24C383A6-812D-4255-A46E-D1F7922A4870"
Message-Id: <B6C80FD4-1D5F-4CE1-BB65-7F3A7935BD99@surfcrew.com>
Date: Tue, 23 Apr 2013 12:15:18 -0700
To: submit@bugs.x2go.org
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
X-Mailer: Apple Mail (2.1503)
X-Gm-Message-State: ALoCoQkqspZ4aLph1BK7lV+aK4TZXed0OtA9yBGvx1AiiR3w996qhsv4K9DjWnZ43hJ2g3B2Vw5s


--Apple-Mail=_24C383A6-812D-4255-A46E-D1F7922A4870
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Package: x2goclient=20
Version: 4.0.1.0=20

Note: I'm running a debug build from 4.0.1.0 sources, linked against Qt =
debug libs.

When shutting down a connection (e.g. by closing the x2goclient window), =
the debug build of Qt gives two diagnostics when two SshMasterConnection =
objects are destructed:

ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to =
objects owned by a different thread. Current thread 27050c0. Receiver '' =
(of type 'SshMasterConnection') was created in thread 5d7500", file =
kernel\qcoreapplication.cpp, line 532
ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to =
objects owned by a different thread. Current thread 27050c0. Receiver '' =
(of type 'SshMasterConnection') was created in thread 5d7500", file =
kernel\qcoreapplication.cpp, line 532

Thread 5d7500 is the main thread.

Ignoring the assert messagebox sometimes results in a GP fault. Most of =
the time the app exits cleanly. I'm not getting the fault at the moment, =
so I don't have a callstack for you.

The callstack from the diagnostic is as follows:

 	QtCored4.dll!qt_message_output
 	QtCored4.dll!qt_message
 	QtCored4.dll!qFatal
 	QtCored4.dll!qt_assert_x
 	QtCored4.dll!QCoreApplicationPrivate::checkReceiverThread
 	QtGuid4.dll!QApplication::notify  Line 3845	C++
 	QtCored4.dll!QCoreApplication::notifyInternal Line 946 + 0x15 =
bytes	C++
 	QtCored4.dll!QCoreApplication::sendEvent Line 231 + 0x39 bytes	=
C++
 	QtCored4.dll!QObjectPrivate::setParent_helper  Line 1933 + 0x10 =
bytes	C++
 	QtCored4.dll!QObject::~QObject()  Line 939	C++
 	QtCored4.dll!QThread::~QThread()  Line 455 + 0xf bytes	C++
>	x2goclient.exe!SshMasterConnection::~SshMasterConnection()  Line =
552 + 0x171 bytes	C++
 	x2goclient.exe!SshMasterConnection::`scalar deleting =
destructor'()  + 0xf bytes	C++
 	x2goclient.exe!SshMasterConnection::channelLoop()  Line 1004 + =
0x47 bytes	C++
 	          for ( int i=3DreverseTunnelConnections.size()-1; i>=3D0;=
 --i)
            {
 ***               delete reverseTunnelConnections[i];
            }
 	x2goclient.exe!SshMasterConnection::run()  Line 526	C++
 	QtCored4.dll!QThreadPrivate::start(void * arg=3D0x01164d08)  =
Line 348	C++
 	msvcr100d.dll!__beginthreadex()  + 0x243 bytes=09
 	msvcr100d.dll!__beginthreadex()  + 0x1d4 bytes=09
 	kernel32.dll!@BaseThreadInitThunk@12()  + 0x12 bytes=09
 	ntdll.dll!___RtlUserThreadStart@8()  + 0x27 bytes=09
 	ntdll.dll!__RtlUserThreadStart@8()  + 0x1b bytes=09


Thank you,
Gary Kratkin


--Apple-Mail=_24C383A6-812D-4255-A46E-D1F7922A4870
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
"><div><p style=3D"margin: 5px 0px; font-size: 12px; font-family: =
'Lucida Grande'; ">Package: x2goclient&nbsp;</p><p style=3D"margin: 5px =
0px; font-size: 12px; font-family: 'Lucida Grande'; ">Version: =
4.0.1.0&nbsp;</p></div><div><br></div><div>Note: I'm running a debug =
build from 4.0.1.0 sources, linked against Qt debug =
libs.</div><div><br></div><div>When shutting down a connection (e.g. by =
closing the x2goclient window), the debug build of Qt gives two =
diagnostics when two SshMasterConnection objects are =
destructed:</div><div><br></div><div><div>ASSERT failure in =
QCoreApplication::sendEvent: "Cannot send events to objects owned by a =
different thread. Current thread 27050c0. Receiver '' (of type =
'SshMasterConnection') was created in thread 5d7500", file =
kernel\qcoreapplication.cpp, line 532</div><div>ASSERT failure in =
QCoreApplication::sendEvent: "Cannot send events to objects owned by a =
different thread. Current thread 27050c0. Receiver '' (of type =
'SshMasterConnection') was created in thread 5d7500", file =
kernel\qcoreapplication.cpp, line 532</div><div><br></div><div>Thread =
5d7500 is the main thread.</div><div><br></div><div>Ignoring the assert =
messagebox sometimes results in a GP fault. Most of the time the app =
exits cleanly. I'm not getting the fault at the moment, so I don't have =
a callstack for you.</div><div><br></div><div>The callstack from the =
diagnostic is as follows:</div><div><br></div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>QtCored4.dll!qt_message_output</div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>QtCored4.dll!qt_message</div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>QtCored4.dll!qFatal</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>QtCored4.dll!qt_assert_x</div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>QtCored4.dll!QCoreApplicationPrivate::checkReceiverThread</div><div=
>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	=
</span>QtGuid4.dll!QApplication::notify &nbsp;Line 3845<span =
class=3D"Apple-tab-span" style=3D"white-space: pre; ">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>QtCored4.dll!QCoreApplication::notifyInternal Line 946 + 0x15 =
bytes<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>QtCored4.dll!QCoreApplication::sendEvent Line 231 + 0x39 =
bytes<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>QtCored4.dll!QObjectPrivate::setParent_helper &nbsp;Line 1933 + =
0x10 bytes<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>QtCored4.dll!QObject::~QObject() =
&nbsp;Line 939<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>QtCored4.dll!QThread::~QThread() =
&nbsp;Line 455 + 0xf bytes<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>C++</div><div>&gt;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>x2goclient.exe!SshMasterConnection::~SshMasterConnection() =
&nbsp;Line 552 + 0x171 bytes<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>C++</div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>x2goclient.exe!SshMasterConnection::`scalar deleting =
destructor'() &nbsp;+ 0xf bytes<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>C++</div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>x2goclient.exe!SshMasterConnection::channelLoop() &nbsp;Line 1004 =
+ 0x47 bytes<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span> &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;for ( int i=3DreverseTunnelConnections.size()-1; i&gt;=3D0; =
--i)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
{</div><div>&nbsp;*** &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
delete reverseTunnelConnections[i];</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; }</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>x2goclient.exe!SshMasterConnection::run() &nbsp;Line 526<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>QtCored4.dll!QThreadPrivate::start(void * arg=3D0x01164d08) =
&nbsp;Line 348<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C++</div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>msvcr100d.dll!__beginthreadex() =
&nbsp;+ 0x243 bytes<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span></div><div>&nbsp;<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>msvcr100d.dll!__beginthreadex() &nbsp;+ 0x1d4 bytes<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span></div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>kernel32.dll!@BaseThreadInitThunk@12() &nbsp;+ 0x12 bytes<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span></div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>ntdll.dll!___RtlUserThreadStart@8() &nbsp;+ 0x27 bytes<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span></div><div>&nbsp;<span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	=
</span>ntdll.dll!__RtlUserThreadStart@8() &nbsp;+ 0x1b bytes<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span></div><div><br></div></div><div><br></div><div>Thank =
you,</div><div>Gary Kratkin</div><div><br></div></body></html>=

--Apple-Mail=_24C383A6-812D-4255-A46E-D1F7922A4870--
