title: uiwebview webthread crashing
body: <p>My App with an UIWebView is crashing a lot. The crash is often slightly different, but it's always a crash of the "WebThread" with a similar stack trace.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/8100285/ios-uiwebview-crash-in-webthread">this</a> question but I don't think it's my case, I have iOS 6 and I'm not loading Office documents.
  I'm using websocket to send messages to a server and using ajax commet to receive messages from a server.</p>
  
  <p>The crashes always happen when I'm starting that connections.</p>
  
  <pre><code>Date/Time:       2012-10-01 14:18:07.184 -0300
  OS Version:      iOS 6.0 (10A403)
  Report Version:  104
  
  Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
  Exception Codes: KERN_INVALID_ADDRESS at 0x00000054
  Crashed Thread:  4
  
  Thread 4 name:  WebThread
  Thread 4 Crashed:
  0   WebCore                         0x35f1b9a0 WebCore::RootInlineBox::ascentAndDescentForBox(WebCore::InlineBox*, WTF::HashMap&lt;WebCore::InlineTextBox const*, std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt;, WTF::PtrHash&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt; &gt; &gt;&amp;, int&amp;, int&amp;, bool&amp;, bool&amp;) const + 1344
  1   WebCore                         0x35f1b1a4 WebCore::InlineFlowBox::computeLogicalBoxHeights(WebCore::RootInlineBox*, int&amp;, int&amp;, int&amp;, int&amp;, bool&amp;, bool&amp;, bool, WTF::HashMap&lt;WebCore::InlineTextBox const*, std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt;, WTF::PtrHash&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt; &gt; &gt;&amp;, WebCore::FontBaseline, WebCore::VerticalPositionCache&amp;) + 80
  2   WebCore                         0x35f1ade4 WebCore::RootInlineBox::alignBoxesInBlockDirection(int, WTF::HashMap&lt;WebCore::InlineTextBox const*, std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt;, WTF::PtrHash&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt; &gt; &gt;&amp;, WebCore::VerticalPositionCache&amp;) + 124
  3   WebCore                         0x35f1acc2 WebCore::RenderBlock::computeBlockDirectionPositionsForLine(WebCore::RootInlineBox*, WebCore::BidiRun*, WTF::HashMap&lt;WebCore::InlineTextBox const*, std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt;, WTF::PtrHash&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;WebCore::InlineTextBox const*&gt;, WTF::HashTraits&lt;std::__1::pair&lt;WTF::Vector&lt;WebCore::SimpleFontData const*, 0ul&gt;, WebCore::GlyphOverflow&gt; &gt; &gt;&amp;, WebCore::VerticalPositionCache&amp;) + 54
  4   WebCore                         0x35f18846 WebCore::RenderBlock::createLineBoxesFromBidiRuns(WebCore::BidiRunList&lt;WebCore::BidiRun&gt;&amp;, WebCore::InlineIterator const&amp;, WebCore::LineInfo&amp;, WebCore::VerticalPositionCache&amp;, WebCore::BidiRun*) + 162
  5   WebCore                         0x35f0e30c WebCore::RenderBlock::layoutRunsAndFloatsInRange(WebCore::LineLayoutState&amp;, WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::InlineIterator const&amp;, WebCore::BidiStatus const&amp;, unsigned int) + 2048
  6   WebCore                         0x35f0cf00 WebCore::RenderBlock::layoutRunsAndFloats(WebCore::LineLayoutState&amp;, bool) + 724
  7   WebCore                         0x35e4b562 WebCore::RenderBlock::layoutInlineChildren(bool, int&amp;, int&amp;) + 986
  8   WebCore                         0x35e46390 WebCore::RenderBlock::layoutBlock(bool, int) + 1132
  9   WebCore                         0x35e45c22 WebCore::RenderBlock::layout() + 38
  10  WebCore                         0x35e48cbc WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&amp;, int&amp;, int&amp;) + 556
  11  WebCore                         0x35e47f2c WebCore::RenderBlock::layoutBlockChildren(bool, int&amp;) + 528
  12  WebCore                         0x35e463a0 WebCore::RenderBlock::layoutBlock(bool, int) + 1148
  13  WebCore                         0x35e45c22 WebCore::RenderBlock::layout() + 38
  14  WebCore                         0x35e48cbc WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&amp;, int&amp;, int&amp;) + 556
  15  WebCore                         0x35e47f2c WebCore::RenderBlock::layoutBlockChildren(bool, int&amp;) + 528
  16  WebCore                         0x35e463a0 WebCore::RenderBlock::layoutBlock(bool, int) + 1148
  17  WebCore                         0x35e45c22 WebCore::RenderBlock::layout() + 38
  18  WebCore                         0x35e45aae WebCore::RenderView::layout() + 478
  19  WebCore                         0x35e404b2 WebCore::FrameView::layout(bool) + 1554
  20  WebCore                         0x35e782c6 WebCore::ThreadTimers::sharedTimerFiredInternal() + 134
  21  WebCore                         0x35e7820a WebCore::timerFired(__CFRunLoopTimer*, void*) + 62
  22  CoreFoundation                  0x39a615dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12
  23  CoreFoundation                  0x39a6128c __CFRunLoopDoTimer + 268
  24  CoreFoundation                  0x39a5fefc __CFRunLoopRun + 1228
  25  CoreFoundation                  0x399d2eb8 CFRunLoopRunSpecific + 352
  26  CoreFoundation                  0x399d2d44 CFRunLoopRunInMode + 100
  27  WebCore                         0x35de4a70 RunWebThread(void*) + 440
  28  libsystem_c.dylib               0x33e4730e _pthread_start + 306
  29  libsystem_c.dylib               0x33e471d4 thread_start + 4
  </code></pre>
  
  <p>...</p>
  
  <pre><code>OS Version:      iOS 6.0 (10A403)
  Report Version:  104
  
  Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
  Exception Codes: KERN_INVALID_ADDRESS at 0x000000a4
  Crashed Thread:  2
  
  Thread 2 name:  WebThread
  Thread 2 Crashed:
  0   WebCore                         0x35ae72f6 WebCore::requiresLineBox(WebCore::InlineIterator const&amp;, WebCore::LineInfo const&amp;, WebCore::WhitespacePosition) + 30
  1   WebCore                         0x35ae7286 WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace(WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::LineInfo&amp;, WebCore::RenderBlock::FloatingObject*, WebCore::LineWidth&amp;) + 162
  2   WebCore                         0x35ae476e WebCore::RenderBlock::LineBreaker::nextLineBreak(WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::LineInfo&amp;, std::__1::pair&lt;WebCore::RenderText*, WebCore::LazyLineBreakIterator&gt;&amp;, WebCore::RenderBlock::FloatingObject*, unsigned int) + 158
  3   WebCore                         0x35ae45de WebCore::RenderBlock::layoutRunsAndFloatsInRange(WebCore::LineLayoutState&amp;, WebCore::BidiResolver&lt;WebCore::InlineIterator, WebCore::BidiRun&gt;&amp;, WebCore::InlineIterator const&amp;, WebCore::BidiStatus const&amp;, unsigned int) + 2770
  4   WebCore                         0x35ae2f00 WebCore::RenderBlock::layoutRunsAndFloats(WebCore::LineLayoutState&amp;, bool) + 724
  5   WebCore                         0x35a21562 WebCore::RenderBlock::layoutInlineChildren(bool, int&amp;, int&amp;) + 986
  6   WebCore                         0x35a1c390 WebCore::RenderBlock::layoutBlock(bool, int) + 1132
  7   WebCore                         0x35a1bc22 WebCore::RenderBlock::layout() + 38
  8   WebCore                         0x35a1ecbc WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&amp;, int&amp;, int&amp;) + 556
  9   WebCore                         0x35a1df2c WebCore::RenderBlock::layoutBlockChildren(bool, int&amp;) + 528
  10  WebCore                         0x35a1c3a0 WebCore::RenderBlock::layoutBlock(bool, int) + 1148
  11  WebCore                         0x35a1bc22 WebCore::RenderBlock::layout() + 38
  12  WebCore                         0x35a1ecbc WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&amp;, int&amp;, int&amp;) + 556
  13  WebCore                         0x35a1df2c WebCore::RenderBlock::layoutBlockChildren(bool, int&amp;) + 528
  14  WebCore                         0x35a1c3a0 WebCore::RenderBlock::layoutBlock(bool, int) + 1148
  15  WebCore                         0x35a1bc22 WebCore::RenderBlock::layout() + 38
  16  WebCore                         0x35a1baae WebCore::RenderView::layout() + 478
  17  WebCore                         0x35a164b2 WebCore::FrameView::layout(bool) + 1554
  18  WebCore                         0x35a4e2c6 WebCore::ThreadTimers::sharedTimerFiredInternal() + 134
  19  WebCore                         0x35a4e20a WebCore::timerFired(__CFRunLoopTimer*, void*) + 62
  20  CoreFoundation                  0x396375dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12
  21  CoreFoundation                  0x3963728c __CFRunLoopDoTimer + 268
  22  CoreFoundation                  0x39635efc __CFRunLoopRun + 1228
  23  CoreFoundation                  0x395a8eb8 CFRunLoopRunSpecific + 352
  24  CoreFoundation                  0x395a8d44 CFRunLoopRunInMode + 100
  25  WebCore                         0x359baa70 RunWebThread(void*) + 440
  26  libsystem_c.dylib               0x33a1d30e _pthread_start + 306
  27  libsystem_c.dylib               0x33a1d1d4 thread_start + 4
  </code></pre>