PyQt4 crashes when destroying QApplication in trivial program

Bug #584713 reported by Brian Crowell
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-qt4 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: python-qt4

PyQt4 crashes most of the time when exiting the program below. (This is NOT a dupe of #561303.)

A stack trace shows that it dies when trying to destroy the QApplication object when removing it from the module's dictionary:

#0 0x00000000 in ?? ()
#1 0x0507d157 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtGui.so
#2 0x0507d21f in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtGui.so
#3 0x003efbab in ?? () from /usr/lib/pymodules/python2.6/sip.so
#4 0x003efbe1 in ?? () from /usr/lib/pymodules/python2.6/sip.so
#5 0x080ab5c3 in subtype_dealloc (self=<unknown at remote 0x3fdff4>) at ../Objects/typeobject.c:1019
#6 0x0808ecd9 in insertdict (mp=0xb77f924c, key='app', hash=-1582925558, value=None) at ../Objects/dictobject.c:459
#7 0x08091037 in PyDict_SetItem (op=
    {'QAbstractButton': None, 'QSizePolicy': None, 'QMatrix3x4': None, 'QMatrix3x3': None, 'QMatrix3x2': None, 'QGraphicsColorizeEffect': None, 'qRound64': None, 'QSizeGrip': None, 'QStyleOptionComboBox': None, 'QStringListModel': None, 'QAbstractSpinBox': None, 'QTreeView': None, 'QWorkspace': None, 'QPoint': None, 'QFontComboBox': None, 'QGraphicsTextItem': None, 'QSyntaxHighlighter': None, 'QGraphicsRectItem': None, 'QSpacerItem': None, 'QModelIndex': None, 'QLocale': None, 'QFinalState': None, 'QGraphicsPixmapItem': None, 'QStyle': None, 'QX11EmbedContainer': None, 'QMutexLocker': None, 'QClipboard': None, 'QInputContext': None, 'uppercasebase': None, 'QtSystemMsg': None, 'QWhatsThisClickedEvent': None, 'QSwipeGesture': None, 'QPicture': None, 'QAbstractTransition': None, 'QTextLength': None, 'QTextOption': None, 'QMessageBox': None, 'QGesture': None, 'QFileSystemWatcher': None, 'QGestureEvent': None, 'qIsNull': None, 'QTime': None, 'PyQt4': None, 'qBlue': None, 'QStyleOptionViewItemV4': None, 'QtMsgType': No...(truncated), key='app', value=None) at ../Objects/dictobject.c:701
#8 0x08092cb3 in _PyModule_Clear (m=<module at remote 0xb77c711c>) at ../Objects/moduleobject.c:138
#9 0x080f2c55 in PyImport_Cleanup () at ../Python/import.c:441
#10 0x080ffdec in Py_Finalize () at ../Python/pythonrun.c:438
#11 0x0805d826 in Py_Main (argc=2, argv=0xbf913084) at ../Modules/main.c:596
#12 0x0805d03b in main (argc=2, argv=0xbf913084) at ../Modules/python.c:23

(by the way, python-qt4-dbg is installed, that doesn't seem to make a difference with the unknown symbols above)

If the line that creates the file menu is removed, the program exits cleanly.

# Python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys

class MainWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.file_menu = self.menuBar().addMenu('&File')

app = QApplication(sys.argv)

window = MainWindow()
window.show()

quit(app.exec_())

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: python-qt4 4.7.2-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic i686
Architecture: i386
Date: Sun May 23 14:53:26 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python-qt4

Revision history for this message
Brian Crowell (brian-fluggo) wrote :
Revision history for this message
Nuno Sucena Almeida (slug-debian) wrote :

I have this problem with lucid. It happened with karmic too.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.