PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 563 - Unhandled signal emitting with invalid signature (which leads to application crash)
: Unhandled signal emitting with invalid signature (which leads to application ...
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2010-12-21 12:53 EET by Vladimir Rutsky
Modified: 2011-01-06 16:19 EET (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Rutsky 2010-12-21 12:53:39 EET
It is possible to emit signal in PySide with invalid signature, that will lead
to application crash with stack trace leading to internals of PySide/Shiboken.

Consider example:

import sys
from PySide import QtCore, QtGui

class A(QtCore.QObject):
    sig = QtCore.Signal(object)

    def __init__(self):
        super(A, self).__init__()

        print "A.__init__({0})".format(self)

        self.sig.connect(self.slot)

    def wrong_emit(self):
        # Incorrect call.
        # self.sig.emit(self)
        self.sig.emit()

    @QtCore.Slot(object)
    def slot(self, object):
        print "A.slot({0}, {1})".format(self, object)

app = QtGui.QApplication(sys.argv)

o = A()
o.wrong_emit()

#sys.exit(app.exec_())


Debugging such errors in Python looks impossible, PySide definitely should have
some kind of handler for signals that emitted with incorrect signature.
Comment 1 Matti Airas 2010-12-22 08:00:48 EET
Thanks for the bug report.

I'm prioritizing this P2. The bug will be taken care of once the preceding
P1/P2 bugs have been dealt with (assuming the implementation allows for easy
fixing of the issue - if not, then we have to review the issue).
Comment 2 Hugo Parente Lima 2010-12-29 10:19:46 EET
Fixed in commit:

pyside/e8c0ba238a4807a77033ad3d3087787959dc1cc3
Comment 3 renato filho 2011-01-06 16:19:33 EET
released on beta3