[UIViewAnimationState release] 处的 UIWebView 随机崩溃:发送到已释放实例的消息

UIWebView random crash at [UIViewAnimationState release]: message sent to deallocated instance([UIViewAnimationState release] 处的 UIWebView 随机崩溃:发送到已释放实例的消息)

本文介绍了[UIViewAnimationState release] 处的 UIWebView 随机崩溃:发送到已释放实例的消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 iOS8.1UIWebView,使用 iPhone5 时遇到随机 UIWebView 崩溃.在我的测试中,iOS7 上没有出现崩溃.

我创建了这个 github 存储库来重现崩溃:https://github.com/crarau/WebViewCrash

基本上我正在添加一个 UIWebView 并加载 www.amazon.com

应用程序在 WebThread 上随机崩溃,并带有 EXC_ARM_BREAKPOINT

在控制台上启用僵尸追踪后,会出现以下消息:

[UIViewAnimationState release]: 消息发送到deallocated instance 0x14deff70

UIView 加载时会发生什么:

[super viewDidLoad];NSURLRequest * urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.amazon.com"]];self.webView.layer.cornerRadius = 0;self.webView.userInteractionEnabled = YES;self.webView.multipleTouchEnabled = YES;self.webView.backgroundColor = [UIColor clearColor];self.webView.scrollView.scrollEnabled = 否;self.webView.scrollView.bounces = 否;[self.webView loadRequest:urlRequest];

异常堆栈跟踪:

 异常类型:EXC_BREAKPOINT (SIGTRAP)异常代码:0x0000000000000001、0x000000000000defe线程触发:2线程 0 名称:调度队列:com.apple.main-thread线程 0:0 libsystem_kernel.dylib 0x2fe054f0 mach_msg_trap + 201 libsystem_kernel.dylib 0x2fe052e4 mach_msg + 362 核心基础 0x21fed936 __CFRunLoopServiceMachPort + 1423 核心基础 0x21febedc __CFRunLoopRun + 10124 核心基础 0x21f3a20c CFRunLoopRunSpecific + 4725 核心基础 0x21f3a01e CFRunLoopRunInMode + 1026 图形服务 0x293330a4 GSEventRunModal + 1327 UIKit 0x255461cc UIApplicationMain + 14368 WebViewCrash 0x0002deec 主 (main.m:14)9 libdyld.dylib 0x2fd52aac 开始 + 0线程 1 名称:调度队列:com.apple.libdispatch-manager线程 1:0 libsystem_kernel.dylib 0x2fe052a0 kevent64 + 241 libdispatch.dylib 0x00162674 0x154000 + 589962 libdispatch.dylib 0x00157496 0x154000 + 13462线程 2 名称:WebThread线程 2 崩溃:0 核心基础 0x2202aea2 ___转发___ + 5341 核心基础 0x21f5cdf4 _CF_forwarding_prep_0 + 202 核心基础 0x21f2ee58 CFRelease + 5963 QuartzCore 0x24f0ba60 CA::release_objects(X::List*) + 124 QuartzCore 0x24f10dc2 -[CAAnimation dealloc] + 505 libobjc.A.dylib 0x2f7ecd5a objc_object::sidetable_release(bool) + 1626 libobjc.A.dylib 0x2f7ed1a4(匿名命名空间)::AutoreleasePoolPage::pop(void*) + 4007 核心基础 0x21fee2a4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 128 核心基础 0x21fede1e __CFRunLoopDoTimer + 6469 核心基础 0x21fec06e __CFRunLoopRun + 141410 核心基础 0x21f3a20c CFRunLoopRunSpecific + 47211 核心基础 0x21f3a01e CFRunLoopRunInMode + 10212 WebCore 0x2d362ebe RunWebThread(void*) + 41413 libsystem_pthread.dylib 0x2fe95e90 _pthread_body + 13614 libsystem_pthread.dylib 0x2fe95e02 _pthread_start + 11415 libsystem_pthread.dylib 0x2fe93b8c thread_start + 4

感谢任何建议谢谢

解决方案

我在 iOS 8 上遇到了同样的问题,更具体地说,iPad 3 的故障率比其他设备高得多.

根据您的帖子和我能够找到的其他几个帖子,这似乎是 UIWebView 仅在 iOS8 上存在的问题,因为它适用于 iOS7.

我所做的是在 iOS8 上使用新的 WKWebView,它不会出现同样的问题,同时在 iOS7 上继续使用 UIWebView.p>

