1

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.

I found this 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.

The crashes always happen when I'm starting that connections.

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<WebCore::InlineTextBox const*, std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow>, WTF::PtrHash<WebCore::InlineTextBox const*>, WTF::HashTraits<WebCore::InlineTextBox const*>, WTF::HashTraits<std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow> > >&, int&, int&, bool&, bool&) const + 1344
1   WebCore                         0x35f1b1a4 WebCore::InlineFlowBox::computeLogicalBoxHeights(WebCore::RootInlineBox*, int&, int&, int&, int&, bool&, bool&, bool, WTF::HashMap<WebCore::InlineTextBox const*, std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow>, WTF::PtrHash<WebCore::InlineTextBox const*>, WTF::HashTraits<WebCore::InlineTextBox const*>, WTF::HashTraits<std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow> > >&, WebCore::FontBaseline, WebCore::VerticalPositionCache&) + 80
2   WebCore                         0x35f1ade4 WebCore::RootInlineBox::alignBoxesInBlockDirection(int, WTF::HashMap<WebCore::InlineTextBox const*, std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow>, WTF::PtrHash<WebCore::InlineTextBox const*>, WTF::HashTraits<WebCore::InlineTextBox const*>, WTF::HashTraits<std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow> > >&, WebCore::VerticalPositionCache&) + 124
3   WebCore                         0x35f1acc2 WebCore::RenderBlock::computeBlockDirectionPositionsForLine(WebCore::RootInlineBox*, WebCore::BidiRun*, WTF::HashMap<WebCore::InlineTextBox const*, std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow>, WTF::PtrHash<WebCore::InlineTextBox const*>, WTF::HashTraits<WebCore::InlineTextBox const*>, WTF::HashTraits<std::__1::pair<WTF::Vector<WebCore::SimpleFontData const*, 0ul>, WebCore::GlyphOverflow> > >&, WebCore::VerticalPositionCache&) + 54
4   WebCore                         0x35f18846 WebCore::RenderBlock::createLineBoxesFromBidiRuns(WebCore::BidiRunList<WebCore::BidiRun>&, WebCore::InlineIterator const&, WebCore::LineInfo&, WebCore::VerticalPositionCache&, WebCore::BidiRun*) + 162
5   WebCore                         0x35f0e30c WebCore::RenderBlock::layoutRunsAndFloatsInRange(WebCore::LineLayoutState&, WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, WebCore::InlineIterator const&, WebCore::BidiStatus const&, unsigned int) + 2048
6   WebCore                         0x35f0cf00 WebCore::RenderBlock::layoutRunsAndFloats(WebCore::LineLayoutState&, bool) + 724
7   WebCore                         0x35e4b562 WebCore::RenderBlock::layoutInlineChildren(bool, int&, int&) + 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&, int&, int&) + 556
11  WebCore                         0x35e47f2c WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 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&, int&, int&) + 556
15  WebCore                         0x35e47f2c WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 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

...

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&, WebCore::LineInfo const&, WebCore::WhitespacePosition) + 30
1   WebCore                         0x35ae7286 WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace(WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, WebCore::LineInfo&, WebCore::RenderBlock::FloatingObject*, WebCore::LineWidth&) + 162
2   WebCore                         0x35ae476e WebCore::RenderBlock::LineBreaker::nextLineBreak(WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, WebCore::LineInfo&, std::__1::pair<WebCore::RenderText*, WebCore::LazyLineBreakIterator>&, WebCore::RenderBlock::FloatingObject*, unsigned int) + 158
3   WebCore                         0x35ae45de WebCore::RenderBlock::layoutRunsAndFloatsInRange(WebCore::LineLayoutState&, WebCore::BidiResolver<WebCore::InlineIterator, WebCore::BidiRun>&, WebCore::InlineIterator const&, WebCore::BidiStatus const&, unsigned int) + 2770
4   WebCore                         0x35ae2f00 WebCore::RenderBlock::layoutRunsAndFloats(WebCore::LineLayoutState&, bool) + 724
5   WebCore                         0x35a21562 WebCore::RenderBlock::layoutInlineChildren(bool, int&, int&) + 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&, int&, int&) + 556
9   WebCore                         0x35a1df2c WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 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&, int&, int&) + 556
13  WebCore                         0x35a1df2c WebCore::RenderBlock::layoutBlockChildren(bool, int&) + 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
Community
  • 1
  • 1
Filipe Roberto
  • 339
  • 4
  • 16

1 Answers1

3

I fixed the bug, I was sending javascript logs to cocoa like this, I fixed those crashes by removing this.

Actually, that's not necessary anymore for iOS 6 cause now it's possible to debug javascript using MAC OX safari =)

Community
  • 1
  • 1
Filipe Roberto
  • 339
  • 4
  • 16
  • Can you clarify this? You say you were sending javascripts logs and that fixed a crash... do you mean simply removing some console.log() messages from a webpage eliminated crashes in your iOS app? – karlbecker_com Feb 23 '14 at 22:32
  • Yes, that was a long time ago, but as I remember, I just removed console.log and the problem was solved. – Filipe Roberto Feb 24 '14 at 23:00
  • Thanks for the clarification - strange solution! – karlbecker_com Feb 25 '14 at 02:55
  • Indeed, very strange. I can confirm that removing all `console.log` calls seemed to fix the frequent crashes for me, too (iOS7) – auco Mar 12 '14 at 02:37
  • @FilipeRoberto I am not able to fix the crash issue by removing all logs from my javascript . Can you please share the detailed solution of this crash as I am facing the same problem – Dinesh Kaushik Apr 21 '14 at 08:57
  • @DineshKaushik I just did what I said, removed the logs. Later I found another issue in websocket communication. I don't know today, but an year ago websockets were not well suported by uiwebview, I had to remove that too and use ajax. – Filipe Roberto Apr 22 '14 at 12:22