title: Application crashes - Webcore - iOS 5.1.1
body: <p>Application is crashing on webcore, In our application we are loading HTML5 page on UIWebview. When the user navigate to different screens on UIWebView, application gives alert pop up, and when user click on OK button, it crashes.</p>
  
  <p>PS Note: This alert is HTML5 alert. Not native.</p>
  
  <pre><code>Thread 2 name:  WebThread
  Thread 2 Crashed:
  
  
  0   JavaScriptCore                    0x3570ec26 WTF::fastMalloc(unsigned long) + 870
  
  1   WebCore                           0x32cf731c WebCore::CSSSelectorList::adoptSelectorVector(WTF::Vector&lt;WTF::OwnPtr&lt;WebCore::CSSParserSelector&gt;, 0ul&gt;&amp;) + 136
  
  2   WebCore                           0x32ceee10 cssyyparse(void*) + 848
  
  3   WebCore                           0x32de641a WebCore::CSSParser::parseSelector(WTF::String const&amp;, WebCore::Document*, WebCore::CSSSelectorList&amp;) + 74
  
  4   WebCore                           0x32de636e WebCore::Node::querySelectorAll(WTF::String const&amp;, int&amp;) + 90
  
  5   WebCore                           0x32de62a8 WebCore::jsElementPrototypeFunctionQuerySelectorAll(JSC::ExecState*) + 328
  
  6   JavaScriptCore                    0x35721592 JSC::Interpreter::privateExecute(JSC::Interpreter::ExecutionFlag, JSC::RegisterFile*, JSC::ExecState*) + 35526
  
  7   JavaScriptCore                    0x357a00e6 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) + 1042
  
  8   JavaScriptCore                    0x3579fcca JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&amp;, JSC::JSValue, JSC::ArgList const&amp;) + 46
  
  9   WebCore                           0x32e28cfc WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) + 776
  
  10  WebCore                           0x32e289c0 WebCore::EventTarget::fireEventListeners(WebCore::Event*, WebCore::EventTargetData*, WTF::Vector&lt;WebCore::RegisteredEventListener, 1ul&gt;&amp;) + 272
  
  11  WebCore                           0x32d2f36c WebCore::EventTarget::fireEventListeners(WebCore::Event*) + 136
  
  12  WebCore                           0x32d358de WebCore::Node::handleLocalEvents(WebCore::Event*) + 54
  
  13  WebCore                           0x32d3512e WebCore::EventDispatcher::dispatchEvent(WTF::PassRefPtr&lt;WebCore::Event&gt;) + 542
  
  14  WebCore                           0x32d34ee0 WebCore::EventDispatchMediator::dispatchEvent(WebCore::EventDispatcher*) const + 24
  
  15  WebCore                           0x32d34eb4 WebCore::EventDispatcher::dispatchEvent(WebCore::Node*, WebCore::EventDispatchMediator const&amp;) + 92
  
  16  WebCore                           0x32d34e0c WebCore::Node::dispatchEvent(WTF::PassRefPtr&lt;WebCore::Event&gt;) + 28
  17  WebCore                           0x32d87eb8 WebCore::Document::finishedParsing() + 96
  18  WebCore                           0x32d87e50 WebCore::HTMLTreeBuilder::finished() + 16
  19  WebCore                           0x32d78fbe WebCore::HTMLDocumentParser::prepareToStopParsing() + 106
  20  WebCore                           0x32d78c9e WebCore::HTMLDocumentParser::finish() + 90
  21  WebCore                           0x32d78c3a WebCore::Document::finishParsing() + 14
  22  WebCore                           0x32d75e62 WebCore::DocumentWriter::endIfNotLoadingMainResource() + 74
  23  WebCore                           0x32d744fa WebCore::DocumentLoader::finishedLoading() + 74
  24  WebCore                           0x32dc19c8 WebCore::FrameLoader::finishedLoading() + 48
  25  WebCore                           0x32dc1938 WebCore::MainResourceLoader::didFinishLoading(double) + 88
  26  WebCore                           0x32dc18c2 _ZN7WebCoreL16didFinishLoadingEP16_CFURLConnectionPKv + 46
  27  CFNetwork                         0x371097ee URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 186
  28  CFNetwork                         0x370fe49e URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo&lt;XClientEvent, XClientEventParams&gt;*, long) + 418
  29  CFNetwork                         0x370fe19c URLConnectionClient::processEvents() + 100
  30  CFNetwork                         0x370fe0d2 MultiplexerSource::perform() + 150
  31  CoreFoundation                    0x37445acc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
  32  CoreFoundation                    0x37445298 __CFRunLoopDoSources0 + 208
  33  CoreFoundation                    0x3744403e __CFRunLoopRun + 646
  34  CoreFoundation                    0x373c749e CFRunLoopRunSpecific + 294
  35  CoreFoundation                    0x373c7366 CFRunLoopRunInMode + 98
  36  WebCore                           0x32d70c9c _ZL12RunWebThreadPv + 396
  37  libsystem_c.dylib                 0x33ce672e _pthread_start + 314
  38  libsystem_c.dylib                 0x33ce65e8 thread_start + 0
  </code></pre>
  
  <p>With the crash log, It is getting really hard to figure out the exact cause. Please help..</p>