[PyQt] Crash in QDockWidget::initStyleOption

Dmitry Shachnev mitya57 at ubuntu.com
Sun Mar 30 11:13:27 BST 2014


Hi Thomi,

I recommend you to keep a reference to objects you create (like
creating them not as local variables, but as object attributes).

In any case, I am forwarding your message to PyQt mailing list in case
someone can solve your problem. Dear mailing list readers: please see
the bug report below and attached test case there for details of the
problem.

I have also managed to get a backtrace with Python 3.4 and Qt/PyQt
5.2.1, and attached it. (I also highly recommend you to use
PyQt5/Python3 instead of PyQt4/Python2). The test script I used
(corresponding to your strategy 2) is also attached.

--
Dmitry Shachnev

---------- Forwarded message ----------
From: Thomi Richards <thomi.richards at canonical.com>
Date: Fri, Mar 28, 2014 at 11:53 PM
Subject: PyQt4 bindings
To: mitya57 at gmail.com

Hi,

Do you look after the PyQt4 bindings? I notice your email in the
changelog, so I'm hoping you can point me in the right direction. I
ran into this issue today:

https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/1298767

...and I'd like to know who I should be talking to to get that
escalated, and hopefully fixed. Any thoughts?

Cheers,

--
Thomi Richards
thomi.richards at canonical.com
-------------- next part --------------
(gdb) bt full
#0  0xb3f78eb4 in titleArea (this=0x0) at widgets/qdockwidget_p.h:155
No locals.
#1  QDockWidget::initStyleOption (this=this at entry=0x85a0150, option=option at entry=0xbfffd948) at widgets/qdockwidget.cpp:626
No locals.
#2  0xb3f78fd9 in QDockWidgetPrivate::updateButtons (this=this at entry=0x85a01a0) at widgets/qdockwidget.cpp:656
        opt = {<QStyleOption> = {version = 2, type = 9, state = {i = 1}, direction = Qt::LeftToRight, rect = {x1 = 0, y1 = 0, x2 = 639, y2 = 479}, fontMetrics = {d = {
                d = 0x874a160}}, palette = {static staticMetaObject = {d = {superdata = 0x0, stringdata = 0xb74a5180 <qt_meta_stringdata_QPalette>, 
                  data = 0xb74a5020 <qt_meta_data_QPalette>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}, d = 0x874b688, {data = {current_group = 0, 
                  resolve_mask = 0}, for_faster_swapping_dont_use = 0}}, styleObject = 0x85a0150}, title = {static null = {<No data fields>}, 
            d = 0xb6f3a1a0 <QArrayData::shared_null>}, closable = false, movable = false, floatable = false, verticalTitleBar = false}
        customTitleBar = <optimized out>
        nativeDeco = <optimized out>
        hideButtons = 179
#3  0xb3f7c5d8 in QDockWidget::event (this=this at entry=0x85a0150, event=event at entry=0xbfffdc80) at widgets/qdockwidget.cpp:1406
        layout = <optimized out>
#4  0xb4657f50 in sipQDockWidget::event (this=0x85a0150, a0=0xbfffdc80) at sipQtWidgetspart8.cpp:6673
        sipGILState = (unknown: 3023519744)
        sipMeth = <optimized out>
#5  0xb3e2cde4 in QApplicationPrivate::notify_helper (this=this at entry=0x84fbcb8, receiver=receiver at entry=0x85a0150, e=e at entry=0xbfffdc80) at kernel/qapplication.cpp:3486
        consumed = <optimized out>
#6  0xb3e327c1 in QApplication::notify (this=this at entry=0x85cb260, receiver=receiver at entry=0x85a0150, e=e at entry=0xbfffdc80) at kernel/qapplication.cpp:3236
        w = 0x85a0150
        extra = <optimized out>
        isProxyWidget = <optimized out>
        __PRETTY_FUNCTION__ = "virtual bool QApplication::notify(QObject*, QEvent*)"
        res = <optimized out>
#7  0xb458b6d0 in sipQApplication::notify (this=0x85cb260, a0=0x85a0150, a1=0xbfffdc80) at sipQtWidgetspart9.cpp:6381
        sipGILState = (unknown: 3071115264)
        sipMeth = <optimized out>
#8  0xb6e94aea in QCoreApplication::notifyInternal (this=0x85cb260, receiver=receiver at entry=0x85a0150, event=event at entry=0xbfffdc80) at kernel/qcoreapplication.cpp:881
        threadData = 0x857de50
        loopLevelCounter = {threadData = 0x857de50}
        result = false
        cbdata = {0x85a0150, 0xbfffdc80, 0xbfffdc03}
        d = <optimized out>
#9  0xb3e7127c in sendEvent (event=0xbfffdc80, receiver=0x85a0150) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:232
No locals.
#10 QWidget::setParent (this=this at entry=0x85a0150, parent=parent at entry=0x85956a8, f=...) at kernel/qwidget.cpp:9678
        e = {_vptr.QEvent = 0xb70d56c0 <vtable for QEvent+8>, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0xb7044dc0 <qt_meta_stringdata_QEvent>, 
              data = 0xb7044840 <qt_meta_data_QEvent>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}, d = 0x0, t = 21, posted = 0, spont = 0, 
          m_accept = 1, reserved = 6143}
        oldtlw = <optimized out>
        desktopWidget = 0x0
        oldBsTracker = <optimized out>
        newParent = <optimized out>
#11 0xb3e71ec7 in QWidget::setParent (this=this at entry=0x85a0150, parent=parent at entry=0x85956a8) at kernel/qwidget.cpp:9561
No locals.
#12 0xb3e4fc4c in QLayout::addChildWidget (this=this at entry=0x874e720, w=w at entry=0x85a0150) at kernel/qlayout.cpp:895
        mw = 0x85956a8
        pw = <optimized out>
        needShow = false
#13 0xb3fab9aa in QMainWindowLayout::addDockWidget (this=0x874e720, area=area at entry=Qt::RightDockWidgetArea, dockwidget=dockwidget at entry=0x85a0150, 
    orientation=orientation at entry=Qt::Vertical) at widgets/qmainwindowlayout.cpp:1071
No locals.
#14 0xb3fa80ae in QMainWindow::addDockWidget (this=this at entry=0x85956a8, area=area at entry=Qt::RightDockWidgetArea, dockwidget=dockwidget at entry=0x85a0150, 
    orientation=orientation at entry=Qt::Vertical) at widgets/qmainwindow.cpp:1126
No locals.
#15 0xb3fa812b in QMainWindow::addDockWidget (this=0x85956a8, area=Qt::RightDockWidgetArea, dockwidget=0x85a0150) at widgets/qmainwindow.cpp:1084
        orientation = Qt::Vertical
#16 0xb46ce78c in meth_QMainWindow_addDockWidget (sipSelf=0xb49284b4, sipArgs=0xb7843a7c) at sipQtWidgetspart4.cpp:34876
        a0 = Qt::RightDockWidgetArea
        a1 = 0x85a0150
        sipCpp = 0x85956a8
        sipParseErr = 0x0
#17 0x080f17e0 in PyCFunction_Call (func=0xb4906264, arg=0xb7843a7c, kw=0x0) at ../Objects/methodobject.c:93
        f = 0xb4906264
        meth = 0xb46ce5f0 <meth_QMainWindow_addDockWidget(PyObject*, PyObject*)>
        self = 0xb49284b4
        res = 0xb7843a7c
        size = -1278588124
        __PRETTY_FUNCTION__ = "PyCFunction_Call"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: text/x-python
Size: 551 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140330/b4bf627b/attachment.py>


More information about the PyQt mailing list