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

Segfault copying the return value of QMetaMethod.methodSignature

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.12.4, 5.14.1
    • PySide
    • None
    • Linux/X11, macOS
    • 821480b1f0d0cfb59df427315c29c364096818c4 (pyside/pyside-setup/5.14)

    Description

      The following script segfaults in the `bytes(sig)` line

      from PySide2.QtCore import QObject
      
      mo = QObject.staticMetaObject
      mm = mo.method(0)
      sig = mm.methodSignature()
      bytes(sig)  # <- segfault here
      

      Tested on macOS (10.14.6) and Linux (Mageia 7) with Python 3.7, PySide2 installed via pypi distributed wheels.

      The backtrace from lldb is:

      * thread #2, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
        * frame #0: 0x00000001000d7190 Python`PyBuffer_IsContiguous + 304
          frame #1: 0x0000000100120f8c Python`PyBuffer_ToContiguous + 44
          frame #2: 0x00000001000e9086 Python`_PyBytes_FromBuffer + 70
          frame #3: 0x00000001000e8ae9 Python`PyBytes_FromObject + 89
          frame #4: 0x00000001000e97ee Python`bytes_new + 798
          frame #5: 0x000000010013a652 Python`type_call + 50
          frame #6: 0x00000001000ef3f1 Python`_PyObject_FastCallKeywords + 433
          frame #7: 0x00000001001ae784 Python`call_function + 420
          frame #8: 0x00000001001ab92e Python`_PyEval_EvalFrameDefault + 25342
          frame #9: 0x00000001001af413 Python`_PyEval_EvalCodeWithName + 2467
          frame #10: 0x00000001001a5554 Python`PyEval_EvalCode + 100
          frame #11: 0x00000001001e2827 Python`PyRun_InteractiveOneObjectEx + 599
          frame #12: 0x00000001001e2092 Python`PyRun_InteractiveLoopFlags + 226
          frame #13: 0x00000001001e1f7c Python`PyRun_AnyFileExFlags + 60
          frame #14: 0x00000001002019ee Python`pymain_main + 7150
          frame #15: 0x0000000100201e6a Python`_Py_UnixMain + 58
          frame #16: 0x00007fff5d8da3d5 libdyld.dylib`start + 1
          frame #17: 0x00007fff5d8da3d5 libdyld.dylib`start + 1
      

      Attachments

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              aleserjavec Ales Erjavec
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes