Application crashes in AVFoundation framework in iOS 7.0.x ONLY - ios

I am recording video in my app. My app crashes in iOS 7.0.x only. My application is crashing while writing the captured video in file. Below is my code to setup session & toggle camera
- (BOOL) setupSessionWithPreview:(UIView *)preview usingFrontCamera:(BOOL)frontCamera
{
AVCaptureDevice *videoDevice = nil;
if (frontCamera) {
videoDevice = [self getFrontCamera];
self.videoDeviceType = VideoDeviceTypeFrontCamera;
}
else {
videoDevice = [self getRearCamera];
self.videoDeviceType = VideoDeviceTypeRearCamera;
}
AVCaptureDevice *audioDevice = [self getAudioDevice];
self.videoInput = [[AVCaptureDeviceInput alloc] initWithDevice:videoDevice error:nil];
AVCaptureDeviceInput *audioInput = [[AVCaptureDeviceInput alloc] initWithDevice:audioDevice error:nil];
self.session = [[AVCaptureSession alloc] init];
if([self.session canAddInput:self.videoInput])
[self.session addInput:self.videoInput];
if([self.session canAddInput:audioInput])
[self.session addInput:audioInput];
self.audioOutput = [[AVCaptureAudioDataOutput alloc] init];
dispatch_queue_t audioCaptureQ = dispatch_queue_create("Audio Capture Q", DISPATCH_QUEUE_SERIAL);
[self.audioOutput setSampleBufferDelegate:self queue:audioCaptureQ];
if([self.session canAddOutput:self.audioOutput])
[self.session addOutput:self.audioOutput];
self.audioConnection = [self.audioOutput connectionWithMediaType:AVMediaTypeAudio];
self.videoOutput = [[AVCaptureVideoDataOutput alloc] init];
[self.videoOutput setAlwaysDiscardsLateVideoFrames:YES];
dispatch_queue_t videoCaptureQ = dispatch_queue_create("Video Capture Q", DISPATCH_QUEUE_SERIAL);
[self.videoOutput setSampleBufferDelegate:self queue:videoCaptureQ];
if([self.session canAddOutput:self.videoOutput])
[self.session addOutput:self.videoOutput];
self.videoConnection = [self.videoOutput connectionWithMediaType:AVMediaTypeVideo];
self.videoConnection.videoOrientation = AVCaptureVideoOrientationPortrait;
self.videoOrientation = [self.videoConnection videoOrientation];
movieWriterQ = dispatch_queue_create("Movie Writer Q", DISPATCH_QUEUE_SERIAL);
self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.session];
self.viewLayer = [preview layer];
[self.viewLayer setMasksToBounds:YES];
CGRect bounds = [preview bounds];
[self.previewLayer setFrame:bounds];
[self.previewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
[self.viewLayer insertSublayer:self.previewLayer below:[[self.viewLayer sublayers] objectAtIndex:0]];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self.session startRunning];
});
return YES;
}
// Code to toggle camera
-(void)toggleCameraIsFront:(BOOL)isFront
{
AVCaptureDevicePosition desiredPosition;
if (isFront) {
desiredPosition = AVCaptureDevicePositionFront;
self.videoDeviceType = VideoDeviceTypeFrontCamera;
}
else {
desiredPosition = AVCaptureDevicePositionBack;
self.videoDeviceType = VideoDeviceTypeRearCamera;
}
NSArray *videoDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
for (AVCaptureDevice *device in videoDevices)
{
if ([device position] == desiredPosition)
{
AVCaptureDeviceInput *videoDeviceInput = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil];
[self.session beginConfiguration];
[self.session removeInput:self.videoInput];
if ([self.session canAddInput:videoDeviceInput])
{
[self.session addInput:videoDeviceInput];
[self setVideoInput:videoDeviceInput];
}
else
{
[self.session addInput:self.videoInput];
}
[self.session removeOutput:self.videoOutput];
AVCaptureVideoDataOutput *videoDeviceOutput = [[AVCaptureVideoDataOutput alloc] init];
if ([self.session canAddOutput:videoDeviceOutput])
{
[self.session addOutput:videoDeviceOutput];
[self setVideoOutput:videoDeviceOutput];
[self.videoOutput setAlwaysDiscardsLateVideoFrames:YES];
// How to manage previously created videoCaptureQ in setupSessionWithPreview method ???
// or do we need create instance variable as dispatch_queue_t videoCaptureQ ???
dispatch_queue_t videoCaptureQ = dispatch_queue_create("Video Capture Q", DISPATCH_QUEUE_SERIAL);
[self.videoOutput setSampleBufferDelegate:self queue:videoCaptureQ];
self.videoConnection = [self.videoOutput connectionWithMediaType:AVMediaTypeVideo];
self.videoConnection.videoOrientation = AVCaptureVideoOrientationPortrait;
self.videoOrientation = [self.videoConnection videoOrientation];
}
else
{
[self.session addOutput:self.videoOutput];
}
[self.session commitConfiguration];
break;
}
}
}
// Code responsible for crashing in iOS 7.0.x ONLY, Works perfectly with iOS 6.x & iOS 7.1
#property(nonatomic, retain) AVAssetWriter *writer;
#property(nonatomic, retain) AVAssetReader *reader;
#property(nonatomic, retain) AVAssetReaderVideoCompositionOutput *videoOut;
#property(nonatomic, retain) AVAssetReaderOutput *audioOut;
#property(nonatomic, retain) AVAssetWriterInput *videoIn;
#property(nonatomic, retain) AVAssetWriterInput *audioIn;
dispatch_group_enter(self.dispatchGroup);
[self.videoIn requestMediaDataWhenReadyOnQueue:self.videoWriterQ usingBlock:^(void) {
if(self.videoFinished)
return;
BOOL completedOrFailed = NO;
while([self.videoIn isReadyForMoreMediaData] && !completedOrFailed)
{
// App crashes here .
CMSampleBufferRef sample = [self.videoOut copyNextSampleBuffer];
if(sample != NULL)
{
BOOL bret = [self.videoIn appendSampleBuffer:sample];
CFRelease(sample);
sample = NULL;
completedOrFailed = !bret;
}
else
{
completedOrFailed = YES;
}
}
if(completedOrFailed)
{
if(!self.videoFinished)
{
[self.videoIn markAsFinished];
}
self.videoFinished = YES;
dispatch_group_leave(self.dispatchGroup);
}
}];
Here is the crash log
Date/Time: 2014-04-07 11:05:34.917 +0100
OS Version: iOS 7.0.6 (11B651)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x7176d7e0
Triggered by Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3848bb26 objc_msgSend + 6
1 AVFoundation 0x2cf78650 -[AVCaptureVideoDataOutput _applyOverridesToCaptureOptions:] + 168
2 AVFoundation 0x2cf7081c -[AVCaptureSession _resolvedCaptureOptionsByApplyingOverridesToCaptureOptions:preset:] + 344
3 AVFoundation 0x2cf70b2c -[AVCaptureSession _resolvedCaptureOptionsForPreset:audioDevice:videoDevice:] + 108
4 AVFoundation 0x2cf7235c -[AVCaptureSession _buildAndRunGraph] + 312
5 AVFoundation 0x2cf6cc3c -[AVCaptureSession removeInput:] + 1008
6 AVFoundation 0x2cf6ae0c -[AVCaptureSession dealloc] + 172
7 Foundation 0x2e9d1a44 NSKVODeallocate + 60
8 libobjc.A.dylib 0x3849bb06 objc_object::sidetable_release(bool) + 170
9 libobjc.A.dylib 0x3848d002 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354
10 QuartzCore 0x3043e864 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 64
11 CoreFoundation 0x2e01b1ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
12 CoreFoundation 0x2e018b6c __CFRunLoopDoObservers + 280
13 CoreFoundation 0x2e018eae __CFRunLoopRun + 726
14 CoreFoundation 0x2df83c22 CFRunLoopRunSpecific + 518
15 CoreFoundation 0x2df83a06 CFRunLoopRunInMode + 102
16 GraphicsServices 0x32caa27e GSEventRunModal + 134
17 UIKit 0x30827044 UIApplicationMain + 1132
18 AppName 0x0013ed06 main (main.m:17)
19 libdyld.dylib 0x38998ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x38a3c83c kevent64 + 24
1 libdispatch.dylib 0x3897d210 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3897cf96 _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 CoreFoundation 0x2e01a7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e018ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2df83c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df83a06 CFRunLoopRunInMode + 102
6 Foundation 0x2e9be2f2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2ea33c82 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 3 name: com.apple.CFSocket.private
Thread 3:
0 libsystem_kernel.dylib 0x38a4f440 __select + 20
1 CoreFoundation 0x2e01e680 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
3 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
4 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 4 name: AFNetworking
Thread 4:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 CoreFoundation 0x2e01a7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e018ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2df83c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df83a06 CFRunLoopRunInMode + 102
6 Foundation 0x2e9713d6 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x2e9c230c -[NSRunLoop(NSRunLoop) run] + 76
8 AppName 0x001637b6 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:184)
9 Foundation 0x2ea33c82 __NSThread__main__ + 1058
10 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
11 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
12 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 5 name: com.apple.coremedia.player.async
Thread 5:
0 libsystem_kernel.dylib 0x38a3cadc semaphore_wait_trap + 8
1 libdispatch.dylib 0x3897b428 _dispatch_semaphore_wait_slow + 172
2 MediaToolbox 0x2f46f83c fpa_AsyncMovieControlThread + 1752
3 CoreMedia 0x2e5ae234 figThreadMain + 192
4 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
5 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
6 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 CoreFoundation 0x2e01a7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e018ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2df83c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df83a06 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2d006584 GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2cffa99c CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 7 name: com.apple.coremedia.player.async
Thread 7:
0 libsystem_kernel.dylib 0x38a3cadc semaphore_wait_trap + 8
1 libdispatch.dylib 0x3897b428 _dispatch_semaphore_wait_slow + 172
2 MediaToolbox 0x2f46f83c fpa_AsyncMovieControlThread + 1752
3 CoreMedia 0x2e5ae234 figThreadMain + 192
4 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
5 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
6 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 8 name: com.apple.coremedia.player.remote
Thread 8:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 MediaToolbox 0x2f475c58 FigExpressNotificationThread + 84
3 CoreMedia 0x2e5ae234 figThreadMain + 192
4 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
5 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
6 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 9:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 CoreFoundation 0x2e01a7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2e018ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2df83c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2dfc7736 CFRunLoopRun + 94
6 CoreMotion 0x2e63a230 ___lldb_unnamed_function1404$$CoreMotion + 724
7 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
8 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
9 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 10 name: com.apple.coremedia.player.async
Thread 10:
0 libsystem_kernel.dylib 0x38a3cadc semaphore_wait_trap + 8
1 libdispatch.dylib 0x3897b428 _dispatch_semaphore_wait_slow + 172
2 MediaToolbox 0x2f46f83c fpa_AsyncMovieControlThread + 1752
3 CoreMedia 0x2e5ae234 figThreadMain + 192
4 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
5 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
6 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 11:
0 libsystem_kernel.dylib 0x38a4fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38ab5dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 12:
0 libsystem_kernel.dylib 0x38a4fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38ab5dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 13:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 MediaToolbox 0x2f588594 FigRemakerFamilyClient_ReaderExtractAndRetainNextSampleBuffer + 92
3 MediaToolbox 0x2f5835a0 remoteReader_ExtractAndRetainNextSampleBuffer + 108
4 AVFoundation 0x2cf2a8ba -[AVAssetReaderOutput copyNextSampleBuffer] + 222
5 AppName 0x0016a320 __36-[MediaWriter performWrite:onError:]_block_invoke141 (MediaWriter.m:188)
6 AVFoundation 0x2cf3d810 -[AVAssetWriterInputMediaDataRequester requestMediaDataIfNecessary] + 84
7 libdispatch.dylib 0x38973d18 _dispatch_call_block_and_release + 8
8 libdispatch.dylib 0x3897a26e _dispatch_queue_drain$VARIANT$mp + 370
9 libdispatch.dylib 0x3897a066 _dispatch_queue_invoke$VARIANT$mp + 38
10 libdispatch.dylib 0x3897acde _dispatch_root_queue_drain + 74
11 libdispatch.dylib 0x3897af54 _dispatch_worker_thread2 + 52
12 libsystem_pthread.dylib 0x38ab5dbc _pthread_wqthread + 296
13 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 14 name: com.apple.coremedia.player.async
Thread 14:
0 libsystem_kernel.dylib 0x38a3cadc semaphore_wait_trap + 8
1 libdispatch.dylib 0x3897b428 _dispatch_semaphore_wait_slow + 172
2 MediaToolbox 0x2f46f83c fpa_AsyncMovieControlThread + 1752
3 CoreMedia 0x2e5ae234 figThreadMain + 192
4 libsystem_pthread.dylib 0x38ab7c1a _pthread_body + 138
5 libsystem_pthread.dylib 0x38ab7b8a _pthread_start + 98
6 libsystem_pthread.dylib 0x38ab5c8c thread_start + 4
Thread 15:
0 libsystem_kernel.dylib 0x38a4fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38ab5dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 16:
0 libsystem_kernel.dylib 0x38a4fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38ab5dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 17:
0 libsystem_kernel.dylib 0x38a3ca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x38a3c888 mach_msg + 44
2 MediaToolbox 0x2f5896b4 FigRemakerFamilyClient_WriterAddSampleBuffer + 112
3 MediaToolbox 0x2f581bec remoteWriter_AddSampleBuffer + 236
4 AVFoundation 0x2cf3c144 -[AVFigAssetWriterTrack addSampleBuffer:error:] + 84
5 AVFoundation 0x2cf3cfcc -[AVFigAssetWriterAudioTrack addSampleBuffer:error:] + 300
6 AVFoundation 0x2cf39afa -[AVAssetWriterInputWritingHelper appendSampleBuffer:] + 74
7 AVFoundation 0x2cf37d62 -[AVAssetWriterInput appendSampleBuffer:] + 46
8 AppName 0x0016a190 __36-[MediaWriter performWrite:onError:]_block_invoke (MediaWriter.m:162)
9 AVFoundation 0x2cf3d810 -[AVAssetWriterInputMediaDataRequester requestMediaDataIfNecessary] + 84
10 libdispatch.dylib 0x38973d18 _dispatch_call_block_and_release + 8
11 libdispatch.dylib 0x3897a26e _dispatch_queue_drain$VARIANT$mp + 370
12 libdispatch.dylib 0x3897a066 _dispatch_queue_invoke$VARIANT$mp + 38
13 libdispatch.dylib 0x3897acde _dispatch_root_queue_drain + 74
14 libdispatch.dylib 0x3897af54 _dispatch_worker_thread2 + 52
15 libsystem_pthread.dylib 0x38ab5dbc _pthread_wqthread + 296
16 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 18:
0 libsystem_kernel.dylib 0x38a3e664 fsync + 8
1 libsqlite3.dylib 0x3876d73c ___lldb_unnamed_function199$$libsqlite3.dylib + 44
2 libsqlite3.dylib 0x387a59e8 ___lldb_unnamed_function529$$libsqlite3.dylib + 1168
3 libsqlite3.dylib 0x3876d138 ___lldb_unnamed_function197$$libsqlite3.dylib + 336
4 libsqlite3.dylib 0x38763004 ___lldb_unnamed_function156$$libsqlite3.dylib + 552
5 libsqlite3.dylib 0x38744638 ___lldb_unnamed_function56$$libsqlite3.dylib + 1496
6 libsqlite3.dylib 0x3875fc32 ___lldb_unnamed_function123$$libsqlite3.dylib + 38026
7 libsqlite3.dylib 0x38755e2c sqlite3_step + 404
8 libsqlite3.dylib 0x38734952 sqlite3_exec + 358
9 CFNetwork 0x2dc14d30 __CFURLCache::ExecSQLStatement_NoLock(sqlite3*, char const*, int (*)(void*, int, char**, char**), void*, long) + 32
10 CFNetwork 0x2dc84bb8 __CFURLCache::_PreProcessCacheTasks() + 108
11 CFNetwork 0x2dc849da __CFURLCache::_CFURLCacheTimerCallback0() + 630
12 CFNetwork 0x2dc84754 __CFURLCache::_CFURLCacheTimerCallback(void*) + 28
13 libdispatch.dylib 0x3897c7fe _dispatch_source_invoke$VARIANT$mp + 258
14 libdispatch.dylib 0x3897a232 _dispatch_queue_drain$VARIANT$mp + 310
15 libdispatch.dylib 0x3897a066 _dispatch_queue_invoke$VARIANT$mp + 38
16 libdispatch.dylib 0x3897acde _dispatch_root_queue_drain + 74
17 libdispatch.dylib 0x3897af54 _dispatch_worker_thread2 + 52
18 libsystem_pthread.dylib 0x38ab5dbc _pthread_wqthread + 296
19 libsystem_pthread.dylib 0x38ab5c80 start_wqthread + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x176f9f60 r1: 0x30daa1e8 r2: 0x2cfeb38f r3: 0x00000000
r4: 0x30dba133 r5: 0x18e7bde0 r6: 0x30dad051 r7: 0x27d087f8
r8: 0x38b3fc28 r9: 0x7176d7d4 r10: 0x1903c100 r11: 0x18fdbd70
ip: 0x38b1e868 sp: 0x27d087c4 lr: 0x2cf78655 pc: 0x3848bb26
cpsr: 0x60000030
Can anybody tell me what's going wrong in iOS 7.0.x ONLY ? On other iOS versions its working correctly. Any kind of help is appreciated.
Thanks.

