A crash caused by background thread.

Could anyone have a look at below crash report, thanks.

Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001c8269404 Termination Reason: SIGNAL 5 Trace/BPT trap: 5 Terminating Process: exc handler [17861]

Triggered by Thread: 11

Application Specific Information: abort() called

Last Exception Backtrace: 0 CoreFoundation 0x1c0bdde88 __exceptionPreprocess + 164 1 libobjc.A.dylib 0x1b9f0f8d8 objc_exception_throw + 60 2 CoreAutoLayout 0x1dd470e84 NSISLinExpReplaceVarWithVarPlusDelta + 0 3 CoreAutoLayout 0x1dd467e60 -[NSISEngine withBehaviors:performModifications:] + 36 4 UIKitCore 0x1c2d95fa0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1852 5 QuartzCore 0x1c226b9ec CA::Layer::layout_if_needed(CA::Transaction*) + 500 6 QuartzCore 0x1c227f0a0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 7 QuartzCore 0x1c22905b0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 456 8 QuartzCore 0x1c22c55ec CA::Transaction::commit() + 652 9 QuartzCore 0x1c2315ab4 CA::Transaction::release_thread(void*) + 228 10 libsystem_pthread.dylib 0x20dc38bd8 _pthread_tsd_cleanup + 620 11 libsystem_pthread.dylib 0x20dc3b674 _pthread_exit + 84 12 libsystem_pthread.dylib 0x20dc380e0 pthread_main_np + 0 13 libsystem_pthread.dylib 0x20dc37e80 _pthread_wqthread + 424 14 libsystem_pthread.dylib 0x20dc37b98 start_wqthread + 8

......

Thread 11 Crashed: 0 libsystem_c.dylib 0x1c8269404 __abort + 160 1 libsystem_c.dylib 0x1c8269404 __abort + 160 2 libsystem_c.dylib 0x1c8211c98 abort + 192 3 libc++abi.dylib 0x20db7eb8c abort_message + 132 4 libc++abi.dylib 0x20db6ea80 demangling_terminate_handler() + 336 5 libobjc.A.dylib 0x1b9f15d3c _objc_terminate() + 144 6 libc++abi.dylib 0x20db7df28 std::__terminate(void ()()) + 20 7 libc++abi.dylib 0x20db80c2c __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception) + 36 8 libc++abi.dylib 0x20db80bd8 __cxa_throw + 140 9 libobjc.A.dylib 0x1b9f0fa38 objc_exception_throw + 412 10 CoreAutoLayout 0x1dd470e84 _AssertAutoLayoutOnAllowedThreadsOnly + 328 11 CoreAutoLayout 0x1dd467e60 -[NSISEngine withBehaviors:performModifications:] + 36 12 UIKitCore 0x1c2d95fa0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1852 13 QuartzCore 0x1c226b9ec CA::Layer::layout_if_needed(CA::Transaction*) + 500 14 QuartzCore 0x1c227f0a0 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 15 QuartzCore 0x1c22905b0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 456 16 QuartzCore 0x1c22c55ec CA::Transaction::commit() + 652 17 QuartzCore 0x1c2315ab4 CA::Transaction::release_thread(void*) + 228 18 libsystem_pthread.dylib 0x20dc38bd8 _pthread_tsd_cleanup + 620 19 libsystem_pthread.dylib 0x20dc3b674 _pthread_exit + 84 20 libsystem_pthread.dylib 0x20dc380e0 _pthread_wqthread_exit + 76 21 libsystem_pthread.dylib 0x20dc37e80 _pthread_wqthread + 424 22 libsystem_pthread.dylib 0x20dc37b98 start_wqthread + 8

Thread 12: 0 libsystem_pthread.dylib 0x20dc37b90 start_wqthread + 0

Thread 13: 0 libsystem_pthread.dylib 0x20dc37b90 start_wqthread + 0

