Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-813

Hard crash when emitting signal with argument into QThread

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.0, 5.11.1, 5.11.2
    • Fix Version/s: None
    • Component/s: PySide, Shiboken
    • Labels:
      None
    • Platform/s:
      All

      Description

      PySide2/Qt5 crashes hard (Segmentation fault) when emitting a queued connection signal with an argument into a secondary QThread.

      Note that this is a separate bug from PYSIDE-810, garbage collection is explicitly disabled in the test case below.

      PySide 1.x doesn't seem to be affected (unless the patches below have been back-ported).

      Test case: crash1ex.py
      Stack trace: stack1ex.txt

      It looks like this bug might have been introduced here:

      PYSIDE-164
      PYSIDE-281
      https://codereview.qt-project.org/#/c/84454/

      It seems to be happening during the de-allocation of the Python object that is passed as an argument to the emit method (SbkDeallocWrapper):

      #6  0x00007ffff56f16b2 in Shiboken::Object::deallocData (self=0xa6d368, cleanup=true)
          at shiboken/libshiboken/basewrapper.cpp:1346
      #7  0x00007ffff56ee070 in SbkDeallocWrapperCommon (pyObj=<PySide.QtCore.QObject at remote 0xa6d368>, canDelete=true)
          at shiboken/libshiboken/basewrapper.cpp:246
      #8  0x00007ffff56ee108 in SbkDeallocWrapper (pyObj=<PySide.QtCore.QObject at remote 0xa6d368>)
          at shiboken/libshiboken/basewrapper.cpp:255
      #9  0x00007ffff7a84da3 in tupledealloc (op=0xa6b250) at Objects/tupleobject.c:222
      #10 0x00007ffff59475f9 in PySide::SignalManager::callPythonMetaMethod (method=..., args=0xad7650, pyMethod=<instancemethod at remote 0x7ffff7f0b4b0>, isShortCuit=false)
          at pyside/libpyside/signalmanager.cpp:484
      #11 0x00007ffff5947c10 in (anonymous namespace)::callMethod (object=0xaca7c0, id=4, args=0xad7650)
          at pyside/libpyside/signalmanager.cpp:587
      #12 0x00007ffff594731c in PySide::SignalManager::qt_metacall (object=0xaca7c0, call=QMetaObject::InvokeMetaMethod, id=4, args=0xad7650)
          at pyside/libpyside/signalmanager.cpp:434
      #13 0x00007ffff5cb763b in QObjectWrapper::qt_metacall (this=0xaca7c0, call=QMetaObject::InvokeMetaMethod, id=4, args=0xad7650)
          at PySide/QtCore/PySide/QtCore/qobject_wrapper.cpp:506
      

        Attachments

        1. crash1ex.py
          0.9 kB
        2. pyside813.py
          1 kB
        3. stack1ex.txt
          4 kB

          Issue Links

          For Gerrit Dashboard: PYSIDE-813
          # Subject Branch Project Status CR V

            Activity

              People

              • Assignee:
                crmaurei Cristian Maureira-Fredes
                Reporter:
                teijo Teijo Holzer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There is 1 open Gerrit change