Did you dealloc correctly?
Try adding these lines to your dealloc method,
[self.session removeInput:self.videoIn];
[self.session removeOutput:self.videoOut];

Related

iOS 10 User Defaults Crash - Crashed: com.apple.root.user-initiated-qos SIGABRT

I'm getting some interesting crashes on iOS 10 only when saving into user defaults. Has anyone else seen a similar crash? Is this an iOS 10 bug or a change to the SDK we should prepare for?
+ (BOOL) saveObject:(NSObject<NSCoding>*)obj forKey:(NSString*)key{
if(key == nil || [key length] == 0) {
return NO;
}
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if(obj == nil) {
[defaults setObject:nil forKey:key];
} else {
NSData *myEncodedObject = [NSKeyedArchiver archivedDataWithRootObject:obj];
[defaults setObject:myEncodedObject forKey:key];
}
[defaults synchronize];
return YES;
}
#-1. com.apple.main-thread
0 libsystem_kernel.dylib 0x18407334c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1840731bc mach_msg + 72
2 CoreFoundation 0x1844ade64 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x1844aba80 __CFRunLoopRun + 1132
4 CoreFoundation 0x1843de2e4 CFRunLoopRunSpecific + 292
5 GraphicsServices 0x185db715c GSEventRunModal + 180
6 UIKit 0x18a2f26fc -[UIApplication _run] + 692
7 UIKit 0x18a2ed438 UIApplicationMain + 208
8 MyApp 0x1000c1db4 main (main.m:16)
9 libdispatch.dylib 0x183f80600 (Missing)
#0. com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x18407334c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1840731bc mach_msg + 72
2 CoreFoundation 0x1844ade64 <redacted> + 192
3 CoreFoundation 0x1844aba80 <redacted> + 1132
4 CoreFoundation 0x1843de2e4 CFRunLoopRunSpecific + 292
5 Foundation 0x184e8893c <redacted> + 304
6 Foundation 0x184ea9460 <redacted> + 96
7 UIKit 0x18ac28134 <redacted> + 136
8 Foundation 0x184f73b9c <redacted> + 1052
9 libsystem_pthread.dylib 0x1841549bc <redacted> + 240
10 libsystem_pthread.dylib 0x1841548cc _pthread_start + 274
11 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
#1. com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x18407334c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1840731bc mach_msg + 72
2 CoreFoundation 0x1844ade64 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x1844aba80 __CFRunLoopRun + 1132
4 CoreFoundation 0x1843de2e4 CFRunLoopRunSpecific + 292
5 CFNetwork 0x184b87a18 +[NSURLConnection(Loader) _resourceLoadLoop:] + 336
6 Foundation 0x184f73b9c __NSThread__start__ + 1052
7 libsystem_pthread.dylib 0x1841549bc _pthread_body + 240
8 libsystem_pthread.dylib 0x1841548cc _pthread_body + 274
9 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
#2. com.twitter.crashlytics.ios.MachExceptionServer
0 libsystem_kernel.dylib 0x18407334c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1840731bc mach_msg + 72
2 MyApp 0x10027c4e0 CLSMachExceptionServer + 4298097888
3 libsystem_pthread.dylib 0x1841549bc _pthread_body + 240
4 libsystem_pthread.dylib 0x1841548cc _pthread_body + 274
5 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
#3. GAIThread
0 libsystem_kernel.dylib 0x18407334c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1840731bc mach_msg + 72
2 CoreFoundation 0x1844ade64 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x1844aba80 __CFRunLoopRun + 1132
4 CoreFoundation 0x1843de2e4 CFRunLoopRunSpecific + 292
5 Foundation 0x184e8893c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x184edd214 -[NSRunLoop(NSRunLoop) run] + 88
7 MyApp 0x100104964 +[GAI threadMain:] + 4296558948
8 Foundation 0x184f73b9c __NSThread__start__ + 1052
9 libsystem_pthread.dylib 0x1841549bc _pthread_body + 240
10 libsystem_pthread.dylib 0x1841548cc _pthread_body + 274
11 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
#4. AVAudioSession Notify Thread
0 libsystem_kernel.dylib 0x18407334c mach_msg_trap + 8
1 libsystem_kernel.dylib 0x1840731bc mach_msg + 72
2 CoreFoundation 0x1844ade64 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x1844aba80 __CFRunLoopRun + 1132
4 CoreFoundation 0x1843de2e4 CFRunLoopRunSpecific + 292
5 AVFAudio 0x19d7a8e60 GenericRunLoopThread::Entry(void*) + 164
6 AVFAudio 0x19d7c6804 CAPThread::Entry(CAPThread*) + 84
7 libsystem_pthread.dylib 0x1841549bc _pthread_body + 240
8 libsystem_pthread.dylib 0x1841548cc _pthread_body + 274
9 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
#5. Thread
0 libsystem_kernel.dylib 0x184090df8 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x184153b78 _pthread_cond_wait + 692
2 Foundation 0x184e93668 -[NSCondition waitUntilDate:] + 340
3 MyApp 0x10008e5e0 -[VideoRepository queueThreadStart] (VideoRepository.m:145)
4 Foundation 0x184f73b9c __NSThread__start__ + 1052
5 libsystem_pthread.dylib 0x1841549bc _pthread_body + 240
6 libsystem_pthread.dylib 0x1841548cc _pthread_body + 274
7 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
#6. com.apple.CFSocket.private
0 libsystem_kernel.dylib 0x184091218 __select + 8
1 CoreFoundation 0x1844b4d08 <redacted> + 640
2 libsystem_pthread.dylib 0x1841549bc <redacted> + 240
3 libsystem_pthread.dylib 0x1841548cc _pthread_start + 274
4 libsystem_pthread.dylib 0x184151ed8 thread_start + 4
Crashed: com.apple.root.user-initiated-qos
0 libsystem_kernel.dylib 0x184090ff0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1841564c0 pthread_kill + 112
2 libsystem_c.dylib 0x184006448 abort + 140
3 libsystem_malloc.dylib 0x1840d4eec _nano_vet_and_size_of_live + 330
4 libsystem_malloc.dylib 0x1840d62d4 nano_free + 220
5 CoreFoundation 0x1845338c4 __CFBasicHashDrain + 380
6 CoreFoundation 0x1844afbec _CFRelease + 216
7 CoreFoundation 0x184475ba8 __CFBinaryPlistWriteOrPresize + 556
8 Foundation 0x184ee7428 -[NSKeyedArchiver finishEncoding] + 588
9 Foundation 0x184eecb14 +[NSKeyedArchiver archivedDataWithRootObject:] + 184
10 MyApp 0x10009f620 +[Settings saveObject:forKey:] (Settings.m:141)
11 MyApp 0x100091aa8 +[AuxCaster indexCategoriesArray:] (AuxCaster.m:428)
12 MyApp 0x1000c9084 -[ChannelPage addRemoveSpolightIndexes] (ChannelPage.m:265)
13 MyApp 0x1000c9710 __47-[ChannelPage preloadCategoriesMultipleThreads]_block_invoke.241 (ChannelPage.m:307)
14 libdispatch.dylib 0x183f49134 _dispatch_call_block_and_release + 24
15 libdispatch.dylib 0x183f490f4 _dispatch_client_callout + 16
16 libdispatch.dylib 0x183f5d07c _dispatch_root_queue_drain + 1032
17 libdispatch.dylib 0x183f5cc14 _dispatch_worker_thread3 + 124
18 libsystem_pthread.dylib 0x1841523d8 _pthread_wqthread + 1276
19 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4
#8. Thread
0 libsystem_kernel.dylib 0x184091a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18415247c _pthread_wqthread + 1440
2 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4
#9. Thread
0 libsystem_kernel.dylib 0x184091a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18415247c _pthread_wqthread + 1440
2 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4
#10. Thread
0 libsystem_pthread.dylib 0x184151ecc pthread_workqueue_addthreads_np + 126
#11. Thread
0 libsystem_kernel.dylib 0x184091a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18415247c _pthread_wqthread + 1440
2 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4
#12. Thread
0 libsystem_kernel.dylib 0x184091a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x184152298 _pthread_wqthread + 956
2 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4
#13. Thread
0 libsystem_kernel.dylib 0x184091a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18415247c _pthread_wqthread + 1440
2 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4
#14. Thread
0 libsystem_kernel.dylib 0x184091a88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x18415247c _pthread_wqthread + 1440
2 libsystem_pthread.dylib 0x184151ed0 start_wqthread + 4

