PDA

View Full Version : Crash somewhere under sendPostedEvents(), Network related



Vinny
7th June 2012, 15:45
Hi all,

I'm currently working on an application that for historical reasons embeds a simple web server (based on QTcpServer) and a bunch of QWebViews. So yes, all of these are running in different threads of the main application.
Since some time now we're trying to nail down a crash bug which seems to be thread related. On some computers (mainly WinXP platforms) it seems to happen all the time while on others (like WinSeven) it can be tricky and time-consuming to reproduce.

The stack is not much from a help, though the main common point is the sendPostedEvents() function, and the crash itself which happens always in a strcmp() call. The rest of the stack may change from one crash to the other. Here is an example :


0 strcmp C:\Windows\syswow64\msvcrt.dll 0 0x75e68c19
1 ?? 0 0x17088290
2 WebCore::setUpIterator(WebCore::TextBreakIterator&, QTextBoundaryFinder::BoundaryType, wchar_t const*, int) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb646e50
3 WebCore::characterBreakIterator(wchar_t const*, int) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb64702a
4 WebCore::String::numCharactersInGraphemeClusters(u nsigned int) const C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb53ee9d
5 WebCore::InputElement::sanitizeUserInputValue(WebC ore::InputElement const*, WebCore::String const&, int) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb348028
6 WebCore::InputElement::sanitizeValue(WebCore::Inpu tElement const*, WebCore::String const&) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb347f00
7 WebCore::HTMLInputElement::sanitizeValue(WebCore:: String const&) const C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb427b3a
8 WebCore::HTMLInputElement::setValue(WebCore::Strin g const&, bool) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb425012
9 WebCore::setJSHTMLInputElementValue(JSC::ExecState *, JSC::JSObject*, JSC::JSValue) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb1a3af1
10 bool JSC::lookupPut<WebCore::JSHTMLInputElement>(JSC::ExecState*, JSC::Identifier const&, JSC::JSValue, JSC::HashTable const*, WebCore::JSHTMLInputElement*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb927041
11 void JSC::lookupPut<WebCore::JSHTMLInputElement, WebCore::JSHTMLElement>(JSC::ExecState*, JSC::Identifier const&, JSC::JSValue, JSC::HashTable const*, WebCore::JSHTMLInputElement*, JSC::PutPropertySlot&) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb927075
12 WebCore::JSHTMLInputElement::put(JSC::ExecState*, JSC::Identifier const&, JSC::JSValue, JSC::PutPropertySlot&) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb1a2e33
13 JSC::JSValue::put(JSC::ExecState*, JSC::Identifier const&, JSC::JSValue, JSC::PutPropertySlot&) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb917af3
14 cti_op_put_by_id C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb852c53
15 ?? 0 0x18073a4d
16 JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*, JSC::JSGlobalData*, JSC::JSValue*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb916ef1
17 JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::ScopeChainNode*, JSC::JSObject*, JSC::JSValue*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb802f9a
18 JSC::evaluate(JSC::ExecState*, JSC::ScopeChain&, JSC::SourceCode const&, JSC::JSValue) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb8010ad
19 WebCore::ScriptController::evaluateInWorld(WebCore ::ScriptSourceCode const&, WebCore::DOMWrapperWorld*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb2a0d2b
20 WebCore::ScriptController::evaluate(WebCore::Scrip tSourceCode const&) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb2a0efc
21 WebCore::ScriptController::executeScript(WebCore:: ScriptSourceCode const&) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb2a7c1f
22 WebCore::HTMLTokenizer::scriptExecution(WebCore::S criptSourceCode const&, WebCore::HTMLTokenizer::State) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb44befa
23 WebCore::HTMLTokenizer::executeExternalScriptsIfRe ady() C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb451dd0
24 WebCore::HTMLTokenizer::notifyFinished(WebCore::Ca chedResource*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb451ba5
25 WebCore::CachedScript::checkNotify() C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb47cf1a
26 WebCore::CachedScript::data(WTF::PassRefPtr<WebCore::SharedBuffer>, bool) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb47ceb1
27 WebCore::Loader::Host::didFinishLoading(WebCore::S ubresourceLoader*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb4a3ad9
28 WebCore::SubresourceLoader::didFinishLoading() C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb4af359
29 WebCore::ResourceLoader::didFinishLoading(WebCore: :ResourceHandle*) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb4add10
30 WebCore::QNetworkReplyHandler::finish() C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb62f236
31 WebCore::QNetworkReplyHandler::qt_metacall(QMetaOb ject::Call, int, void**) C:\Applications\Qt\2010.05\qt\bin\QtWebKitd4.dll 0 0xb6316b2
32 QMetaObject::metacall qmetaobject.cpp 237 0x6a20445c
33 QMetaObject::activate qobject.cpp 3272 0x6a214bbe
34 QNetworkReply::finished moc_qnetworkreply.cpp 152 0x68097851
35 QNetworkReplyImplPrivate::finished qnetworkreplyimpl.cpp 656 0x68046fcb
36 QNetworkAccessBackend::finished qnetworkaccessbackend.cpp 309 0x680317b6
37 QNetworkAccessHttpBackend::finished qnetworkaccesshttpbackend.cpp 338 0x68037895
38 QNetworkAccessHttpBackend::replyFinished qnetworkaccesshttpbackend.cpp 773 0x6803a597
39 QNetworkAccessHttpBackend::downstreamReadyWrite qnetworkaccesshttpbackend.cpp 710 0x6803a144
40 QNetworkReplyImplPrivate::handleNotifications qnetworkreplyimpl.cpp 367 0x68045cc9
41 QNetworkReplyImpl::event qnetworkreplyimpl.cpp 866 0x68047da8
42 QApplicationPrivate::notify_helper qapplication.cpp 4396 0x2399706
43 QApplication::notify qapplication.cpp 3798 0x2397012
44 QCoreApplication::notifyInternal qcoreapplication.cpp 732 0x6a1ff9dc
45 QCoreApplication::sendEvent qcoreapplication.h 215 0x6a265fbc
46 QCoreApplicationPrivate::sendPostedEvents qcoreapplication.cpp 1373 0x6a200a87
47 qt_internal_proc qeventdispatcher_win.cpp 503 0x6a222d2e
48 USER32!OffsetRect C:\Windows\syswow64\user32.dll 0 0x754462fa
49 Ui_PreferencesDialog::setupUi ui_preferencesdialog.h 568 0x570bc0
50 USER32!IsWindow C:\Windows\syswow64\user32.dll 0 0x75446d3a
51 qt_fast_timer_proc qeventdispatcher_win.cpp 432 0x6a222a8a
52 USER32!AnyPopup C:\Windows\syswow64\user32.dll 0 0x754477c4
53 ?? 0


When searching for information, I came accross a bug on the Qt bugtracker : https://bugreports.qt-project.org/browse/QTBUG-18412. But I'm really not sure this is related.
After trying to upgrade to Qt 4.7.4, I could see the issue is still there.

I am completely lost about what lead I could follow to identify the problem.

Vinny
18th June 2012, 10:05
I am still not sure what exactly was my problem, but FYI upgrading to Qt 4.8.1 solved the issue, and enhanced performances as well.