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

Segfault when calling signal of temporary

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.5.0, 6.4.3
    • 6.4.2
    • PySide
    • None
    • Arch x86_64, Python v3.10.9-1, PySide6 v6.4.2-1
    • db40e3e07 (dev), d00d4bfc6 (6.4), 08ec50ff3 (dev), 9c5b9a97e (6.4)

    Description

      The following snippet segfaults while executing the last line:

       

      from PySide6.QtCore import QObject, Signal, Slot
      
      
      class Foo(QObject):
          s = Signal(int)
      
          def __init__(self):
              QObject.__init__(self)
      
      
          def send(self, i):
              self.s.emit(i)
      
      
      f = Foo()
      f.s.emit(42)  # ok
      
      Foo().send(42)  # ok
      
      Foo().s.emit(42)  # segfault 

      Regardless of whether calling the signal of a temporary directly is "allowed" as part of the API, it shouldn't segfault.

      Attachments

        1. pyside2201.py
          1.0 kB
        2. pyside2201_stack.txt
          26 kB
        3. pyside2201_valgrind.txt
          94 kB
        4. pyside2201_pyqt.py
          0.9 kB

        Issue Links

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

          Activity

            People

              ctismer Christian Tismer
              thirtythreeforty George Hilliard
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews