[PyQt] Qwebview crashes almost always when entering Facebook apps

Hans-Peter Jansen hpj at urpla.net
Thu Mar 24 23:21:14 GMT 2011


On Thursday 24 March 2011, 23:52:53 Gelonida wrote:
> Hi I have a rather small (mostly crashing) script with a
> QWebViewwidget.
>
> # beginning of script
> import sys
> import platform
> import PyQt4.QtGui as QtGui
> import PyQt4.QtCore as QtCore
> from PyQt4.QtWebKit import QWebView
>
> class MyMainWindow(QtGui.QMainWindow):
>      def __init__(self, parent=None):
>          super(MyMainWindow, self).__init__(parent)
>          self.setWindowTitle("Simple Crasher")
>          self.webview = QWebView()
>          self.setCentralWidget(self.webview)
>          # I tried with two face book apps so you can probably
>          # reproduce with another facebook app
>          urlstr ="http://apps.facebook.com/be-heroic"
>          self.webview.setUrl(QtCore.QUrl(urlstr))
>
>
> print sys.platform, platform.release()
> print QtCore.PYQT_VERSION_STR,QtCore.PYQT_VERSION
> app = QtGui.QApplication(sys.argv)
> window = MyMainWindow()
> window.show()
> sys.exit(app.exec_())
> # end of script
>
>
> The url points to a facebook application.
> I tried with the url in the sample script, but failed also with other
> facebook applications.
>
> What happens:
>
> After starting the script a login screen shows up
> (email address and password field in the top right corner of the
> dispay) after a few seconds the layout changes and the emailaddress
> and password field are in the middle of the screen
>
> I enter email address and password of my facebook account and click
> on connect.
>
> In 90 % of the cases the script crashes without any python back trace
> or error message.
>
>
> Example output:
> linux2 2.6.32-29-generic
> 4.7.2 263938
> Segmentation fault (core dumped)
>
> The application crashes also under windows where the output would be
> win32 post2008Server
> 4,7 263936
>
> Can anybody else reproduce this?

Confirmed: 
python: 2.6
sip: 4.12.1
qt4: 4.6.3
pyqt4: snapshot-4.8.4-278054fd857c

#0  0xb4e97c80 in JSC::Interpreter::prepareForRepeatCall(JSC::FunctionExecutable*, JSC::ExecState*, JSC::JSFunction*, int, 
JSC::ScopeChainNode*, JSC::JSValue*) () from /usr/lib/libQtWebKit.so.4
#1  0xb4f034a7 in JSC::JSArray::sort(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&) ()
   from /usr/lib/libQtWebKit.so.4
#2  0xb4ecc19e in JSC::arrayProtoFuncSort(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, JSC::ArgList const&) ()
   from /usr/lib/libQtWebKit.so.4
#3  0xb7b9d16e in ?? ()
#4  0xb4e98993 in JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::ScopeChainNode*, JSC::JSObject*, JSC::JSValue*) () 
from /usr/lib/libQtWebKit.so.4
#5  0xb4efcd13 in JSC::evaluate(JSC::ExecState*, JSC::ScopeChain&, JSC::SourceCode const&, JSC::JSValue) ()
   from /usr/lib/libQtWebKit.so.4
#6  0xb4fed23e in WebCore::evaluateInWorld(JSC::ExecState*, JSC::ScopeChain&, JSC::SourceCode const&, JSC::JSValue, WebCore::DOMWrapperWorld*) 
() from /usr/lib/libQtWebKit.so.4
#7  0xb4ffba66 in WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld*) () 
from /usr/lib/libQtWebKit.so.4
#8  0xb4ffbcd9 in WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&) ()
   from /usr/lib/libQtWebKit.so.4
#9  0xb5107f9f in WebCore::ScriptElementData::evaluateScript(WebCore::ScriptSourceCode const&) ()
   from /usr/lib/libQtWebKit.so.4
#10 0xb51084de in WebCore::ScriptElementData::execute(WebCore::CachedScript*) () from /usr/lib/libQtWebKit.so.4
#11 0xb50c12a2 in WebCore::Document::executeScriptSoonTimerFired(WebCore::Timer<WebCore::Document>*) ()
   from /usr/lib/libQtWebKit.so.4
#12 0xb50af531 in WebCore::Timer<WebCore::Document>::fired() () from /usr/lib/libQtWebKit.so.4
#13 0xb53905fd in WebCore::ThreadTimers::sharedTimerFiredInternal() () from /usr/lib/libQtWebKit.so.4
#14 0xb5390662 in WebCore::ThreadTimers::sharedTimerFired() () from /usr/lib/libQtWebKit.so.4
#15 0xb54b85d6 in WebCore::SharedTimerQt::timerEvent(QTimerEvent*) () from /usr/lib/libQtWebKit.so.4
#16 0xb6793a44 in QObject::event (this=0x832a3f8, e=0xbfffe34c) at kernel/qobject.cpp:1212
#17 0xb69d8d3c in QApplicationPrivate::notify_helper (this=0x82a5700, receiver=0x832a3f8, e=0xbfffe34c)
    at kernel/qapplication.cpp:4302
#18 0xb69e0516 in QApplication::notify (this=0x815bd68, receiver=0x832a3f8, e=0xbfffe34c)
    at kernel/qapplication.cpp:3706
#19 0xb78830de in sipQApplication::notify (this=0x815bd68, a0=0x832a3f8, a1=0xbfffe34c) at sipQtGuiQApplication.cpp:297
#20 0xb678292b in QCoreApplication::notifyInternal (this=0x815bd68, receiver=0x832a3f8, event=0xbfffe34c)
    at kernel/qcoreapplication.cpp:726
#21 0xb67b31d6 in QTimerInfoList::activateTimers (this=0x82ade84) at kernel/qcoreapplication.h:215
#22 0xb67af727 in idleTimerSourceDispatch (source=0x82adeb8) at kernel/qeventdispatcher_glib.cpp:184
#23 0xb630f845 in g_main_context_dispatch (context=0x82ad290) at gmain.c:2440
#24 0xb6313d9b in g_main_context_iterate (context=0x82ad290, block=1, dispatch=1, self=0x82aaea8) at gmain.c:3091
#25 0xb6314018 in g_main_context_iteration (context=0x82ad290, may_block=1) at gmain.c:3154
#26 0xb67af3f1 in QEventDispatcherGlib::processEvents (this=0x82aaf70, flags={i = -1073748728})
    at kernel/qeventdispatcher_glib.cpp:412
#27 0xb6a97a85 in QGuiEventDispatcherGlib::processEvents (this=0x82aaf70, flags={i = -1073748680})
    at kernel/qguieventdispatcher_glib.cpp:204
#28 0xb6780f3a in QEventLoop::processEvents (this=0xbfffe5b0, flags={i = -1073748616}) at kernel/qeventloop.cpp:149
#29 0xb6781382 in QEventLoop::exec (this=0xbfffe5b0, flags={i = -1073748552}) at kernel/qeventloop.cpp:201


Given the simpleness of your sccript, and since this happens deep 
under the covers in the javascript core, a *Qt* bugreport would be 
in order. That requires a C++ version, though. If that version works, 
then Phil is to blame, but I doubt that.

Leaving a pointer to the report here would be nice.

Pete


More information about the PyQt mailing list