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

Segmentation fault on import of shiboken generated module with no classes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 6.6.2
    • Shiboken
    • None
    • Linux/X11
    • 7accf7c3042e3f0680fa0615a0f13b54d28a0efd

    Description

      For testing purposes I created a test file with only a simple function.

      I then exported the function in the xml file and generated the binding with shiboken6.

      When I tried to import the module in python, I got a segmentation fault.

      After a little bit of debugging it looks like the function FinishSignatureInitialization (https://code.qt.io/cgit/pyside/pyside-setup.git/tree/sources/shiboken6/libshiboken/signature/signature.cpp?h=6.6.2#n464)

      is missing the call to init_shibokensupport_module() that the other functions have at the start.

      This causes the segmentation fault when the uninitialized pyside_globals variable is accessed in PySide_BuildSignatureArgs.

      This only happens when no classes are exported because then no InitSignatureStrings() is called in any of the class init functions. This would otherwise initialise the variable before the call to FinishSignatureInitialization at the end in the module_warpper.cpp

      Attachments

        1. backtrace.txt
          3 kB
        2. pyside2645.zip
          2 kB
        3. ShibokenBug.tar.gz
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            nomanor nomanor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes