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 892 - Segfault when destructing QWidget and QApplication has event filter installed
: Segfault when destructing QWidget and QApplication has event filter installed
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: 1.0.3
: PC Linux
: P1 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-06-18 00:01 EEST by Catalin Drula
Modified: 2011-07-22 22:12 EEST (History)
10 users (show)

See Also:


Attachments
Stack trace for crash on Lucid with PySide 1.0.3 (3.78 KB, text/plain)
2011-06-18 00:01 EEST, Catalin Drula
Details
Short example that reproduces segmentation fault (635 bytes, text/x-python)
2011-06-19 22:22 EEST, Catalin Drula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Catalin Drula 2011-06-18 00:01:59 EEST
Created attachment 350 [details]
Stack trace for crash on Lucid with PySide 1.0.3

I consistently get segmentation faults with Ubuntu 10.04.2 LTS (Lucid) and
PySide 1.0.3 when widgets/dialogs are garbage collected.

The following function:

    def close(self):       
        box = QMessageBox()
        box.setStandardButtons(QMessageBox.Save | QMessageBox.Discard |
QMessageBox.Cancel)
        box.setText("There are unsaved changes to the current session.")
        box.setInformativeText("Do you want to save your changes?")
        ret = box.exec_()

        if ret == QMessageBox.Discard:
            return "OK"

consistently produces segmentation faults when it returns as a result of the
deallocation of the QMessageBox object.

This problem never occurs with Ubuntu 10.10 (Maverick) and PySide 1.0.1. I
wasn't able yet to do a more detailed regression as I could not find the older
PySide .deb packages (1.0.2 or 1.0.1). I'll try next Maverick with 1.0.3 and
publish the results here.

Here are the final lines of the relevant stack trace (a more detailed trace is
attached):

(gdb) bt
#0  0x0203877e in QWidget::~QWidget() () from /usr/lib/libQtGui.so.4
#1  0x0174fb95 in Shiboken::callCppDestructor<QMessageBox> (cptr=0x0) at
/usr/include/shiboken/basewrapper.h:106
#2  0x00c9b465 in SbkDeallocWrapper (pyObj=<PySide.QtGui.QMessageBox at remote
0xa940d4c>) at /build/buildd/shiboken-1.0.3/libshiboken/basewrapper.cpp:188
#3  0x080a8a44 in tupledealloc (op=0xa92a8ac) at ../Objects/tupleobject.c:170
#4  0x0108c5c3 in ~AutoDecRef (this=0xabd2df0, arg__1=0xaa5ce50,
arg__2=0xbfe98fe4) at /usr/include/shiboken/autodecref.h:47
Comment 1 Catalin Drula 2011-06-19 22:22:27 EEST
Created attachment 351 [details]
Short example that reproduces segmentation fault
Comment 2 Catalin Drula 2011-06-19 22:25:17 EEST
I've added a short example that reproduces the segmentation fault. It is
related to the event filter installed on QApplication.instance().

The same example does not segfault on Maverick with Pyside 1.0.1.

An equivalent C++ example does not crash on either Lucid (Qt 4.6) or Maverick
(Qt 4.7).
Comment 3 Hugo Parente Lima 2011-06-20 20:47:22 EEST
Thanks for catching this regression for us and sorry for their existence.
Comment 4 Catalin Drula 2011-06-20 20:57:34 EEST
I've finally managed to get some more data points with Didier's help (perhaps a
more permanent system for making older builds available would be a good idea).

Seg fault: Lucid/Maverick, 1.0.3
No crash: Lucid - 1.0.2, Maverick - 1.0.1

So it seems that the problem was introduced in 1.0.3
Comment 5 Hugo Parente Lima 2011-06-23 00:10:11 EEST
Fixed in commit:

shiboken/67561024f2e0ad69e482ecf5e5e3ff4be944f169
Comment 6 Hugo Parente Lima 2011-06-27 19:53:14 EEST
*** Bug 894 has been marked as a duplicate of this bug. ***
Comment 7 renato filho 2011-07-22 22:12:48 EEST
release 1.0.5