[PyQt] Qwebview crashes almost always when entering Facebook apps

Hans-Peter Jansen hpj at urpla.net
Sun Mar 27 21:52:40 BST 2011


On Saturday 26 March 2011, 23:45:04 Gelonida Gmail wrote:
> I have now an even simper version of my program, which still crashes.
> However today it crashes less often than before. There is some random
> factor involved.
>
>
> # Error description:
> #
> # 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.
> #
> # rather often (but not always) the application segfaults
> #
> import sys
> import platform
> import PyQt4.QtGui as QtGui
> import PyQt4.QtCore as QtCore
> from PyQt4.QtWebKit import QWebView
>
> print sys.platform, platform.release()
> print QtCore.PYQT_VERSION_STR,QtCore.PYQT_VERSION
>
> app = QtGui.QApplication(sys.argv)
> webview = QWebView()
> urlstr = "http://apps.facebook.com/be-heroic"
> webview.setUrl(QtCore.QUrl(urlstr))
> webview.show()
> sys.exit(app.exec_())
>
>
> I wrote also an equivalent C++ version, and managed to crash it
> (though I had to try over 10 times before I got a segfault)

Well, I can always reproduce a crash be simply logging in, and when the 
request for permission of Heroic! is requested, just click on start 
page at the top. During display of the homepage, it crashes reliable 
here for both the PyQt and the Qt version:

#0  0xb702ac80 in JSC::Interpreter::prepareForRepeatCall(JSC::FunctionExecutable*, JSC::ExecState*, JSC::JSFunction*, int, 
JSC::ScopeChainNode*, JSC::JSValue*) () from /usr/lib/libQtWebKit.so.4
#1  0xb70964a7 in JSC::JSArray::sort(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&) ()
   from /usr/lib/libQtWebKit.so.4
#2  0xb705f19e in JSC::arrayProtoFuncSort(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, JSC::ArgList const&) ()
   from /usr/lib/libQtWebKit.so.4
#3  0xb2aca16e in ?? ()
#4  0xb702b993 in JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::ScopeChainNode*, JSC::JSObject*, JSC::JSValue*) () 
from /usr/lib/libQtWebKit.so.4
#5  0xb708fd13 in JSC::evaluate(JSC::ExecState*, JSC::ScopeChain&, JSC::SourceCode const&, JSC::JSValue) ()
   from /usr/lib/libQtWebKit.so.4
#6  0xb718023e in WebCore::evaluateInWorld(JSC::ExecState*, JSC::ScopeChain&, JSC::SourceCode const&, JSC::JSValue, WebCore::DOMWrapperWorld*) 
() from /usr/lib/libQtWebKit.so.4
#7  0xb718ea66 in WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld*) () 
from /usr/lib/libQtWebKit.so.4
#8  0xb718ecd9 in WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&) ()
   from /usr/lib/libQtWebKit.so.4
#9  0xb729af9f in WebCore::ScriptElementData::evaluateScript(WebCore::ScriptSourceCode const&) ()
   from /usr/lib/libQtWebKit.so.4
#10 0xb729b4de in WebCore::ScriptElementData::execute(WebCore::CachedScript*) () from /usr/lib/libQtWebKit.so.4
#11 0xb72542a2 in WebCore::Document::executeScriptSoonTimerFired(WebCore::Timer<WebCore::Document>*) ()
   from /usr/lib/libQtWebKit.so.4
#12 0xb7242531 in WebCore::Timer<WebCore::Document>::fired() () from /usr/lib/libQtWebKit.so.4
#13 0xb75235fd in WebCore::ThreadTimers::sharedTimerFiredInternal() () from /usr/lib/libQtWebKit.so.4
#14 0xb7523662 in WebCore::ThreadTimers::sharedTimerFired() () from /usr/lib/libQtWebKit.so.4
#15 0xb764b5d6 in WebCore::SharedTimerQt::timerEvent(QTimerEvent*) () from /usr/lib/libQtWebKit.so.4
#16 0xb5cf2a44 in QObject::event (this=0x80cead8, e=0xbfffe8dc) at kernel/qobject.cpp:1212
#17 0xb5f37d3c in QApplicationPrivate::notify_helper (this=0x804d9b8, receiver=0x80cead8, e=0xbfffe8dc)
    at kernel/qapplication.cpp:4302

> The C++ version is
>
> #include <QtGui>
> #include <QtWebKit/QWebView>
>
> #define urlstr "http://apps.facebook.com/be-heroic"
>
> int main(int argc, char **argv)
> {
>
>     QApplication app(argc, argv);
> 	QWebView *webview = new QWebView();
> 	webview->load( QUrl(urlstr));
> 	webview->show();
>
>     return app.exec();
> }
>
> The related project file for qmake is
> CONFIG += qt
> SOURCES += webview.cc
> TARGET = webview
> QT += webkit
>
> > On 3/25/2011 12:21 AM, Hans-Peter Jansen wrote:
> >> On Thursday 24 March 2011, 23:52:53 Gelonida wrote:
> >>> Hi I have a rather small (mostly crashing) script with a
> >>> Can anybody else reproduce this?
> >>
> >> Confirmed:
> >> python: 2.6
> >> sip: 4.12.1
> >> qt4: 4.6.3
> >> pyqt4: snapshot-4.8.4-278054fd857c
> >>
> >>
> >> Given the simpleness of your script, 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
>
> Will now look, where I can post the Qt bug

I've added my observations there, too.

Pete


More information about the PyQt mailing list