App crashes on start on real device only

I wanted to publish my game app today(using Swift - xCode GTM and Sprite kit framework). My app works fine on the simulator but when I tried it on a real device - iPhone 4 iOS 7, it crashes on start:
class func unarchiveFromFile(file : NSString) -> SKNode? {
let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks")//CRASH!
var sceneData = NSData.dataWithContentsOfFile(path!, options: .DataReadingMappedIfSafe, error: nil)
var archiver = NSKeyedUnarchiver(forReadingWithData: sceneData)
archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as GameScene
archiver.finishDecoding()
return scene
}
}
here is my Crash log:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000000000defe
Triggered by Thread: 0
Thread 0 Crashed:
0 libswiftCore.dylib 0x003347d0 0x1b6000 + 1566672
1 libswiftCore.dylib 0x001f3a64 0x1b6000 + 252516
2 MyApp 0x000d2904 0xc4000 + 59652
3 MyApp 0x000d36d8 0xc4000 + 63192
4 MyApp 0x000d4214 0xc4000 + 66068
5 MyApp 0x000d4dc4 0xc4000 + 69060
6 UIKit 0x3079e5fe -[UIViewController loadViewIfRequired] + 514
7 UIKit 0x3079e3bc -[UIViewController view] + 20
8 UIKit 0x307a5088 -[UIWindow addRootViewControllerViewIfPossible] + 60
9 UIKit 0x307a275e -[UIWindow _setHidden:forced:] + 302
10 UIKit 0x3080da50 -[UIWindow makeKeyAndVisible] + 56
11 UIKit 0x3080a80c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1652
12 UIKit 0x30804d0e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 710
13 UIKit 0x3079f6a2 -[UIApplication handleEvent:withNewEvent:] + 3126
14 UIKit 0x3079e9a4 -[UIApplication sendEvent:] + 68
15 UIKit 0x308044f8 _UIApplicationHandleEvent + 660
16 GraphicsServices 0x32c3670a _PurpleEventCallback + 606
17 GraphicsServices 0x32c362f2 PurpleEventCallback + 30
18 CoreFoundation 0x2dff39e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
19 CoreFoundation 0x2dff397e __CFRunLoopDoSource1 + 342
20 CoreFoundation 0x2dff2152 __CFRunLoopRun + 1394
21 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
22 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
23 UIKit 0x30803794 -[UIApplication _run] + 756
24 UIKit 0x307fea3c UIApplicationMain + 1132
25 MyApp 0x000da594 0xc4000 + 91540
26 MyApp 0x000da5d0 0xc4000 + 91600
27 libdyld.dylib 0x38858ab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x388fc83c kevent64 + 24
1 libdispatch.dylib 0x38847e08 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x388373ee _dispatch_mgr_thread$VARIANT$up + 34
Thread 2:
0 libsystem_kernel.dylib 0x3890fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38975dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38975c80 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x3890fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38975dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38975c80 start_wqthread + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x3890efa8 __psynch_mutexwait + 24
1 libsystem_pthread.dylib 0x38975f0a _pthread_mutex_lock + 302
2 WebCore 0x35e2f138 _WebTryThreadLock(bool) + 104
3 WebCore 0x35e2f0ba WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 42
4 CoreFoundation 0x2dff41d2 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
5 CoreFoundation 0x2dff1b74 __CFRunLoopDoObservers + 280
6 CoreFoundation 0x2dff1f84 __CFRunLoopRun + 932
7 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
8 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
9 WebCore 0x35e2dbae RunWebThread(void*) + 414
10 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
11 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
12 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x388fca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x388fc888 mach_msg + 44
2 CoreFoundation 0x2dff37c6 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2dff1eec __CFRunLoopRun + 780
4 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
6 Foundation 0x2e996492 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2ea0be22 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x388fca8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x388fc888 mach_msg + 44
2 CoreFoundation 0x2dff37c6 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2dff1eec __CFRunLoopRun + 780
4 CoreFoundation 0x2df5cce2 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2df5cac6 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2cfe1584 GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2cfd5a94 CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 7:
0 libsystem_kernel.dylib 0x3890fc7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38975dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38975c80 start_wqthread + 4
Thread 8 name: JavaScriptCore::BlockFree
Thread 8:
0 libsystem_kernel.dylib 0x3890ef38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38977224 _pthread_cond_wait + 536
2 libsystem_pthread.dylib 0x38978040 pthread_cond_timedwait + 40
3 JavaScriptCore 0x2ef80eb8 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 104
4 JavaScriptCore 0x2ef80ce4 JSC::BlockAllocator::blockFreeingThreadMain() + 88
5 JavaScriptCore 0x2ef7e3a8 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x38977c1a _pthread_body + 138
7 libsystem_pthread.dylib 0x38977b8a _pthread_start + 98
8 libsystem_pthread.dylib 0x38975c8c thread_start + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00362ac4 r3: 0x000000b6
r4: 0x00362ac4 r5: 0x00000000 r6: 0x145c97b0 r7: 0x27d3d364
r8: 0x1456eb50 r9: 0x00000fff r10: 0x145c97b0 r11: 0x00362ac0
ip: 0x3a5431d0 sp: 0x27d3d354 lr: 0x00334183 pc: 0x003347d0
cpsr: 0x60000030
The pathForResource() function returns a String?, indicating that (because it's an optional) there's a chance no value will be returned. I'm guessing the method is returning nil, but because you're assigning it using a let statement, the app is crashing.
I'm a little surprised it's crashing directly on that line though. You should be able to assign nil using the let keyword. In any case, if the value is nil, you'd definitely encounter a crash on your next line when you force unwrap the optional:
var sceneData = NSData.dataWithContentsOfFile(path!, options: .DataReadingMappedIfSafe, error: nil)
^ here
Try this:
if let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks") {
/* ... (your code using path) ... */
} else {
NSLog("Unable to locate path for resource: \(file)")
}
I have a feeling you'll see that NSLog() output at launch.

