2016-05-18 97 views
0

在我的iPad應用程序中,我經常收到崩潰報告,但例外情況爲EXC_RESOURCE和子類型WAKEUPS。 然而奇怪的是,消息說(Limit 150/sec) Observed 0/sec over 300 sec如何避免異常EXC_RESOURCE - WAKEUPS?

它怎麼能成爲一個例外時,它觀察到0喚醒/秒? - 我如何避免它?

我關心的原因是報告的生成延遲了應用程序中的一些時間關鍵線程。 我們主要是從麥克風錄音和同時播放音頻,並且生成報告時,音頻會斷斷續續。

該異常總是由3個線程之一觸發:主線程,AURemoteIO: IOThreadcom.apple.coreaudio.AQClient。請參見下面的報告片段:

Hardware Model:  iPad2,5 
Code Type:   ARM (Native) 
Parent Process:  debugserver [3109] 

Date/Time:   2016-05-18 12:15:59.59 +0200 
Launch Time:   2016-05-18 12:11:44.44 +0200 
OS Version:   iOS 9.1 (13B143) 
Report Version:  104 

Exception Type: EXC_RESOURCE 
Exception Subtype: WAKEUPS 
Exception Message: (Limit 150/sec) Observed 0/sec over 300 secs 
Exception Note: NON-FATAL CONDITION (this is NOT a crash) 
Triggered by Thread: 0 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Attributed: 
0 CoreFoundation     0x25ef8c4e 0x25ef6000 + 11342 
1 CoreFoundation     0x25fab760 0x25ef6000 + 743264 
... 

Thread 10 name: AURemoteIO::IOThread 
Thread 10: 
0 libsystem_kernel.dylib   0x382acff0 mach_msg_trap + 20 
1 libsystem_kernel.dylib   0x382acdf4 mach_msg + 40 
2 AudioToolbox     0x2544ec50 AURemoteIO::IOThread::Run() + 104 
3 AudioToolbox     0x25452500 AURemoteIO::IOThread::Entry(void*) + 8 
4 AudioToolbox     0x25369fee CAPThread::Entry(CAPThread*) + 186 
5 libsystem_pthread.dylib   0x3836385a _pthread_body + 138 
6 libsystem_pthread.dylib   0x383637ce _pthread_start + 110 
7 libsystem_pthread.dylib   0x38361724 thread_start + 8 

... 

Thread 12 name: com.apple.coreaudio.AQClient 
Thread 12: 
0 libsystem_kernel.dylib   0x382acff0 mach_msg_trap + 20 
1 libsystem_kernel.dylib   0x382acdf4 mach_msg + 40 
2 CoreFoundation     0x25fad8c4 __CFRunLoopServiceMachPort + 136 
3 CoreFoundation     0x25fabc4c __CFRunLoopRun + 1036 
4 CoreFoundation     0x25eff118 CFRunLoopRunSpecific + 520 
5 CoreFoundation     0x25efef04 CFRunLoopRunInMode + 108 
6 AudioToolbox     0x253810b4 GenericRunLoopThread::Entry(void*) + 132 
7 AudioToolbox     0x25369fee CAPThread::Entry(CAPThread*) + 186 
8 libsystem_pthread.dylib   0x3836385a _pthread_body + 138 
9 libsystem_pthread.dylib   0x383637ce _pthread_start + 110 
10 libsystem_pthread.dylib   0x38361724 thread_start + 8 

回答

0

主要困惑是Observed 0/sec聲明,但我發現,這個數字是錯誤的。當在更新更快的iPad上運行相同的代碼時,它會突然在這裏顯示一個數字(200-400),所以這只是由於iPad速度慢導致無法計算出數字。

其次,我發現確實有一個線程開始和停止的方式太頻繁,但它是而不是觸發錯誤的那個,所以這使得定位困難得多。