[PyQt] Segfaults when (dis)connecting signals on deleted QWebFrame

Florian Bruhin me at the-compiler.org
Tue Dec 2 19:30:46 GMT 2014


Some weeks ago I had some issues with segfaults when disconnecting
QWebFrame::contentSizeChanged. I now finally was able to reproduce it
and wrote a little example script which is attached.

When running it, and after the output (connecting/disconnecting)
begins clicking any link on the page, there's a segfault with the
attached stacktrace. In the wild I've also seen this happen without
actually changing the page, but I can't reliably reproduce that.

What's going on there? Is this a PyQt or a Qt bug? I'd expect to get a
RuntimeError telling me the underlying object has been deleted by Qt.


http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
             GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
#0  0x0000000000b3ccd0 in ?? ()
#1  0x00007ffff5f50cbd in QObject::disconnect (sender=0x1000820, signal=<optimized out>, receiver=0xa2cfd0, method=0x20e8ab9 "on_size_changed()") at kernel/qobject.cpp:2922
#2  0x00007ffff65445db in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#3  0x00007ffff6545086 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#4  0x00007ffff7a5c609 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffbc80) at Python/ceval.c:4234
#5  PyEval_EvalFrameEx (f=0x8069c8, throwflag=<optimized out>) at Python/ceval.c:2836
#6  0x00007ffff7a5d859 in PyEval_EvalCodeEx (_co=0x1000820, globals=0x1, locals=0x806b40, args=0x7ffff68518e8, argcount=24, kws=0x2288d70, kws at entry=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0)
    at Python/ceval.c:3585
#7  0x00007ffff79cf2f9 in function_call (func=0x7fffebe92510, arg=0x7ffff68518d0, kw=0x0) at Objects/funcobject.c:632
#8  0x00007ffff79a6ff8 in PyObject_Call (func=func at entry=0x7fffebe92510, arg=arg at entry=0x7ffff68518d0, kw=kw at entry=0x0) at Objects/abstract.c:2067
#9  0x00007ffff79bc28d in method_call (func=0x7fffebe92510, arg=0x7ffff68518d0, kw=0x0) at Objects/classobject.c:347
#10 0x00007ffff79a6ff8 in PyObject_Call (func=func at entry=0x7ffff7f04c08, arg=arg at entry=0x7ffff7f7b048, kw=0x0) at Objects/abstract.c:2067
#11 0x00007ffff7a54937 in PyEval_CallObjectWithKeywords (func=0x7ffff7f04c08, arg=0x7ffff7f7b048, kw=<optimized out>) at Python/ceval.c:4111
#12 0x00007ffff6548a60 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#13 0x00007ffff6548f08 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#14 0x00007ffff65490bc in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#15 0x00007ffff654ba97 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#16 0x00007ffff654bb82 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#17 0x00007ffff5f4df3e in QMetaObject::activate (sender=sender at entry=0x7b48f0, signalOffset=<optimized out>, local_signal_index=local_signal_index at entry=0, argv=argv at entry=0x0) at kernel/qobject.cpp:3696
#18 0x00007ffff5f4e2d7 in QMetaObject::activate (sender=sender at entry=0x7b48f0, m=m at entry=0x7ffff6363780 <QTimer::staticMetaObject>, local_signal_index=local_signal_index at entry=0, argv=argv at entry=0x0)
    at kernel/qobject.cpp:3547
#19 0x00007ffff5fc4010 in QTimer::timeout (this=this at entry=0x7b48f0) at .moc/moc_qtimer.cpp:191
#20 0x00007ffff5f5ad88 in QTimer::timerEvent (this=0x7b48f0, e=<optimized out>) at kernel/qtimer.cpp:255
#21 0x00007ffff643b5cb in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#22 0x00007ffff5f4ee63 in QObject::event (this=0x7b48f0, e=<optimized out>) at kernel/qobject.cpp:1263
#23 0x00007ffff643b52b in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtCore.so
#24 0x00007ffff0d34514 in QApplicationPrivate::notify_helper (this=0x983ca0, receiver=0x7b48f0, e=0x7fffffffc680) at kernel/qapplication.cpp:3499
#25 0x00007ffff0d39c70 in QApplication::notify (this=0x97b570, receiver=0x7b48f0, e=0x7fffffffc680) at kernel/qapplication.cpp:3282
#26 0x00007ffff1805446 in ?? () from /usr/lib/python3.4/site-packages/PyQt5/QtWidgets.so
#27 0x00007ffff5f202dd in QCoreApplication::notifyInternal (this=0x97b570, receiver=0x7b48f0, event=event at entry=0x7fffffffc680) at kernel/qcoreapplication.cpp:935
#28 0x00007ffff5f7625d in sendEvent (event=0x7fffffffc680, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:237
#29 QTimerInfoList::activateTimers (this=0x9abda0) at kernel/qtimerinfo_unix.cpp:643
#30 0x00007ffff5f76731 in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:185
#31 0x00007ffff4a95a0d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#32 0x00007ffff4a95cf8 in ?? () from /usr/lib/libglib-2.0.so.0
#33 0x00007ffff4a95dac in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#34 0x00007ffff5f76c97 in QEventDispatcherGlib::processEvents (this=0x9abd20, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#35 0x00007ffff5f1e722 in QEventLoop::exec (this=this at entry=0x7fffffffc8d0, flags=..., flags at entry=...) at kernel/qeventloop.cpp:212
#36 0x00007ffff5f25fec in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1188

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qwebframe_segfault.py
Type: text/x-python
Size: 1411 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20141202/683b91bb/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20141202/683b91bb/attachment.sig>

More information about the PyQt mailing list