Phonegap On Resume App Crash

Whenever my app is resuming from lock screen in iOS7, it is getting crashed. The problem is coming mostly in iOS7 devices and it is happening only when the screen is getting locked out automatically. When the I unlock the screen and press any html div or button in the app, the app crashes.
I already tried the solution posted here -
Workaround for PhoneGap, EXC_BAD_ACCESS on getDeviceInfo . It doesn't work.
The Crash log is below -
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xbe4008d4
Triggered by Thread: 3
Thread 0:
0 libsystem_kernel.dylib 0x38590a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3859087c mach_msg + 36
2 CoreFoundation 0x2dc61554 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2dc5fcba __CFRunLoopRun + 858
4 CoreFoundation 0x2dbca46c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2dbca24e CFRunLoopRunInMode + 102
6 GraphicsServices 0x329042e6 GSEventRunModal + 134
7 UIKit 0x3047f840 UIApplicationMain + 1132
8 SkiWithMe 0x0005f646 0x3f000 + 132678
9 libdyld.dylib 0x384ecab4 start + 0
Thread 1:
0 libsystem_kernel.dylib 0x38590838 kevent64 + 24
1 libdispatch.dylib 0x384df0d0 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x384d961e _dispatch_mgr_thread + 34
Thread 2 name: com.apple.NSURLConnectionLoader
Thread 2:
0 libsystem_kernel.dylib 0x38590a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3859087c mach_msg + 36
2 CoreFoundation 0x2dc61554 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2dc5fc74 __CFRunLoopRun + 788
4 CoreFoundation 0x2dbca46c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2dbca24e CFRunLoopRunInMode + 102
6 Foundation 0x2e6054bc +[NSURLConnection(Loader) _resourceLoadLoop:] + 316
7 Foundation 0x2e67ac32 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
9 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
10 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 3 name: WebThread
Thread 3 Crashed:
0 WebCore 0x35b08dba WebCore::TimerBase::heapDeleteMin() + 30
1 WebCore 0x35b08ca2 WebCore::ThreadTimers::sharedTimerFiredInternal() + 90
2 WebCore 0x35b08c1e WebCore::timerFired(__CFRunLoopTimer*, void*) + 22
3 CoreFoundation 0x2dc61e7c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12
4 CoreFoundation 0x2dc61a96 __CFRunLoopDoTimer + 790
5 CoreFoundation 0x2dc5fe1e __CFRunLoopRun + 1214
6 CoreFoundation 0x2dbca46c CFRunLoopRunSpecific + 520
7 CoreFoundation 0x2dbca24e CFRunLoopRunInMode + 102
8 WebCore 0x35b970c0 RunWebThread(void*) + 416
9 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
10 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
11 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x38590a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3859087c mach_msg + 36
2 CoreFoundation 0x2dc61554 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2dc5fc74 __CFRunLoopRun + 788
4 CoreFoundation 0x2dbca46c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2dbca24e CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2cc395ae GenericRunLoopThread::Entry(void*) + 126
7 libAVFAudio.dylib 0x2cc2dafc CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
9 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
10 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 5 name: JavaScriptCore::BlockFree
Thread 5:
0 libsystem_kernel.dylib 0x385a2f38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38609262 _pthread_cond_wait + 538
2 libsystem_pthread.dylib 0x3860a07c pthread_cond_timedwait + 40
3 JavaScriptCore 0x2ebee55e WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 102
4 JavaScriptCore 0x2ebee38c JSC::BlockAllocator::blockFreeingThreadMain() + 88
5 JavaScriptCore 0x2ebeba68 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
7 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
8 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 6 name: JavaScriptCore::Marking
Thread 6:
0 libsystem_kernel.dylib 0x385a2f38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38609262 _pthread_cond_wait + 538
2 libsystem_pthread.dylib 0x3860a03c pthread_cond_wait + 36
3 JavaScriptCore 0x2ed8caea JSC::GCThread::waitForNextPhase() + 74
4 JavaScriptCore 0x2ed8cb44 JSC::GCThread::gcThreadMain() + 48
5 JavaScriptCore 0x2ebeba68 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
7 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
8 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 7:
0 libsystem_kernel.dylib 0x385a2f38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38609262 _pthread_cond_wait + 538
2 libsystem_pthread.dylib 0x3860a03c pthread_cond_wait + 36
3 Foundation 0x2e6055ba -[NSCondition wait] + 190
4 SkiWithMe 0x000f3564 0x3f000 + 738660
5 Foundation 0x2e67ac32 __NSThread__main__ + 1058
6 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
7 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
8 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 8:
0 libsystem_kernel.dylib 0x38590a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3859087c mach_msg + 36
2 CoreFoundation 0x2dc61554 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2dc5fc74 __CFRunLoopRun + 788
4 CoreFoundation 0x2dbca46c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2dbca24e CFRunLoopRunInMode + 102
6 Foundation 0x2e5b8692 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250
7 Foundation 0x2e6094d4 -[NSRunLoop(NSRunLoop) run] + 76
8 SkiWithMe 0x0011b610 0x3f000 + 902672
9 Foundation 0x2e67ac32 __NSThread__main__ + 1058
10 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
11 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
12 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 9 name: WebCore: CFNetwork Loader
Thread 9:
0 libsystem_kernel.dylib 0x38590a84 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3859087c mach_msg + 36
2 CoreFoundation 0x2dc61554 __CFRunLoopServiceMachPort + 152
3 CoreFoundation 0x2dc5fc74 __CFRunLoopRun + 788
4 CoreFoundation 0x2dbca46c CFRunLoopRunSpecific + 520
5 CoreFoundation 0x2dbca24e CFRunLoopRunInMode + 102
6 WebCore 0x35be00a2 WebCore::runLoaderThread(void*) + 250
7 JavaScriptCore 0x2ebeba68 WTF::wtfThreadEntryPoint(void*) + 12
8 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
9 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
10 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 10 name: com.apple.CFSocket.private
Thread 10:
0 libsystem_kernel.dylib 0x385a3440 select$DARWIN_EXTSN + 20
1 CoreFoundation 0x2dc65456 __CFSocketManager + 482
2 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
3 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
4 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 11 name: WebCore: LocalStorage
Thread 11:
0 libsystem_kernel.dylib 0x385a2f38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38609262 _pthread_cond_wait + 538
2 libsystem_pthread.dylib 0x3860a03c pthread_cond_wait + 36
3 JavaScriptCore 0x2ebee530 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 56
4 WebCore 0x35ccb344 WTF::PassOwnPtr<WTF::Function<void ()> > WTF::MessageQueue<WTF::Function<void ()> >::waitForMessageFilteredWithTimeout<bool (WTF::Function<void ()>*)>(WTF::MessageQueueWaitResult&, bool (&)(WTF::Function<void ()>*), double) + 104
5 WebCore 0x35ccb2ca WebCore::StorageThread::threadEntryPoint() + 162
6 JavaScriptCore 0x2ebeba68 WTF::wtfThreadEntryPoint(void*) + 12
7 libsystem_pthread.dylib 0x38609c5a _pthread_body + 138
8 libsystem_pthread.dylib 0x38609bca _pthread_start + 98
9 libsystem_pthread.dylib 0x38607ccc thread_start + 4
Thread 12:
0 libsystem_kernel.dylib 0x385a3c7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38607e06 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38607cc0 start_wqthread + 4
Thread 13:
0 libsystem_kernel.dylib 0x385a3c7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38607e06 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38607cc0 start_wqthread + 4
Thread 14:
0 libsystem_kernel.dylib 0x385a3c7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38607e06 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38607cc0 start_wqthread + 4
Thread 3 crashed with ARM Thread State (32-bit):
r0: 0x800004f8 r1: 0x3e4003e0 r2: 0xbe4008d8 r3: 0x00000040
r4: 0x02b1c3c0 r5: 0x04602e74 r6: 0x04602e74 r7: 0x02d0308c
r8: 0x16dc6528 r9: 0x0f9000f8 r10: 0x00000000 r11: 0x16dc64d0
ip: 0x38940808 sp: 0x02d0307c lr: 0x35b08ca7 pc: 0x35b08dba
cpsr: 0x20000030
i think u have a issue when ur app back in foreground from the background ,so it's happens due to when u r trying to access some data or array on background to foreground.that var or array wont accessible or u defined dynamic value thats why it's cause crashed .

