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

Segfault when using connect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.0, 6.5.0, 6.4.3
    • 1.2.x
    • PySide
    • None
    • db40e3e07 (dev), d00d4bfc6 (6.4), 08ec50ff3 (dev), 9c5b9a97e (6.4), 21fbc5ec9 (dev), 30614ffb1 (6.4), d074f98de (dev), 2fee56b74 (6.4)

    Description

      Python segfaults when connecting to a signal attribute of a temporary object; e.g.

      tv = QTreeView()
      ...
      tv.selectionModel().destroyed.connect(callback)

      What happens is a PyObject* is created for the selection model, but is destroyed after its 'destroyed' attribute is gotten and before the .connect(callback) call.

      It may not segfault in a non-debug python build because the recently freed memory may still contain its old values

      Attachments

        1. bug_79.py
          2 kB
          Christian Tismer
        2. ceval.c
          139 kB
          Christian Tismer
        3. instrumentation.txt
          0.3 kB
          Christian Tismer
        4. object.c
          58 kB
          Christian Tismer
        5. object.h
          38 kB
          Christian Tismer
        6. pyside79.py
          0.8 kB
          Friedemann Kleint
        7. signalconnect_test.py
          0.5 kB
          John Ehresman

        Issue Links

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

          Activity

            People

              ctismer Christian Tismer
              jpe John Ehresman
              Votes:
              6 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes