cross-thread access to qt widgets

Bug #157677 reported by smaug
4
Affects Status Importance Assigned to Milestone
kde4bindings (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Here is sample code:
#v+
using Qyoto;

class Dupa:QWidget
{
        QGridLayout layout=new QGridLayout();
        public Dupa()
        {
                for(int i=0;i<11;++i)
                {
                        layout.AddWidget(new QLabel(i.ToString()),i,0);
                        layout.AddWidget(new QLineEdit(i.ToString()),i,1);
                }
                SetLayout(layout);
                Show();
        }
        static void Main(string[] args)
        {
                new QApplication(args);
                new Dupa();
                QApplication.Exec();
        }
}
#v-
Compilation method: gmcs -r:/usr/lib/cli/qyoto-1.0/qt-dotnet.dll dupa.cs

And here is the result of executing `mono dupa.exe':
#v+
ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread b4e00788. Receiver '' (of type 'QWidget') was created in thread 8402fe0", file kernel/qcoreapplication.cpp, line 269
Stacktrace:

  at (wrapper managed-to-native) Qyoto.SmokeInvocation.CallSmokeMethod (int,intptr,intptr,int) <0x00004>
  at (wrapper managed-to-native) Qyoto.SmokeInvocation.CallSmokeMethod (int,intptr,intptr,int) <0xffffffff>
  at Qyoto.SmokeInvocation.Invoke (string,string,System.Type,object[]) <0x00895>
  at Qyoto.QLabel.Finalize () <0x00035>
  at (wrapper runtime-invoke) System.Object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

 /usr/bin/cli [0x8194ca6]
 /usr/bin/cli [0x8177154]
 [0xffffe440]
 /lib/tls/i686/cmov/libc.so.6(abort+0x101) [0xb7d5e201]
 /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0xcf) [0xb64fe01d]
 /usr/lib/libQtCore.so.4(_Z6qFatalPKcz+0x7f) [0xb64fe0a1]
 /usr/lib/libQtCore.so.4(_Z11qt_assert_xPKcS0_S0_i+0x3c) [0xb64fe0f8]
 /usr/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate19checkReceiverThreadEP7QObject+0x26f) [0xb65bd70f]
 /usr/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x7c) [0xb5e5c4ea]
 /usr/lib/libsmokeqt4.so.1(_ZN14x_QApplication6notifyEP7QObjectP6QEvent+0x87) [0xb6ad6b73]
 /usr/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x80) [0xb65bc456]
 /usr/lib/libQtGui.so.4 [0xb5e5917f]
 /usr/lib/libQtGui.so.4(_ZN7QWidgetD2Ev+0x3ba) [0xb5eb0c74]
 /usr/lib/libQtGui.so.4(_ZN6QFrameD2Ev+0x3d) [0xb61f8ac3]
 /usr/lib/libQtGui.so.4(_ZN6QLabelD2Ev+0x56) [0xb6200a10]
 /usr/lib/libsmokeqt4.so.1(_ZN8x_QLabelD0Ev+0x72) [0xb6c1555c]
 /usr/lib/libsmokeqt4.so.1(_Z12xcall_QLabelsPvPN5Smoke9StackItemE+0x50c) [0xb6be8902]
 /usr/lib/libqyoto.so(_ZN10MethodCall4nextEv+0x143) [0xb7040723]
 /usr/lib/libqyoto.so(CallSmokeMethod+0xdd) [0xb703942d]
 [0xb7072c1c]
 [0xb7071b3e]
 [0xb503603e]
 [0xb79890db]
 /usr/bin/cli [0x8176f50]
 /usr/bin/cli(mono_runtime_invoke+0x27) [0x80b0b2f]
 /usr/bin/cli [0x80cacfe]
 /usr/bin/cli [0x813ff70]
 /usr/bin/cli [0x80ca4c1]
 /usr/bin/cli [0x80caed2]
 /usr/bin/cli [0x80e92fb]
 /usr/bin/cli [0x81316ad]
 /usr/bin/cli [0x814ab16]
 /lib/tls/i686/cmov/libpthread.so.0 [0xb7ea646b]
 /lib/tls/i686/cmov/libc.so.6(clone+0x5e) [0xb7e0573e]
ASSERT: "q->testAttribute(Qt::WA_WState_Created)" in file kernel/qwidget_x11.cpp, line 1631
#v-

IMO this isn't normal behaviour and should be repaired in some way.

Revision history for this message
Andrej Krutak (andree182) wrote :

also happens to me - ubuntu 8.04 (probably since I installed kde4 packages, but I'm not too sure about this)...

Revision history for this message
Michael Bienia (geser) wrote :

Reassigning to kde4bindings as qyoto is now build from it.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Can anyone confirm if this is still happening as there have been many updates in the time since this was filed.

Changed in kde4bindings:
status: New → Incomplete
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in kde4bindings:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.