iOS uiwebview crash in WebThread

I'm looking for some advice or help diagnosing this crash that I am seeing. For the moment, I think it is probably a webkit bug, but anything is possible, so please provide any insight you may have:
Incident Identifier: AEB8EE37-E5D4-4975-97F4-2B2038AC225A
CrashReporter Key: 92349a05395ea832c40c49c9e48997c1d65a2371
Hardware Model: iPad3,3
Process: Touch [242]
Path: /var/mobile/Applications/4D2CAEEE-D0F8-4BB4-989A-F8623C877C78/Touch.app/Touch
Identifier: StayinFrontTouch
Version: 3.2.40 (3.2.40)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-04-30 15:26:46.137 +1200
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000258
Triggered by Thread: 2
Thread 0:
0 libsystem_kernel.dylib 0x3a2ffa58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a2ff854 mach_msg + 44
2 CoreFoundation 0x2f06e896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2f06d002 __CFRunLoopRun + 850
4 CoreFoundation 0x2efd7f0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2efd7cee CFRunLoopRunInMode + 102
6 GraphicsServices 0x33f0a65e GSEventRunModal + 134
7 UIKit 0x31923168 UIApplicationMain + 1132
8 Touch 0x000c064a 0xbd000 + 13898
9 Touch 0x000bf854 0xbd000 + 10324
Thread 1:
0 libsystem_kernel.dylib 0x3a2ff808 kevent64 + 24
1 libdispatch.dylib 0x3a241078 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3a240dfe _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2 name: WebThread
Thread 2 Crashed:
0 WebCore 0x37584302 WebCore::SubresourceLoader::didReceiveResponse(WebCore::ResourceResponse const&) + 26
1 WebCore 0x377f751c WebCore::DocumentLoader::substituteResourceDeliveryTimerFired(WebCore::Timer*) + 212
2 WebCore 0x374ad3f4 WebCore::ThreadTimers::sharedTimerFiredInternal() + 132
3 WebCore 0x374ad346 WebCore::timerFired(__CFRunLoopTimer*, void*) + 22
4 CoreFoundation 0x2f06f1b4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12
5 CoreFoundation 0x2f06edca __CFRunLoopDoTimer + 778
6 CoreFoundation 0x2f06d166 __CFRunLoopRun + 1206
7 CoreFoundation 0x2efd7f0a CFRunLoopRunSpecific + 518
8 CoreFoundation 0x2efd7cee CFRunLoopRunInMode + 102
9 WebCore 0x3753a116 RunWebThread(void*) + 414
10 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
11 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
12 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 3 name: com.apple.NSURLConnectionLoader
Thread 3:
0 libsystem_kernel.dylib 0x3a2ffa58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a2ff854 mach_msg + 44
2 CoreFoundation 0x2f06e896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2f06cfbc __CFRunLoopRun + 780
4 CoreFoundation 0x2efd7f0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2efd7cee CFRunLoopRunInMode + 102
6 Foundation 0x2fa17082 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2fa8ca5a __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
9 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
10 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x3a2ffa58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a2ff854 mach_msg + 44
2 CoreFoundation 0x2f06e896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2f06cfbc __CFRunLoopRun + 780
4 CoreFoundation 0x2efd7f0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2efd7cee CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2e04f44c GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2e0437bc CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
9 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
10 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 5 name: JavaScriptCore::BlockFree
Thread 5:
0 libsystem_kernel.dylib 0x3a311f2c __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x3a37af22 _pthread_cond_wait + 518
2 libsystem_pthread.dylib 0x3a37bd60 pthread_cond_wait + 36
3 JavaScriptCore 0x30004ee4 JSC::BlockAllocator::blockFreeingThreadMain() + 204
4 JavaScriptCore 0x30002538 WTF::wtfThreadEntryPoint(void*) + 12
5 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
6 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
7 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 6 name: JavaScriptCore::Marking
Thread 6:
0 libsystem_kernel.dylib 0x3a311f2c __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x3a37af22 _pthread_cond_wait + 518
2 libsystem_pthread.dylib 0x3a37bd60 pthread_cond_wait + 36
3 JavaScriptCore 0x301a0406 JSC::GCThread::waitForNextPhase() + 74
4 JavaScriptCore 0x301a0460 JSC::GCThread::gcThreadMain() + 48
5 JavaScriptCore 0x30002538 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
7 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
8 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 7 name: WebCore: CFNetwork Loader
Thread 7:
0 libsystem_kernel.dylib 0x3a2ffa58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a2ff854 mach_msg + 44
2 CoreFoundation 0x2f06e896 __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2f06cfbc __CFRunLoopRun + 780
4 CoreFoundation 0x2efd7f0a CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2efd7cee CFRunLoopRunInMode + 102
6 WebCore 0x37582b12 WebCore::runLoaderThread(void*) + 250
7 JavaScriptCore 0x30002538 WTF::wtfThreadEntryPoint(void*) + 12
8 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
9 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
10 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 8 name: com.apple.CFSocket.private
Thread 8:
0 libsystem_kernel.dylib 0x3a312434 __select + 20
1 CoreFoundation 0x2f072758 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
3 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
4 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 9 name: WebCore: LocalStorage
Thread 9:
0 libsystem_kernel.dylib 0x3a311f2c __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x3a37af22 _pthread_cond_wait + 518
2 libsystem_pthread.dylib 0x3a37bd60 pthread_cond_wait + 36
3 JavaScriptCore 0x30005012 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 58
4 WebCore 0x3766cf2c WTF::PassOwnPtr > WTF::MessageQueue >::waitForMessageFilteredWithTimeout*)>(WTF::MessageQueueWaitResult&, bool (&)(WTF::Function*), double) + 104
5 WebCore 0x3766ceb2 WebCore::StorageThread::threadEntryPoint() + 162
6 JavaScriptCore 0x30002538 WTF::wtfThreadEntryPoint(void*) + 12
7 libsystem_pthread.dylib 0x3a37b916 _pthread_body + 138
8 libsystem_pthread.dylib 0x3a37b886 _pthread_start + 98
9 libsystem_pthread.dylib 0x3a379aa0 thread_start + 4
Thread 10:
0 libsystem_kernel.dylib 0x3a312c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a379bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a379a94 start_wqthread + 4
Thread 11:
0 libsystem_kernel.dylib 0x3a312c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a379bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a379a94 start_wqthread + 4
Thread 12:
0 libsystem_kernel.dylib 0x3a312c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a379bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a379a94 start_wqthread + 4
Thread 13:
0 libsystem_kernel.dylib 0x3a312c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a379bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a379a94 start_wqthread + 4
Thread 14:
0 libsystem_kernel.dylib 0x3a312c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a379bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a379a94 start_wqthread + 4
Thread 15:
0 libsystem_kernel.dylib 0x3a312c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a379bda _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a379a94 start_wqthread + 4
Thread 2 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x04ee0238 r2: 0x375842e9 r3: 0x019cb6b8
r4: 0x0a916c00 r5: 0x04ee0238 r6: 0x0a916c00 r7: 0x01bbf028
r8: 0x0549ea00 r9: 0x00000002 r10: 0x0549e9c8 r11: 0x03bc3000
ip: 0x3a6c7838 sp: 0x01bbf014 lr: 0x377f751f pc: 0x37584302
cpsr: 0x20000030
Binary Images:
...
I did some further investigation into the stack trace and found the code for Subresourceloader here (https://webkit.googlesource.com/WebKit/+/master/Source/WebCore/loader/SubresourceLoader.cpp).
My guess is that m_resource is NULL at this point marked with (****) causing the crash:
void SubresourceLoader::didReceiveResponse(const ResourceResponse& response)
{
ASSERT(!response.isNull());
ASSERT(m_state == Initialized);
// Reference the object in this method since the additional processing can do
// anything including removing the last reference to this object; one example of this is 3266216.
Ref<SubresourceLoader> protect(*this);
if (m_resource->resourceToRevalidate()) { ****
if (response.httpStatusCode() == 304) {
// 304 Not modified / Use local copy
// Existing resource is ok, just use it updating the expiration time.
m_resource->setResponse(response);
memoryCache()->revalidationSucceeded(m_resource, response);
if (!reachedTerminalState())
ResourceLoader::didReceiveResponse(response);
return;
}
// Did not get 304 response, continue as a regular resource load.
memoryCache()->revalidationFailed(m_resource);
}
...
If it worked after a reinstall then you could try doing the URL request without caching, since I would assume that will give the same outcome:
NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:30];
[webView loadRequest:request];
I'm guessing something is going wrong with the caching of a resource.

What could cause this crash?

I occasionally get a crash report which looks like to following:
Incident Identifier: 9E8A29CD-C473-41BE-9018-2DFEC530612B
CrashReporter Key: bee45cc2c49f3c1a0c3793b1a519a04012b8dffe
Hardware Model: iPad3,1
Process: dominicanorder [17420]
Path: /var/mobile/Applications/2154A91A-04D2-4F93-A116-DA276DEB6E90/dominicanorder.app/dominicanorder
Identifier: org.idoms.dominicanorder
Version: 232 (1.2.4)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-01-13 09:03:58.173 +0000
OS Version: iOS 7.0.4 (11B554a)
Report Version: 104
Exception Type: EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 1
Thread 0:
0 libobjc.A.dylib 0x382ec7f0 objc_release + 16
1 UIKit 0x30517a24 -[UIWebTouchEventsGestureRecognizer dealloc] + 44
2 libobjc.A.dylib 0x382fab06 objc_object::sidetable_release(bool) + 170
3 CoreFoundation 0x2dab1650 CFRelease + 552
4 CoreFoundation 0x2dab91dc -[__NSArrayI dealloc] + 60
5 libobjc.A.dylib 0x382fab06 objc_object::sidetable_release(bool) + 170
6 libobjc.A.dylib 0x382ec002 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 354
7 CoreFoundation 0x2dab497c _CFAutoreleasePoolPop + 12
8 UIKit 0x302ec248 _wrapRunLoopWithAutoreleasePoolHandler + 32
9 CoreFoundation 0x2db4c1ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
10 CoreFoundation 0x2db49b6c __CFRunLoopDoObservers + 280
11 CoreFoundation 0x2db49eae __CFRunLoopRun + 726
12 CoreFoundation 0x2dab4c22 CFRunLoopRunSpecific + 518
13 CoreFoundation 0x2dab4a06 CFRunLoopRunInMode + 102
14 GraphicsServices 0x327a827e GSEventRunModal + 134
15 UIKit 0x30358044 UIApplicationMain + 1132
16 dominicanorder 0x000d09ce 0xcc000 + 18894
17 dominicanorder 0x000d0984 0xcc000 + 18820
Thread 1 Crashed:
0 libsystem_kernel.dylib 0x3889b83c kevent64 + 24
1 libdispatch.dylib 0x387dc210 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x387dbf96 _dispatch_mgr_thread$VARIANT$mp + 34
Thread 2:
0 libsystem_kernel.dylib 0x388aec7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38914dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38914c80 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x388aec7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38914dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38914c80 start_wqthread + 4
Thread 4:
0 libsystem_kernel.dylib 0x3889ba8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3889b888 mach_msg + 44
2 CoreFoundation 0x2db4b7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2db49ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2dab4c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2dab4a06 CFRunLoopRunInMode + 102
6 libAVFAudio.dylib 0x2cb37584 GenericRunLoopThread::Entry(void*) + 124
7 libAVFAudio.dylib 0x2cb2b99c CAPThread::Entry(CAPThread*) + 176
8 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 5 name: com.apple.coremedia.player.async
Thread 5:
0 libsystem_kernel.dylib 0x3889badc semaphore_wait_trap + 8
1 libdispatch.dylib 0x387da428 _dispatch_semaphore_wait_slow + 172
2 MediaToolbox 0x2efa083c fpa_AsyncMovieControlThread + 1752
3 CoreMedia 0x2e0df234 figThreadMain + 192
4 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
5 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
6 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 6:
0 libsystem_kernel.dylib 0x388aec7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38914dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38914c80 start_wqthread + 4
Thread 7:
0 libsystem_kernel.dylib 0x388aec7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38914dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38914c80 start_wqthread + 4
Thread 8:
0 libsystem_kernel.dylib 0x388aec7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38914dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38914c80 start_wqthread + 4
Thread 9:
0 libsystem_kernel.dylib 0x388aec7c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x38914dc6 _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x38914c80 start_wqthread + 4
Thread 10 name: com.apple.NSURLConnectionLoader
Thread 10:
0 libsystem_kernel.dylib 0x3889ba8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3889b888 mach_msg + 44
2 CoreFoundation 0x2db4b7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2db49ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2dab4c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2dab4a06 CFRunLoopRunInMode + 102
6 Foundation 0x2e4ef2f2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 314
7 Foundation 0x2e564c82 __NSThread__main__ + 1058
8 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 11 name: com.apple.CFSocket.private
Thread 11:
0 libsystem_kernel.dylib 0x388ae440 select$DARWIN_EXTSN + 20
1 CoreFoundation 0x2db4f680 __CFSocketManager + 480
2 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
3 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
4 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 12 name: WebThread
Thread 12:
0 libsystem_kernel.dylib 0x388adf38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38916224 _pthread_cond_wait + 536
2 libsystem_pthread.dylib 0x38917040 pthread_cond_timedwait + 40
3 WebCore 0x35cc0be2 SendDelegateMessage(NSInvocation*) + 690
4 WebCore 0x35c9895e WebRunLoopUnlockInternal(AutoreleasePoolOperation) + 162
5 CoreFoundation 0x2db4c1ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
6 CoreFoundation 0x2db49b6c __CFRunLoopDoObservers + 280
7 CoreFoundation 0x2dab4c44 CFRunLoopRunSpecific + 552
8 CoreFoundation 0x2dab4a06 CFRunLoopRunInMode + 102
9 WebCore 0x35c97266 RunWebThread(void*) + 414
10 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
11 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
12 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 13 name: JavaScriptCore::BlockFree
Thread 13:
0 libsystem_kernel.dylib 0x388adf38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38916224 _pthread_cond_wait + 536
2 libsystem_pthread.dylib 0x38917040 pthread_cond_timedwait + 40
3 JavaScriptCore 0x2ead9eb0 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 104
4 JavaScriptCore 0x2ead9cdc JSC::BlockAllocator::blockFreeingThreadMain() + 88
5 JavaScriptCore 0x2ead73a0 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
7 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
8 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 14 name: JavaScriptCore::Marking
Thread 14:
0 libsystem_kernel.dylib 0x388adf38 __psynch_cvwait + 24
1 libsystem_pthread.dylib 0x38916224 _pthread_cond_wait + 536
2 libsystem_pthread.dylib 0x38917000 pthread_cond_wait + 36
3 JavaScriptCore 0x2ec75236 JSC::GCThread::waitForNextPhase() + 74
4 JavaScriptCore 0x2ec75290 JSC::GCThread::gcThreadMain() + 48
5 JavaScriptCore 0x2ead73a0 WTF::wtfThreadEntryPoint(void*) + 12
6 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
7 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
8 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 15 name: WebCore: CFNetwork Loader
Thread 15:
0 libsystem_kernel.dylib 0x3889ba8c mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3889b888 mach_msg + 44
2 CoreFoundation 0x2db4b7be __CFRunLoopServiceMachPort + 150
3 CoreFoundation 0x2db49ee4 __CFRunLoopRun + 780
4 CoreFoundation 0x2dab4c22 CFRunLoopRunSpecific + 518
5 CoreFoundation 0x2dab4a06 CFRunLoopRunInMode + 102
6 WebCore 0x35cdfd5a WebCore::runLoaderThread(void*) + 250
7 JavaScriptCore 0x2ead73a0 WTF::wtfThreadEntryPoint(void*) + 12
8 libsystem_pthread.dylib 0x38916c1a _pthread_body + 138
9 libsystem_pthread.dylib 0x38916b8a _pthread_start + 98
10 libsystem_pthread.dylib 0x38914c8c thread_start + 4
Thread 1 crashed with ARM Thread State (32-bit):
r0: 0x00000004 r1: 0x00000000 r2: 0x00000000 r3: 0x001b56f0
r4: 0x00000001 r5: 0x00000000 r6: 0x00000000 r7: 0x001b5760
r8: 0x3a748170 r9: 0x00000001 r10: 0x00000000 r11: 0x3a747f40
ip: 0x00000171 sp: 0x001b56d0 lr: 0x387dc215 pc: 0x3889b83c
cpsr: 0x60000010
What could cause this crash?
try to enable breakpoints to all see below
In this way you should be able to identify the bad instruction before sigabrt signal.
I hope this could help

Resources