Thread 11 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000001 x4: 0x0000000000000000 x5: 0x0000000000989680 x6: 0x000000016f4f0000 x7: 0x0000000000000001 x8: 0x0000000000000000 x9: 0x0000000000000002 x10: 0x000000002deadd8b x11: 0x000000000000006e x12: 0x000000000000000b x13: 0x00000000ffffffff x14: 0x0000000000007e01 x15: 0x0000000000000006 x16: 0x0000000000000030 x17: 0x00000001031508e0 x18: 0x0000000000000000 x19: 0x000000016f56ec58 x20: 0x000000016f56ec98 x21: 0x000000016f56ed00 x22: 0x000000011de793b0 x23: 0x000000010570d7e0 x24: 0x0000000000000000 x25: 0x0000000106500880 x26: 0x0000000000000000 x27: 0x0000000000000058 x28: 0x0000000000000058 fp: 0x000000016f56ec70 lr: 0x1d3ee101c8269404 sp: 0x000000016f56ec40 pc: 0x00000001c8269404 cpsr: 0x80001000 far: 0x000000016d4dbf50 esr: 0xf2000001 (Breakpoint) brk 1

Answered by DTS Engineer in 736114022

Consider this:

Last Exception Backtrace:
0   CoreFoundation    … __exceptionPreprocess + 164
1   libobjc.A.dylib   … objc_exception_throw + 60
2   CoreData          … _PFManagedObject_coerceValueForKeyWithDescription + 1472
3   CoreData          … _sharedIMPL_setvfk_core + 180
4   MyYellowBook_Card … PhotoVC.collectionView(_:didSelectItemAt:) + 5352
5   MyYellowBook_Card … @objc PhotoVC.collectionView(_:didSelectItemAt:) + 392
6   UIKitCore         … -[UICollectionView _selectItemAtIndexPath:animated:scrollPosition:notifyDelegate:deselectPrevious:performCustomSelectionAction:] + 816

Your app has crashed because of an unhandled language exception. In frame 6 UICollectionView is calling your code. Frames 4 and 5 are your code, and in frame 3 it does something with Core Data. I think it’s trying to set a properly on a managed option (in _sharedIMPL_setvfk_core, vfk is short for value for key). Something has gone wrong with that and Core Data has raised this exception. If you managed to reproduce this locally, you’d be able to see the helpful message that Core Data has included with this exception. Sadly, that’s not captured by the crash report.

A good place to start with this would be to symbolicate your crash report to uncover the identity of the code in frame 4. For advice on how to do that, see Adding Identifiable Symbol Names to a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Could anyone have a look at below crash report, thanks.

Please repost the full crash report, using the instructions in Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Here is the crash report, thank you @eskimo

Accepted Answer

Consider this:

Last Exception Backtrace:
0   CoreFoundation    … __exceptionPreprocess + 164
1   libobjc.A.dylib   … objc_exception_throw + 60
2   CoreData          … _PFManagedObject_coerceValueForKeyWithDescription + 1472
3   CoreData          … _sharedIMPL_setvfk_core + 180
4   MyYellowBook_Card … PhotoVC.collectionView(_:didSelectItemAt:) + 5352
5   MyYellowBook_Card … @objc PhotoVC.collectionView(_:didSelectItemAt:) + 392
6   UIKitCore         … -[UICollectionView _selectItemAtIndexPath:animated:scrollPosition:notifyDelegate:deselectPrevious:performCustomSelectionAction:] + 816

Your app has crashed because of an unhandled language exception. In frame 6 UICollectionView is calling your code. Frames 4 and 5 are your code, and in frame 3 it does something with Core Data. I think it’s trying to set a properly on a managed option (in _sharedIMPL_setvfk_core, vfk is short for value for key). Something has gone wrong with that and Core Data has raised this exception. If you managed to reproduce this locally, you’d be able to see the helpful message that Core Data has included with this exception. Sadly, that’s not captured by the crash report.

A good place to start with this would be to symbolicate your crash report to uncover the identity of the code in frame 4. For advice on how to do that, see Adding Identifiable Symbol Names to a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks, @eskimo for the good hint. I found it was because I tried to access items in coredata after actually deleting them. I would like to move the photos that had been downloaded before to the top of the list. I implemented this with deleting the downloaded photos and re-downloading, then boom... Now I only change the date property for the photo then sort by date, seems ok now.

A crash caused by background thread.
 
 
Q