【问题标题】:uiwebview webthread crashinguiwebview webthread 崩溃
【发布时间】:2012-10-01 17:47:04
【问题描述】:

我的带有 UIWebView 的应用程序经常崩溃。崩溃通常略有不同,但始终是具有类似堆栈跟踪的“WebThread”崩溃。

我发现了this 的问题,但我不认为这是我的情况,我有 iOS 6 并且我没有加载 Office 文档。 我正在使用 websocket 向服务器发送消息,并使用 ajax commet 从服务器接收消息。

当我开始连接时,总是会发生崩溃。

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

【问题讨论】:

    标签: uiwebview ios6


    【解决方案1】:

    我修复了这个错误,我正在向 cocoa 发送 JavaScript 日志,例如 this,我通过删除它修复了这些崩溃。

    实际上,iOS 6 不再需要这样做了,因为现在可以使用 MAC OX safari 调试 javascript =)

    【讨论】:

    • 你能澄清一下吗?您说您正在发送 javascripts 日志并修复了崩溃...您的意思是简单地从网页中删除一些 console.log() 消息就可以消除 iOS 应用程序中的崩溃?
    • 是的,那是很久以前的事了,但我记得,我刚刚删除了console.log,问题就解决了。
    • 感谢您的澄清 - 奇怪的解决方案!
    • 确实,很奇怪。我可以确认删除所有console.log 调用似乎也可以解决我经常崩溃的问题(iOS7)
    • @FilipeRoberto 我无法通过从我的 javascript 中删除所有日志来解决崩溃问题。由于我面临同样的问题,您能否分享此崩溃的详细解决方案
    猜你喜欢
    • 2014-06-16
    • 2011-12-27
    • 1970-01-01
    • 2017-04-02
    • 1970-01-01
    • 2012-06-16
    • 1970-01-01
    • 2010-11-18
    相关资源
    最近更新 更多