【问题标题】:EXC_BAD_ACCESS (SIGSEGV) in WebCore::UserGestureIndicator::processingUserGestureWebCore::UserGestureIndicator::processingUserGesture 中的 EXC_BAD_ACCESS (SIGSEGV)
【发布时间】:2014-01-18 17:01:09
【问题描述】:

我有一个使用 UIWebView 和 HTML5 websockets 构建的 iOS 应用程序。该应用程序经历看似随机的崩溃。它发生在用户与其交互时以及在用户与应用之间没有发生交互的寿命测试期间。

崩溃日志都有以下内容:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000

并且线程日志包含:

Thread XX name:  WebCore: Worker
Thread XX Crashed:
0   WebCore                         0x36c8c7a0 WebCore::UserGestureIndicator::processingUserGesture() + 20
1   WebCore                         0x36d7070a WebCore::DOMTimer::DOMTimer(WebCore::ScriptExecutionContext*, WTF::PassOwnPtr<WebCore::ScheduledAction>, int, bool) + 74
2   WebCore                         0x36d70616 WebCore::DOMTimer::install(WebCore::ScriptExecutionContext*, WTF::PassOwnPtr<WebCore::ScheduledAction>, int, bool) + 46
3   WebCore                         0x3753ae7e WebCore::WorkerContext::setTimeout(WTF::PassOwnPtr<WebCore::ScheduledAction>, int) + 30
4   WebCore                         0x3731ac02 WebCore::JSWorkerContext::setTimeout(JSC::ExecState*) + 194
5   WebCore                         0x37318ff6 WebCore::jsWorkerContextPrototypeFunctionSetTimeout(JSC::ExecState*) + 110
6   JavaScriptCore                  0x2fa9a1d8 llint_native_call_trampoline + 62
7   JavaScriptCore                  0x2faa355a JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 66
8   WebCore                         0x36db0b16 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*) + 558
9   WebCore                         0x36d6ebba WebCore::EventTarget::fireEventListeners(WebCore::Event*, WebCore::EventTargetData*, WTF::Vector<WebCore::RegisteredEventListener, 1ul, WTF::CrashOnOverflow>&) + 482
10  WebCore                         0x36c6da2a WebCore::EventTarget::fireEventListeners(WebCore::Event*) + 174
11  WebCore                         0x36e28824 WebCore::EventTarget::dispatchEvent(WTF::PassRefPtr<WebCore::Event>) + 60
12  WebCore                         0x3753e596 WebCore::MessageWorkerContextTask::performTask(WebCore::ScriptExecutionContext*) + 222
13  WebCore                         0x3753ec6e WebCore::WorkerRunLoop::runInMode(WebCore::WorkerContext*, WebCore::ModePredicate const&, WebCore::WorkerRunLoop::WaitMode) + 158
14  WebCore                         0x3753eb94 WebCore::WorkerRunLoop::run(WebCore::WorkerContext*) + 60
15  WebCore                         0x37540d64 WebCore::WorkerThread::workerThread() + 432
16  JavaScriptCore                  0x2fa4ba68 WTF::wtfThreadEntryPoint(void*) + 12
17  libsystem_pthread.dylib         0x397b6c5a _pthread_body + 138
18  libsystem_pthread.dylib         0x397b6bca _pthread_start + 98
19  libsystem_pthread.dylib         0x397b4ccc thread_start + 4

我设法在 throw 上捕获了异常,据我所知,它看起来是一个框架错误。请参阅随附的屏幕截图。

我读过的大部分内容似乎表明 Web 视图在委托触发之前被解除分配,但我的代码中没有任何地方解除分配!

有没有人遇到过这种情况或类似情况?非常感谢任何帮助!

更新

在联系开发人员支持后,我已向 Apple 提交了错误报告。他们的工程师确认这是一个错误。

【问题讨论】:

  • 如果在您的研究和其他人的帮助之后您无法解决问题,我鼓励您通过bugreport.apple.com向 Apple 提交错误报告
  • @SlyRaskal:同意。如果这篇文章没有任何结果,我会这样做!
  • 我遇到了类似的问题,异常来自 WebCore 工作线程。您是否尝试过运行 Zombie 分析器来检查是否/在何处访问了无效对象?
  • @user2085001:我尝试从 Instruments 运行 Zombies 和 Leaks。两者都没有表现出任何异常。感谢您的建议。
  • 如果在 Apple 方面的错误跟踪问题上会有任何进展(但我预计在几个月内不会有任何进展),请务必更新此主题并提供有关此问题的答案。同样,这个问题可以关闭,因为无法解决,但最好保持开放,因为有些人可能有类似的问题,所以不会问同样的问题。

标签: ios html websocket web-worker segmentation-fault


【解决方案1】:

在我的情况下,我有类似的问题。

正如许多人所说,这可能是由于 WebView 委托方法正在调用而 webview 正在被释放。

为了解决这个问题,我们需要将delegate设置为nil,并在指定的方法停止webview请求

你必须添加下面的代码行

-(void)viewDidUnload{
    [super viewDidUnload];

    webViewRef.delegate = nil;
    [webViewRef stopLoading];

}

-(void)backBtnClicked{

    webViewRef.delegate = nil;
    [webViewRef stopLoading];

}

希望对你有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-09
    • 1970-01-01
    • 2015-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-02
    • 2011-06-03
    相关资源
    最近更新 更多