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

    • Platform/s:
      All
    • Commits:
      52299827c64cccc1456f9050fdf3dd8596df3e6f (pyside/pyside-setup/5.14)

      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. 813-crash-py37debug-pyside-5-14-2.txt
          66 kB
        2. crash1ex.py
          0.9 kB
        3. PYSIDE_813.provoked.crash.txt
          69 kB
        4. pyside813_diag.diff
          4 kB
        5. pyside813_log.txt
          1 kB
        6. pyside813_stack.txt
          69 kB
        7. pyside813_valgrind.txt
          398 kB
        8. pyside813.py
          2 kB
        9. stack1ex.txt
          4 kB

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              ctismer Christian Tismer
              Reporter:
              teijo Teijo Holzer
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes