2012-07-25 101 views
3

我試圖弄清楚爲什麼我的應用程序有時在用戶設備上崩潰。不管設備是否越獄,這都無關緊要。我的應用程序來自AppStore。其他崩潰日誌幾乎相同,儘管它們的崩潰線程不同。應用程序崩潰,不知道爲什麼

Hardware Model:  iPhone3,1 
Process:   [the APP] [296] 
Path:   /var/mobile/Applications/06DF5BC5-F9C2-49EE-B2D5-5979C09B51A2/[the APP].app/[the APP] 
Identifier:  [the APP] 
Version:   3.3.0 
Code Type:  ARM 
Parent Process: launchd [1] 

Date/Time:  2012-07-22 15:15:18 +0000 
OS Version:  iPhone OS 5.1.1 (9B206) 
Report Version: 104 

Exception Type: SIGSEGV 
Exception Codes: SEGV_ACCERR at 0xbbadbeef 
Crashed Thread: 7 

Thread 0: 
0 libsystem_kernel.dylib    0x35c39004 mach_msg_trap + 20 
1 CoreFoundation      0x353673f3 __CFRunLoopServiceMachPort + 127 
2 CoreFoundation      0x353660f1 __CFRunLoopRun + 825 
3 CoreFoundation      0x352e94a5 CFRunLoopRunSpecific + 301 
4 CoreFoundation      0x352e936d CFRunLoopRunInMode + 105 
5 GraphicsServices     0x36f85439 GSEventRunModal + 137 
6 UIKit        0x32df5cd5 UIApplicationMain + 1081 
7 [the APP]       0x0000b549 main (main.m:20) 

Thread 1: 
0 libsystem_kernel.dylib    0x35c393a8 kevent + 24 
1 libdispatch.dylib     0x3422cbc9 _dispatch_mgr_wakeup + 1 

Thread 2: 
0 libsystem_kernel.dylib    0x35c490d8 __psynch_mutexwait + 24 
1 WebCore        0x311454ef _ZL17_WebTryThreadLockb + 215 
2 WebCore        0x311a4173 _ZL19SendDelegateMessageP12NSInvocation + 707 
3 WebKit        0x3507ad87 -[_WebSafeForwarder forwardInvocation:] + 119 
4 CoreFoundation      0x35395a83 ___forwarding___ + 667 
5 CoreFoundation      0x352f0650 _CF_forwarding_prep_0 + 48 
6 WebKit        0x350816a1 WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(void (WebCore::PolicyChecker::*)(WebCore::PolicyAction), WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr) + 221 
7 WebCore        0x3120b8b9 WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr, bool), void*) + 873 
8 WebCore        0x3120ae4d WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr) + 913 
9 WebCore        0x312092b9 WebCore::FrameLoader::load(WebCore::DocumentLoader*) + 169 
10 WebCore        0x312091e5 WebCore::FrameLoader::load(WebCore::ResourceRequest const&, WebCore::SubstituteData const&, bool) + 241 
11 WebKit        0x350b3f5f -[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:] + 1119 
12 WebKit        0x350b3797 -[WebFrame _loadHTMLString:baseURL:unreachableURL:] + 79 
13 WebKit        0x350b37bb -[WebFrame loadHTMLString:baseURL:] + 31 
14 WebCore        0x311950b5 HandleRunSource + 365 
15 CoreFoundation      0x35367ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15 
16 CoreFoundation      0x35367335 __CFRunLoopDoSources0 + 365 
17 CoreFoundation      0x35366045 __CFRunLoopRun + 653 
18 CoreFoundation      0x352e94a5 CFRunLoopRunSpecific + 301 
19 CoreFoundation      0x352e936d CFRunLoopRunInMode + 105 
20 WebCore        0x311e8ca3 _ZL12RunWebThreadPv + 403 
21 libsystem_c.dylib     0x32756735 _pthread_start + 321 

Thread 3: 
0 libsystem_kernel.dylib    0x35c39004 mach_msg_trap + 20 
1 CoreFoundation      0x353673f3 __CFRunLoopServiceMachPort + 127 
2 CoreFoundation      0x3536612b __CFRunLoopRun + 883 
3 CoreFoundation      0x352e94a5 CFRunLoopRunSpecific + 301 
4 CoreFoundation      0x352e936d CFRunLoopRunInMode + 105 
5 Foundation       0x34e22bb9 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309 
6 Foundation       0x34e22a81 -[NSThread main] + 73 
7 Foundation       0x34eb6591 __NSThread__main__ + 1049 
8 libsystem_c.dylib     0x32756735 _pthread_start + 321 

