iOS 10 User Defaults Crash - Crashed: com.apple.root.user-initiated-qos SIGABRT
<p>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? </p>

<p><a href="https://i.stack.imgur.com/gc9aW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gc9aW.png" alt="Stack Trace"></a></p>

<pre><code>+ (BOOL) saveObject:(NSObject&lt;NSCoding&gt;*)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 &lt;redacted&gt; + 192
3  CoreFoundation                 0x1844aba80 &lt;redacted&gt; + 1132
4  CoreFoundation                 0x1843de2e4 CFRunLoopRunSpecific + 292
5  Foundation                     0x184e8893c &lt;redacted&gt; + 304
6  Foundation                     0x184ea9460 &lt;redacted&gt; + 96
7  UIKit                          0x18ac28134 &lt;redacted&gt; + 136
8  Foundation                     0x184f73b9c &lt;redacted&gt; + 1052
9  libsystem_pthread.dylib        0x1841549bc &lt;redacted&gt; + 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 &lt;redacted&gt; + 640
2  libsystem_pthread.dylib        0x1841549bc &lt;redacted&gt; + 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
</code></pre>