最好的办法是向 Apple 提交雷达文件,同时切换到 WKWebView.

I'm having a random UIWebView crash using iOS8.1 and UIWebView, using an iPhone5. In my tests the crash doesn't appear on iOS7.

I've created this github repository to reproduce the crash: https://github.com/crarau/WebViewCrash

Basically I'm adding a UIWebView and loading www.amazon.com

Randomly the app is crashing on the WebThread with EXC_ARM_BREAKPOINT

After enabling Zombie tracking on the console there is this message:

[UIViewAnimationState release]: message sent to deallocated instance 0x14deff70

Here what happens on UIView load:

[super viewDidLoad];

NSURLRequest * urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.amazon.com"]];

self.webView.layer.cornerRadius = 0;
self.webView.userInteractionEnabled = YES;
self.webView.multipleTouchEnabled = YES;
self.webView.backgroundColor = [UIColor clearColor];
self.webView.scrollView.scrollEnabled = NO;
self.webView.scrollView.bounces = NO;
[self.webView loadRequest:urlRequest];

The exception stacktrace:

    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000001, 0x000000000000defe
    Triggered by Thread:  2

    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0:
    0   libsystem_kernel.dylib          0x2fe054f0 mach_msg_trap + 20
    1   libsystem_kernel.dylib          0x2fe052e4 mach_msg + 36
    2   CoreFoundation                  0x21fed936 __CFRunLoopServiceMachPort + 142
    3   CoreFoundation                  0x21febedc __CFRunLoopRun + 1012
    4   CoreFoundation                  0x21f3a20c CFRunLoopRunSpecific + 472
    5   CoreFoundation                  0x21f3a01e CFRunLoopRunInMode + 102
    6   GraphicsServices                0x293330a4 GSEventRunModal + 132
    7   UIKit                           0x255461cc UIApplicationMain + 1436
    8   WebViewCrash                    0x0002deec main (main.m:14)
    9   libdyld.dylib                   0x2fd52aac start + 0

    Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
    Thread 1:
    0   libsystem_kernel.dylib          0x2fe052a0 kevent64 + 24
    1   libdispatch.dylib               0x00162674 0x154000 + 58996
    2   libdispatch.dylib               0x00157496 0x154000 + 13462

    Thread 2 name:  WebThread
    Thread 2 Crashed:
    0   CoreFoundation                  0x2202aea2 ___forwarding___ + 534
    1   CoreFoundation                  0x21f5cdf4 _CF_forwarding_prep_0 + 20
    2   CoreFoundation                  0x21f2ee58 CFRelease + 596
    3   QuartzCore                      0x24f0ba60 CA::release_objects(X::List<void const*>*) + 12
    4   QuartzCore                      0x24f10dc2 -[CAAnimation dealloc] + 50
    5   libobjc.A.dylib                 0x2f7ecd5a objc_object::sidetable_release(bool) + 162
    6   libobjc.A.dylib                 0x2f7ed1a4 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 400
    7   CoreFoundation                  0x21fee2a4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12
    8   CoreFoundation                  0x21fede1e __CFRunLoopDoTimer + 646
    9   CoreFoundation                  0x21fec06e __CFRunLoopRun + 1414
    10  CoreFoundation                  0x21f3a20c CFRunLoopRunSpecific + 472
    11  CoreFoundation                  0x21f3a01e CFRunLoopRunInMode + 102
    12  WebCore                         0x2d362ebe RunWebThread(void*) + 414
    13  libsystem_pthread.dylib         0x2fe95e90 _pthread_body + 136
    14  libsystem_pthread.dylib         0x2fe95e02 _pthread_start + 114
    15  libsystem_pthread.dylib         0x2fe93b8c thread_start + 4

Any advice is appreciated Thanks

解决方案

I'm experiencing the same issue on iOS 8 and more specifically an iPad 3 fails much more often than others.

Based on your post and a couple of others that I was able to find, it seems that it's an issue with UIWebView on iOS8 only, as it works on iOS7.

What I've done is to use the new WKWebView on iOS8, which doesn't present the same issue, while continuing to use UIWebView on iOS7.

The best thing to do would be to file a radar with Apple and switch to WKWebView in the meantime.

这篇关于[UIViewAnimationState release] 处的 UIWebView 随机崩溃:发送到已释放实例的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:[UIViewAnimationState release] 处的 UIWebView 随机崩溃:发送到已释放实例的消息

基础教程推荐