[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Exit crash after creating QGraphicsViews
From: Luke Campagnola <lcampagn () email ! unc ! edu>
Date: 2013-04-26 13:50:50
Message-ID: CACZXET-++yLSd1C3mwXpqYd-WScQrZRU59nf0N5uOsRnyPsKDw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Howdy,
I am getting an error at exit for the following example:
from PyQt4 import QtGui
app = QtGui.QApplication([])
v1 = QtGui.QGraphicsView()
s1 = QtGui.QGraphicsScene()
v1.setScene(s1)
v2 = QtGui.QGraphicsView()
s2 = QtGui.QGraphicsScene()
v2.setScene(s2)
The error is this:
QPixmap: Must construct a QApplication before a QPaintDevice
Program received signal SIGABRT, Aborted.
My interpretation is that, as python is cleaning up, it somehow calls
QApplication.quit() before destroying the graphicsview / scene objects. Is
there any way to ensure these things happen in the correct order?
Here is the backtrace:
0x00007ffff6f1a425 in __GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtr
#0 0x00007ffff6f1a425 in __GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff6f1db8b in __GI_abort () at abort.c:91
#2 0x00007ffff48b04c2 in qt_message_output (msgType=msgType@entry=QtFatalMsg,
buf=0xca59b8 "QPixmap: Must construct a QApplication before a
QPaintDevice") at global/qglobal.cpp:2290
#3 0x00007ffff48b0838 in qt_message(QtMsgType, const char *, typedef
__va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, msg=
0x7ffff555d470 "QPixmap: Must construct a QApplication before a
QPaintDevice", ap=ap@entry=0x7fffffffd888) at global/qglobal.cpp:2336
#4 0x00007ffff48b09c4 in qFatal (msg=<optimized out>) at
global/qglobal.cpp:2519
#5 0x00007ffff4faf1de in qt_pixmap_thread_test () at image/qpixmap.cpp:102
#6 0x00007ffff4fb0751 in QPixmap::QPixmap (this=0xd01ba8) at
image/qpixmap.cpp:174
#7 0x00007fffea2991c6 in Oxygen::Helper::Helper(QByteArray const&) () from
/usr/lib/liboxygenstyle.so.4
#8 0x00007fffea52a5f0 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#9 0x00007fffea511805 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#10 0x00007fffea528c5c in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#11 0x00007ffff51d2c66 in QStyleFactory::create (key=...) at
styles/qstylefactory.cpp:193
#12 0x00007ffff4edf9f3 in QApplication::style () at
kernel/qapplication.cpp:1467
#13 0x00007ffff4f1b5c8 in QWidget::isActiveWindow (this=0xcd1770) at
kernel/qwidget.cpp:6692
#14 0x00007ffff54e921c in QGraphicsView::setScene (this=0xcd1770,
scene=0x0) at graphicsview/qgraphicsview.cpp:1621
#15 0x00007ffff54c1081 in QGraphicsScene::~QGraphicsScene (this=0xd651d0,
__in_chrg=<optimized out>) at graphicsview/qgraphicsscene.cpp:1653
#16 0x00007ffff5df2db9 in sipQGraphicsScene::~sipQGraphicsScene
(this=0xd651d0, __in_chrg=<optimized out>) at sipQtGuipart6.cpp:23630
#17 0x00007ffff5de2e96 in release_QGraphicsScene (sipCppV=0xd651d0) at
sipQtGuipart6.cpp:27384
#18 0x00007ffff1439044 in forgetObject (sw=sw@entry=0x7ffff7e515f0) at
/build/buildd/sip4-4.13.3/siplib/siplib.c:10127
#19 0x00007ffff143a939 in sipWrapper_dealloc (self=0x7ffff7e515f0) at
/build/buildd/sip4-4.13.3/siplib/siplib.c:9678
#20 0x000000000048aae0 in subtype_dealloc.25740 (self=<QGraphicsScene at
remote 0x7ffff7e515f0>) at ../Objects/typeobject.c:1026
#21 0x00000000004c9c47 in insertdict_by_entry.18488 (mp=mp@entry=0x8d6e30,
key=key@entry='s2', hash=hash@entry=14720088435132841, ep=<optimized out>,
value=<optimized out>)
at ../Objects/dictobject.c:519
#22 0x00000000004a10c0 in insertdict (value=None, hash=14720088435132841,
key='s2', mp=0x8d6e30) at ../Objects/dictobject.c:556
#23 dict_set_item_by_hash_or_entry (value=None, ep=0x0,
hash=14720088435132841, key='s2', op=
{'QtGui': None, 'save_history': None, 'v1': None, '__builtins__':
<module at remote 0x7ffff7f8bad0>, 'rlcompleter': None, 'app': None,
'historyPath': None, '__package__': None, 'atexit': None, 'v2': None, 's2':
None, '__name__': '__main__', 'readline': <module at remote
0x7ffff7ec3868>, 'os': <module at remote 0x7ffff7f52c90>, '__doc__': None,
's1': <QGraphicsScene at remote 0x7ffff7e514d0>}) at
../Objects/dictobject.c:765
#24 PyDict_SetItem (op=
{'QtGui': None, 'save_history': None, 'v1': None, '__builtins__':
<module at remote 0x7ffff7f8bad0>, 'rlcompleter': None, 'app': None,
'historyPath': None, '__package__': None, 'atexit': None, 'v2': None, 's2':
None, '__name__': '__main__', 'readline': <module at remote
0x7ffff7ec3868>, 'os': <module at remote 0x7ffff7f52c90>, '__doc__': None,
's1': <QGraphicsScene at remote 0x7ffff7e514d0>}, key='s2', value=None) at
../Objects/dictobject.c:818
#25 0x00000000004a1337 in _PyModule_Clear (m=<optimized out>) at
../Objects/moduleobject.c:138
#26 0x00000000004e5b54 in PyImport_Cleanup () at ../Python/import.c:473
#27 0x0000000000434429 in Py_Finalize () at ../Python/pythonrun.c:454
#28 0x000000000044b74d in Py_Main (argc=<optimized out>,
argv=0x7fffffffe068) at ../Modules/main.c:664
#29 0x00007ffff6f0576d in __libc_start_main (main=0x44b77b <main>, argc=1,
ubp_av=0x7fffffffe068, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=
0x7fffffffe058) at libc-start.c:226
#30 0x00000000004ce0ad in _start ()
[Attachment #5 (text/html)]
Howdy,<div><div>I am getting an error at exit for the following \
example:</div><div><br></div>from PyQt4 import QtGui<br>app = \
QtGui.QApplication([])<br>v1 = QtGui.QGraphicsView()<br>s1 = \
QtGui.QGraphicsScene()<br>v1.setScene(s1)<br>
v2 = QtGui.QGraphicsView()<br>s2 = \
QtGui.QGraphicsScene()<br><div><div>v2.setScene(s2)</div></div><div><br></div><div>The \
error is this: </div><div><br>QPixmap: Must construct a QApplication before a \
QPaintDevice<br><div>
<div>Program received signal SIGABRT, \
Aborted.</div></div></div><div><div><br></div><div>My interpretation is that, as \
python is cleaning up, it somehow calls QApplication.quit() before destroying the \
graphicsview / scene objects. Is there any way to ensure these things happen in the \
correct order?</div>
<div><br></div><div>Here is the \
backtrace:</div><div><br></div><div>0x00007ffff6f1a425 in __GI_raise \
(sig=<optimized out>) at \
../nptl/sysdeps/unix/sysv/linux/raise.c:64</div><div>64 \
../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.</div>
<div>(gdb) backtr</div><div>#0 0x00007ffff6f1a425 in __GI_raise (sig=<optimized \
out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64</div><div>#1 \
0x00007ffff6f1db8b in __GI_abort () at abort.c:91</div><div>#2 0x00007ffff48b04c2 in \
qt_message_output (msgType=msgType@entry=QtFatalMsg, buf=0xca59b8 "QPixmap: Must \
construct a QApplication before a QPaintDevice") at \
global/qglobal.cpp:2290</div>
<div>#3 0x00007ffff48b0838 in qt_message(QtMsgType, const char *, typedef \
__va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, msg=</div><div> \
0x7ffff555d470 "QPixmap: Must construct a QApplication before a \
QPaintDevice", ap=ap@entry=0x7fffffffd888) at global/qglobal.cpp:2336</div>
<div>#4 0x00007ffff48b09c4 in qFatal (msg=<optimized out>) at \
global/qglobal.cpp:2519</div><div>#5 0x00007ffff4faf1de in qt_pixmap_thread_test () \
at image/qpixmap.cpp:102</div><div>#6 0x00007ffff4fb0751 in QPixmap::QPixmap \
(this=0xd01ba8) at image/qpixmap.cpp:174</div>
<div>#7 0x00007fffea2991c6 in Oxygen::Helper::Helper(QByteArray const&) () from \
/usr/lib/liboxygenstyle.so.4</div><div>#8 0x00007fffea52a5f0 in ?? () from \
/usr/lib/kde4/plugins/styles/oxygen.so</div><div>#9 0x00007fffea511805 in ?? () from \
/usr/lib/kde4/plugins/styles/oxygen.so</div>
<div>#10 0x00007fffea528c5c in ?? () from \
/usr/lib/kde4/plugins/styles/oxygen.so</div><div>#11 0x00007ffff51d2c66 in \
QStyleFactory::create (key=...) at styles/qstylefactory.cpp:193</div><div>#12 \
0x00007ffff4edf9f3 in QApplication::style () at kernel/qapplication.cpp:1467</div>
<div>#13 0x00007ffff4f1b5c8 in QWidget::isActiveWindow (this=0xcd1770) at \
kernel/qwidget.cpp:6692</div><div>#14 0x00007ffff54e921c in QGraphicsView::setScene \
(this=0xcd1770, scene=0x0) at graphicsview/qgraphicsview.cpp:1621</div>
<div>#15 0x00007ffff54c1081 in QGraphicsScene::~QGraphicsScene (this=0xd651d0, \
__in_chrg=<optimized out>) at \
graphicsview/qgraphicsscene.cpp:1653</div><div>#16 0x00007ffff5df2db9 in \
sipQGraphicsScene::~sipQGraphicsScene (this=0xd651d0, __in_chrg=<optimized \
out>) at sipQtGuipart6.cpp:23630</div>
<div>#17 0x00007ffff5de2e96 in release_QGraphicsScene (sipCppV=0xd651d0) at \
sipQtGuipart6.cpp:27384</div><div>#18 0x00007ffff1439044 in forgetObject \
(sw=sw@entry=0x7ffff7e515f0) at /build/buildd/sip4-4.13.3/siplib/siplib.c:10127</div>
<div>#19 0x00007ffff143a939 in sipWrapper_dealloc (self=0x7ffff7e515f0) at \
/build/buildd/sip4-4.13.3/siplib/siplib.c:9678</div><div>#20 0x000000000048aae0 in \
subtype_dealloc.25740 (self=<QGraphicsScene at remote 0x7ffff7e515f0>) at \
../Objects/typeobject.c:1026</div>
<div>#21 0x00000000004c9c47 in insertdict_by_entry.18488 (mp=mp@entry=0x8d6e30, \
key=key@entry='s2', hash=hash@entry=14720088435132841, ep=<optimized \
out>, value=<optimized out>)</div><div> at \
../Objects/dictobject.c:519</div>
<div>#22 0x00000000004a10c0 in insertdict (value=None, hash=14720088435132841, \
key='s2', mp=0x8d6e30) at ../Objects/dictobject.c:556</div><div>#23 \
dict_set_item_by_hash_or_entry (value=None, ep=0x0, hash=14720088435132841, \
key='s2', op=</div>
<div> {'QtGui': None, 'save_history': None, 'v1': None, \
'__builtins__': <module at remote 0x7ffff7f8bad0>, \
'rlcompleter': None, 'app': None, 'historyPath': None, \
'__package__': None, 'atexit': None, 'v2': None, \
's2': None, '__name__': '__main__', 'readline': \
<module at remote 0x7ffff7ec3868>, 'os': <module at remote \
0x7ffff7f52c90>, '__doc__': None, 's1': <QGraphicsScene at \
remote 0x7ffff7e514d0>}) at ../Objects/dictobject.c:765</div>
<div>#24 PyDict_SetItem (op=</div><div> {'QtGui': None, \
'save_history': None, 'v1': None, '__builtins__': <module \
at remote 0x7ffff7f8bad0>, 'rlcompleter': None, 'app': None, \
'historyPath': None, '__package__': None, 'atexit': None, \
'v2': None, 's2': None, '__name__': '__main__', \
'readline': <module at remote 0x7ffff7ec3868>, 'os': <module \
at remote 0x7ffff7f52c90>, '__doc__': None, 's1': \
<QGraphicsScene at remote 0x7ffff7e514d0>}, key='s2', value=None) at \
../Objects/dictobject.c:818</div>
<div>#25 0x00000000004a1337 in _PyModule_Clear (m=<optimized out>) at \
../Objects/moduleobject.c:138</div><div>#26 0x00000000004e5b54 in PyImport_Cleanup () \
at ../Python/import.c:473</div><div>#27 0x0000000000434429 in Py_Finalize () at \
../Python/pythonrun.c:454</div>
<div>#28 0x000000000044b74d in Py_Main (argc=<optimized out>, \
argv=0x7fffffffe068) at ../Modules/main.c:664</div><div>#29 0x00007ffff6f0576d in \
__libc_start_main (main=0x44b77b <main>, argc=1, ubp_av=0x7fffffffe068, \
init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized \
out>, stack_end=</div>
<div> 0x7fffffffe058) at libc-start.c:226</div><div>#30 0x00000000004ce0ad in \
_start ()</div></div><div><br></div></div>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic