Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32501

Setting a dynamic property on an object in another thread trips assert

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.8.5
    • None
    • OpenSUSE Linux 12.2 64 bit
      Linux linux-edge.site 3.4.47-2.38-desktop #1 SMP PREEMPT Fri May 31 20:17:40 UTC 2013 (3961086) x86_64 x86_64 x86_64 GNU/Linux
      g++ (SUSE Linux) 4.7.1 20120723 [gcc-4_7-branch revision 189773]
      Qt 4.8.5 Open Source

      The attached code demonstrates the problem. Compile and run the application, then click on the Set Property button. When setting a dynamic property of an object, Qt is calling QCoreApplication::sendEvent(). If the thread that QObject::setProperty() is called on doesn't match the thread affinity of the object, then it trips an assert about sending events to objects owned by another thread. This is causing KDAB's GammaRay utility to crash when analyzing any application that has QTimers firing in threads. See https://github.com/KDAB/GammaRay/issues/44. Perhaps QCoreApplication::postEvent() should be called when the current thread doesn't match the thread affinity of the object.

        1. Dialog.cpp
          1 kB
          Steven Packard
        2. Dialog.h
          0.4 kB
          Steven Packard
        3. Dialog.ui
          2 kB
          Steven Packard
        4. dynamicpropertycrash.pro
          0.4 kB
          Steven Packard
        5. main.cpp
          0.2 kB
          Steven Packard
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            spackard Steven Packard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes