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

Segfault with QML StateMachine and findChild

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.4
    • 5.15.2, 6.1.1
    • PySide
    • None
    • Python 3.8.5 or Python 3.7.3
      PySide6 6.1.1 within virtualenv
      Windows 10 or Debian 10
    • Linux/X11, Windows
    • 98aef951920641dcdf4c217a0c51626cdf82caf8 (pyside/pyside-setup/dev) 10763c7a0c97b6b51ddd4fb8255b90a7897e22ff (pyside/pyside-setup/6.1) 525aa59e3871dccc0ffe6b1cb6441605e3635132 (pyside/tqtc-pyside-setup/5.15)

    Description

      When using findChild and StateMachine in the specified version, the app will eventually crash. In the example case the segfault is at app exit, but in the original case that led to this issue it would happen semi-randomly during execution after the call to findChild.

      This may also exist in PySide2, since I got a similar crash there with the same code.

      To reproduce:

      • Run the attached tiny.py alongside tiny.qml. You will get a blank window and 'None' printed to the console from findChild.
      • Close the window. On exit, the application will segfault.

      The resulting output, when running with '-X faulthandler':

      Windows fatal exception: access violation
      Current thread 0x0000896c (most recent call first):
      <no Python frame>
      Segmentation fault

      This appears to be the combination of findChild and StateMachine. If either of these two is not present, the app does not segfault. For example, comment out line 13 of tiny.py and the app will not segfault.

      Attachments

        1. pyside1609_cpp.zip
          3 kB
        2. pyside1609_cr_diag.diff
          3 kB
        3. pyside1609_diag.diff
          1 kB
        4. pyside1609_stack_515.txt
          178 kB
        5. pyside1609_valgrind_515.txt
          13 kB
        6. pyside1609.zip
          2 kB
        7. tiny.py
          0.5 kB
        8. tiny.qml
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            adli Adam Liddell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes