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

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.