From unknown Thu Mar 28 18:24:17 2024 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 , 187@bugs.x2go.org Resent-From: Gary Kratkin Resent-To: x2go-dev@lists.berlios.de Resent-CC: X2Go Developers X-Loop: owner@bugs.x2go.org Resent-Date: Tue, 23 Apr 2013 19:18:01 +0000 Resent-Message-ID: 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 ; Tue, 23 Apr 2013 21:15:24 +0200 (CEST) Received: by mail-gg0-f182.google.com with SMTP id u2so141112ggn.27 for ; 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 Content-Type: multipart/alternative; boundary="Apple-Mail=_24C383A6-812D-4255-A46E-D1F7922A4870" Message-Id: 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 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=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
  = 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

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