Thread 4: 
0 libsystem_kernel.dylib    0x35c49570 __select + 20 
1 libsystem_c.dylib     0x32756735 _pthread_start + 321 

Thread 5: 
0 libsystem_kernel.dylib    0x35c39004 mach_msg_trap + 20 
1 CoreFoundation      0x353673f3 __CFRunLoopServiceMachPort + 127 
2 CoreFoundation      0x3536612b __CFRunLoopRun + 883 
3 CoreFoundation      0x352e94a5 CFRunLoopRunSpecific + 301 
4 CoreFoundation      0x352e936d CFRunLoopRunInMode + 105 
5 YouTube        0x33e336c9 -[YTImageLoader(Internal) _startLoader] + 245 
6 Foundation       0x34e22a81 -[NSThread main] + 73 
7 Foundation       0x34eb6591 __NSThread__main__ + 1049 
8 libsystem_c.dylib     0x32756735 _pthread_start + 321 

Thread 6: 
0 libsystem_kernel.dylib    0x35c49cd4 __workq_kernreturn + 8 

Thread 7 Crashed: 
0 WebCore        0x311454e2 _ZL17_WebTryThreadLockb + 202 
1 WebCore        0x3114540f WebThreadLock + 55 
2 UIKit        0x32e5537b -[UIWebTiledView layoutSubviews] + 43 
3 UIKit        0x32e5534b -[UIWebDocumentView layoutSubviews] + 127 
4 UIKit        0x32dcaf37 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 183 
5 CoreFoundation      0x352f21fb -[NSObject performSelector:withObject:] + 43 
6 QuartzCore       0x321c2aa5 -[CALayer layoutSublayers] + 217 
7 QuartzCore       0x321c26bd CA::Layer::layout_if_needed(CA::Transaction*) + 217 
8 QuartzCore       0x321c6843 CA::Context::commit_transaction(CA::Transaction*) + 227 
9 QuartzCore       0x321c657f CA::Transaction::commit() + 315 
10 QuartzCore       0x3220dd01 CA::Transaction::release_thread(void*) + 37 
11 libsystem_c.dylib     0x327490ff _pthread_tsd_cleanup + 171 
12 libsystem_c.dylib     0x32748d7b _pthread_exit + 123 
13 libsystem_c.dylib     0x3275a0f3 pthread_exit + 31 
14 Foundation       0x34e3237b +[NSThread exit] + 11 
15 Foundation       0x34eb65af __NSThread__main__ + 1079 
16 libsystem_c.dylib     0x32756735 _pthread_start + 321 

Thread 8: 
0 libsystem_kernel.dylib    0x35c49cd4 __workq_kernreturn + 8 

Thread 9: 
0 libsystem_kernel.dylib    0x35c49cd4 __workq_kernreturn + 8 

Thread 10: 
0 libsystem_kernel.dylib    0x35c49cd4 __workq_kernreturn + 8 

Thread 11: 
0 libsystem_kernel.dylib    0x35c49cd4 __workq_kernreturn + 8 

Thread 7 crashed with ARM Thread State: 
    r0: 0xffffffff  r1: 0x00001100  r2: 0x2ffc850c  r3: 0x00000000 
    r4: 0xbbadbeef  r5: 0x00000000  r6: 0x0054b000  r7: 0x2ffc8b4c 
    r8: 0x0ca32800  r9: 0x3399fc2c r10: 0x2ffc8be4 r11: 0x2ffc8ebc 
    ip: 0x3ee8e270  sp: 0x2ffc8b40  lr: 0x35790fef  pc: 0x32c7f4e2 
    cpsr: 0x60000030 

Binary Images: 
[cut cause of char limit] 

我不知道發生了什麼,任何人的想法?

回答

4

問題是您從後臺線程(這是禁止的)發送消息給UI對象。

線程7與棧跟蹤崩潰到UIView的佈局機制。線程7在此代碼中的事實可能是由setNeedsLayout或其他一些從此後臺線程發送的方法造成的。

+0

但問題是,應用程序崩潰並不總是隻在一些罕見的情況下 – CrEaK 2012-07-25 13:10:54

+1

...這是併發問題的典型行爲。 – 2012-07-25 13:24:59

3

我認爲Web視圖加載完成,並試圖重新加載的看法,但視圖控制器被彈出,發佈,需要在viewWillDisappear方法補充一點:

- (void)viewWillDisappear:(BOOL)animated{ 
    [super viewWillDisappear:animated]; 
    if ([webView isLoading]) { 
     [webView stopLoading]; 
    } 
} 
0

,我上的項目看到了類似的例外一個運行在WebKit上的基於WinTel的GWT App。已確定僅當WebKit內存不足時纔會出現此特定問題。