10.8.1 & XCode 4.4.1 & NSUbiquitousKeyValueStore = CRASH
Guys,
I seriously think this is a new issue occuring after the update of 10.8.1 (MacBookPro Retina) with XCode 4.4.1
So here goes...
_ubiquity = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
_defaults = [NSUserDefaults standardUserDefaults];
// if ubiquity is available - use it !
if (_ubiquity) {
_cloudStore = [NSUbiquitousKeyValueStore defaultStore];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(storeDidChange:) name:NSUbiquitousKeyValueStoreDidChangeExternallyNotificationobject:_cloudStore ];
[_cloudStore synchronize];
.....
Later on in the code (someplace else)....
- (void) setDateOfBirth:(NSDate *)dateOfBirth
{
if (self.isCloudEnabled) {
[_cloudStore setObject:dateOfBirth forKey:@"dateOfBirth"];
} else {
[_defaults setObject:dateOfBirth forKey:@"dateOfBirth"];
[_defaults synchronize];
}
}
(_defaults is a NSUserDefaults object FYI - see above code seg)...
So when the line (_cloudStore setObject...) occurs, 4 seconds later i receive a crash....
Aug 23 19:49:04 Sams-MBPr.local filecoordinationd[172]: NSFileCoordinator only handles URLs that use the file: scheme. This one does not:
x-xcode-log://217822E6-14E4-4004-B9A0-D07C7A613B48
----
Per debugger in xcode...
libxpc.dylib`xpc_get_type:
0x373dc10c: ldr r0, [r0, #4]
0x373dc10e: bx lr
With the iPhone connected (disconnected from the machine), the error occurs again, and the crashlog shows the following... Key thing to notice is that the crash occurs in libxpc.
Incident Identifier: DF93D111-C075-4EB0-8287-9EC1964EA7A0
CrashReporter Key: c70aa078615a40b5afc89a9d7dc1c8966fb3d753
Hardware Model: iPhone3,1
Process: gocial [1083]
Path: /var/mobile/Applications/4796306D-B310-4EF6-81CD-B9EFE7F40287/gocial.app/gocial
Identifier: gocial
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-08-23 20:10:14.967 +0200
OS Version: iPhone OS 5.1.1 (9B208)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000004
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.ubkvstore
Thread 0 Crashed:
0 libxpc.dylib 0x373dc10c xpc_get_type + 0
1 libxpc.dylib 0x373dd7da xpc_connection_send_message_with_reply_sync + 14
2 SyncedDefaults 0x33393f84 -[SYDClient _sendMessageWithReplySync:] + 236
3 SyncedDefaults 0x33393c7a -[SYDClient sendMessageWithName:userInfo:] + 38
4 SyncedDefaults 0x333956f4 -[SYDRemotePreferencesSource synchronizeForced:] + 672
5 Foundation 0x3296caa0 __66-[NSUbiquitousKeyValueStore _synchronizeForced:notificationQueue:]_block_invoke_0 + 124
6 libdispatch.dylib 0x376d0790 _dispatch_barrier_sync_f_invoke + 16
7 libdispatch.dylib 0x376d0604 dispatch_barrier_sync_f$VARIANT$up + 56
8 libdispatch.dylib 0x376d0238 dispatch_sync_f$VARIANT$up + 12
9 libdispatch.dylib 0x376d08b6 dispatch_sync$VARIANT$up + 26
10 Foundation 0x3286a05a -[NSUbiquitousKeyValueStore _synchronizeForced:notificationQueue:] + 314
11 Foundation 0x32869f18 -[NSUbiquitousKeyValueStore _synchronizeForced:] + 16
12 Foundation 0x3296c50c -[NSUbiquitousKeyValueStore _syncConcurrently] + 144
13 Foundation 0x328db606 __NSFireTimer + 138
14 CoreFoundation 0x36c72a2c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
15 CoreFoundation 0x36c72692 __CFRunLoopDoTimer + 358
16 CoreFoundation 0x36c71268 __CFRunLoopRun + 1200
17 CoreFoundation 0x36bf449e CFRunLoopRunSpecific + 294
18 CoreFoundation 0x36bf4366 CFRunLoopRunInMode + 98
19 GraphicsServices 0x34dbb432 GSEventRunModal + 130
20 UIKit 0x34e9dcce UIApplicationMain + 1074
21 gocial 0x0003b7b6 main (main.m:16)
22 gocial 0x0003b750 start + 32
Thread 1:
0 libsystem_kernel.dylib 0x368a43a8 kevent + 24
1 libdispatch.dylib 0x376d1ea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x376d1bc2 _dispatch_mgr_thread + 30
Thread 2:
0 libsystem_kernel.dylib 0x368b4cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x331e6f36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x331e6cc8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x368b4cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x331e6f36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x331e6cc8 start_wqthread + 0
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x368a4004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x368a41fa mach_msg + 50
2 CoreFoundation 0x36c723ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x36c71124 __CFRunLoopRun + 876
4 CoreFoundation 0x36bf449e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x36bf4366 CFRunLoopRunInMode + 98
6 WebCore 0x31be7c9c RunWebThread(void*) + 396
7 libsystem_c.dylib 0x331ec72e _pthread_start + 314
8 libsystem_c.dylib 0x331ec5e8 thread_start + 0
Thread 5:
0 libsystem_kernel.dylib 0x368b4cd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x331e6f36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x331e6cc8 start_wqthread + 0
Thread 6 name: com.apple.NSURLConnectionLoader
Thread 6:
0 libsystem_kernel.dylib 0x368a4004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x368a41fa mach_msg + 50
2 CoreFoundation 0x36c723ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x36c71124 __CFRunLoopRun + 876
4 CoreFoundation 0x36bf449e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x36bf4366 CFRunLoopRunInMode + 98
6 Foundation 0x32846bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x32846a7a -[NSThread main] + 66
8 Foundation 0x328da58a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x331ec72e _pthread_start + 314
10 libsystem_c.dylib 0x331ec5e8 thread_start + 0
Thread 7 name: com.apple.CFSocket.private
Thread 7:
0 libsystem_kernel.dylib 0x368b4570 __select + 20
1 CoreFoundation 0x36c7663a __CFSocketManager + 726
2 libsystem_c.dylib 0x331ec72e _pthread_start + 314
3 libsystem_c.dylib 0x331ec5e8 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x00000000 r5: 0x00264aa0 r6: 0x3f665380 r7: 0x2fe36ae0
r8: 0x3fa99670 r9: 0x0026f320 r10: 0x00000000 r11: 0x37fb38df
ip: 0x3eede1c0 sp: 0x2fe36a9c lr: 0x373dd7e1 pc: 0x373dc10c
cpsr: 0x80000030
Notice the first lines (libxpc)....
Appreciate any help - 10 minutes before updating my MBPr, everything was working fine - Now im royally f**....
Have escalated this to TSI and awaiting a response. If anyone has advice, please feel free to reach out at sam.colak at me dot com.
Thanks in advance,
Samuel
MacBook Pro with Retina display, OS X Mountain Lion (10.8.1), 2.6Ghz / 8GB / 512SSD