Subject: Destroying SshMasterConnection off the main thread leads to a diagnostic from Qt debug libs

From: Gary Kratkin <[email-masked]>
Date: Tue, 23 Apr 2013 12:15:18 -0700

Package: x2goclient 
Version: 4.0.1.0 

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=reverseTunnelConnections.size()-1; i>=0; --i)
            {
 ***               delete reverseTunnelConnections[i];
            }
 	x2goclient.exe!SshMasterConnection::run()  Line 526	C++
 	QtCored4.dll!QThreadPrivate::start(void * arg=0x01164d08)  Line 348	C++
 	msvcr100d.dll!__beginthreadex()  + 0x243 bytes	
 	msvcr100d.dll!__beginthreadex()  + 0x1d4 bytes	
 	kernel32.dll!@BaseThreadInitThunk@12()  + 0x12 bytes	
 	ntdll.dll!___RtlUserThreadStart@8()  + 0x27 bytes	
 	ntdll.dll!__RtlUserThreadStart@8()  + 0x1b bytes	

Thank you,
Gary Kratkin

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 23 Apr 2013 23:10:31 +0200

tag #187 moreinfo
thanks

Hi Gary,

thanks for reporting your bug and welcome to X2Go.

On Di 23 Apr 2013 21:15:18 CEST Gary Kratkin wrote:

> 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:

> [...]

Can you check, if the described issue gets fixed by a patch in bug  
report #101?

http://bugs.x2go.org/cgi-bin/bugreport.cgi?bug=101#15

Thanks,
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb

---

From: Gary Kratkin <[email-masked]>
Date: Tue, 23 Apr 2013 17:02:41 -0700

Hi Mike, thanks for getting back to me so quickly.  Applying the patch from bug #101 does NOT fix the problem.  

Note that this isn't a blocker for me. 

Regards,
Gary

On Apr 23, 2013, at 2:10 PM, Mike Gabriel <[email-masked]> wrote:

> Can you check, if the described issue gets fixed by a patch in bug report #101?
>