[PyQt] Qwebview crashes almost always when entering Facebook apps

Hans-Peter Jansen hpj at urpla.net
Sun Apr 3 23:23:59 BST 2011

On Sunday 03 April 2011, 22:49:44 Gelonida Gmail wrote:
> Nokia considers this bug not being their problem, but a webkit issue.
> Therefore I filed a new bug report for webkit.
> https://bugs.webkit.org/show_bug.cgi?id=57729

Hi Phil,

I was able to simplify the issue even further, and usually just 
clicking on the homepage link on the login page (after logging in)
crashes in the JS core, but now, this code crashes reliable in the
webview.show() line over here: 

import sys
import platform
import PyQt4.QtGui as QtGui
import PyQt4.QtCore as QtCore
from PyQt4.QtWebKit import QWebView

print sys.platform, platform.release()

app = QtGui.QApplication(sys.argv)
webview = QWebView()
urlstr = "http://facebook.com"

While switched meanwhile to:
python: 2.6
sip: 4.12.2-snapshot-ec9807971e08
qt4: 4.7.1
pyqt4: snapshot-4.8.4-8641ecc135b3

I'm harvesting this:

~> gdb python
(gdb) run
Starting program: /usr/bin/python 
[Thread debugging using libthread_db enabled]
Python 2.6 (r26:66714, Feb 17 2011, 11:14:04) 
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import platform
>>> import PyQt4.QtGui as QtGui
>>> import PyQt4.QtCore as QtCore
>>> from PyQt4.QtWebKit import QWebView
>>> print sys.platform, platform.release()
snapshot-4.8.4-8641ecc135b3 264196
>>> app = QtGui.QApplication(sys.argv)
>>> webview = QWebView()
>>> urlstr = "http://facebook.com"
>>> webview.setUrl(QtCore.QUrl(urlstr))
[New Thread 0xb44e4b90 (LWP 21284)]
[New Thread 0xb357fb90 (LWP 21285)]
>>> webview.show()
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xb5530d85 in WebCore::SharedTimerQt::destroy() () from /usr/lib/libQtWebKit.so.4
#2  0xb5530e15 in WebCore::SharedTimerQt::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtWebKit.so.4
#3  0xb670c2b5 in QMetaObject::metacall (object=0x82c3e38, cl=QMetaObject::InvokeMetaMethod, idx=4, argv=0xbfffe668)
    at kernel/qmetaobject.cpp:237
#4  0xb671ef33 in QMetaObject::activate (sender=0x829f2f8, m=0xb6840484, local_signal_index=0, argv=0x0)
    at kernel/qobject.cpp:3272
#5  0xb6772567 in QCoreApplication::aboutToQuit (this=0x829f2f8) at .moc/release-shared/moc_qcoreapplication.cpp:131
#6  0xb6709538 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1014
#7  0xb5e96dc0 in qtcore_input_hook ()
    at /usr/src/debug/PyQt-x11-gpl-snapshot-4.8.4-8641ecc135b3/sip/QtCore/qcoreapplication.sip:397
#8  0xb7fd4d61 in call_readline (sys_stdin=0xb7dea420, sys_stdout=0xb7dea4c0, prompt=0xb7c442f4 ">>> ")
    at /usr/src/debug/Python-2.6/Modules/readline.c:858
#9  0xb7e60ce2 in PyOS_Readline (sys_stdin=0xb7dea420, sys_stdout=0xb7dea4c0, prompt=0xb7c442f4 ">>> ")
    at Parser/myreadline.c:208
#10 0xb7e633e5 in tok_nextc (tok=0x8332110) at Parser/tokenizer.c:784
#11 0xb7e61d65 in PyTokenizer_Get (tok=0x8332110, p_start=0xbfffe9c8, p_end=0xbfffe9c4) at Parser/tokenizer.c:1131
#12 0xb7e5e55c in parsetok (tok=0x8332110, g=<value optimized out>, start=256, err_ret=0xbfffea0c, flags=0xbfffea28)
    at Parser/parsetok.c:159
#13 0xb7f1198b in PyParser_ASTFromFile (fp=0xb7dea420, filename=0xb7f4f1af "<stdin>", start=256, 
    ps1=0xb7c442f4 ">>> ", ps2=0xb7c44334 "... ", flags=0xbfffebe8, errcode=0xbfffea88, arena=0x8076008)
    at Python/pythonrun.c:1450
#14 0xb7f1459a in PyRun_InteractiveOneFlags (fp=0xb7dea420, filename=0xb7f4f1af "<stdin>", flags=0xbfffebe8)
    at Python/pythonrun.c:816
#15 0xb7f147e8 in PyRun_InteractiveLoopFlags (fp=0xb7dea420, filename=0xb7f4f1af "<stdin>", flags=0xbfffebe8)
    at Python/pythonrun.c:756
#16 0xb7f1287f in PyRun_AnyFileExFlags (fp=0xb7dea420, filename=0xb7f4f1af "<stdin>", closeit=0, flags=0xbfffebe8)
    at Python/pythonrun.c:725
#17 0xb7f1ee52 in Py_Main (argc=0, argv=0xbfffecb4) at Modules/main.c:597
#18 0x08048692 in main (argc=-1244451448, argv=0x8315d50) at Modules/python.c:23

I don't hope, this is due to my rather oldish Python version, but the
rest is pretty current from what I can see.

Can you reproduce this? Btw, another (much more complex) webkit based 
application is still working fine, hence it might still be related to
the facebook site.

While at it, it would be nice, if you would be able to wrap 
QTWEBKIT_VERSION and QTWEBKIT_VERSION_STR for easier investigation/
reporting. They're not redundant, since qWebKitVersion() will return 
some strange Safari version code (e.g. 533.3), while this is QtWebKit 
version 2.0.1.


More information about the PyQt mailing list