My ios app running ok on all the devices. It shows crash On iphone 6plus original device only.
Not getting exact issue. On Crashlytics we get issue report online, with this error. Below is a error log.
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1864c3014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x18658b450 pthread_kill + 112
2 libsystem_c.dylib 0x186437400 abort + 140
3 libsystem_c.dylib 0x18640b3b8 __assert_rtn + 220
4 Metal 0x189b1c3a4 MTLReportFailure + 780
5 Metal 0x189af9c48 -[MTLTextureDescriptorInternal validateWithDevice:] + 568
6 AGXMetalA8 0x1a13efe14 (Missing)
7 QuartzCore 0x18a830104 allocate_drawable_private(unsigned int, unsigned int, id<MTLDevice>, MTLPixelFormat, MTLTextureRotation, bool, bool, bool, unsigned int, CGColorSpace*, _CAImageQueue*) + 320
8 QuartzCore 0x18a82fcf8 -[CAMetalLayer nextDrawable] + 1492
9 VectorKit 0x19358fbc0 -[MetalLayer _updateDrawable] + 68
10 VectorKit 0x19358fc64 -[MetalLayer onTimerFired:] + 56
11 VectorKit 0x193221834 -[VKMapView onTimerFired:] + 176
12 VectorKit 0x193582dbc -[GGLDisplayLink _displayLinkFired:] + 84
13 QuartzCore 0x18a74af24 CA::Display::DisplayLinkItem::dispatch(unsigned long long) + 44
14 QuartzCore 0x18a74add0 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 444
15 IOKit 0x187762094 IODispatchCalloutFromCFMessage + 372
16 CoreFoundation 0x18748ae50 __CFMachPortPerform + 180
17 CoreFoundation 0x1874a3218 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
18 CoreFoundation 0x1874a29cc __CFRunLoopDoSource1 + 436
19 CoreFoundation 0x1874a04b0 __CFRunLoopRun + 1840
20 CoreFoundation 0x1873ce2b8 CFRunLoopRunSpecific + 444
21 GraphicsServices 0x188e82198 GSEventRunModal + 180
22 UIKit 0x18d4157fc -[UIApplication _run] + 684
23 UIKit 0x18d410534 UIApplicationMain + 208
24 SafeSide 0x1000d7998 main (main.m:14)
25 libdispatch.dylib 0x1863b15b8 (Missing)
Edit:
Did select row's code:
#try
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
MonitorVC *monitor = Init_VCforStoryId(#"MonitorVC");
monitor.monitorPassed = [arrMonitorList objectAtIndex:indexPath.row];
[self.navigationController pushViewController:monitor animated:YES];
}
#catch (NSException *exception)
{
NSLog(#"Exception handle: %#",exception.reason);
}
Related
My app is rejected from the iOS store because the app is terminated after user log in. I'm not able to reproduce the problem (local devices, TestFlight), it looks like it only happens when the app is running in production.
I have symbolicated the crash report that I got from the App Store review team. I understand that a abort() is called ontThread 0. But I have a hard time understanding the crash report. I'm new to crash reports so I appreciate the help!
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x192e2efe0 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x191890538 objc_exception_throw + 56
2 CoreFoundation 0x192e35ef4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 140
3 CoreFoundation 0x192e32f54 ___forwarding___ + 916
4 CoreFoundation 0x192d2ed4c _CF_forwarding_prep_0 + 92
5 appname 0x1000c9ce4 -[PushPlugin setApplicationIconBadgeNumber:] (PushPlugin.m:573)
6 appname 0x10015d130 -[CDVCommandQueue execute:] + 504
7 appname 0x1000e6d98 -[CDVWKWebViewEngine handleCordovaMessage:] (CDVWKWebViewEngine.m:427)
8 appname 0x1000e6c40 -[CDVWKWebViewEngine userContentController:didReceiveScriptMessage:] (CDVWKWebViewEngine.m:413)
9 appname 0x1000e7b98 -[CDVWKWeakScriptMessageHandler userContentController:didReceiveScriptMessage:] (CDVWKWebViewEngine.m:601)
10 WebKit 0x19c729590 ScriptMessageHandlerDelegate::didPostMessage(WebKit::WebPageProxy&, WebKit::FrameInfoData const&, WebCore::SerializedScriptValue&) + 196
11 WebKit 0x19c6c8c48 WebKit::WebUserContentControllerProxy::didPostMessage(IPC::Connection&, unsigned long long, WebKit::FrameInfoData const&, unsigned long long, IPC::DataReference const&) + 176
12 WebKit 0x19c6cb0c0 void IPC::handleMessage<Messages::WebUserContentControllerProxy::DidPostMessage, WebKit::WebUserContentControllerProxy, void (WebKit::WebUserContentControllerProxy::*)(IPC::Connection&, unsigned long long, WebKit::FrameInfoData const&, unsigned long long, IPC::DataReference const&)>(IPC::Connection&, IPC::Decoder&, WebKit::WebUserContentControllerProxy*, void (WebKit::WebUserContentControllerProxy::*)(IPC::Connection&, unsigned long long, WebKit::FrameInfoData const&, unsigned long long, IPC::DataReference const&)) + 156
13 WebKit 0x19c4fbda4 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 120
14 WebKit 0x19c6a4830 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 32
15 WebKit 0x19c4c1c8c IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 164
16 WebKit 0x19c4c4484 IPC::Connection::dispatchOneMessage() + 232
17 JavaScriptCore 0x19769fff4 WTF::RunLoop::performWork() + 172
18 JavaScriptCore 0x1976a02cc WTF::RunLoop::performWork(void*) + 36
19 CoreFoundation 0x192ddd42c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
20 CoreFoundation 0x192ddcd9c __CFRunLoopDoSources0 + 540
21 CoreFoundation 0x192dda9a8 __CFRunLoopRun + 744
22 CoreFoundation 0x192d0ada4 CFRunLoopRunSpecific + 424
23 GraphicsServices 0x194774074 GSEventRunModal + 100
24 UIKit 0x198fbe058 UIApplicationMain + 208
25 appname 0x1000b2b78 main (main.m:32)
26 libdyld.dylib 0x191d1959c start + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000191e29014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x0000000191ef3264 pthread_kill + 112
2 libsystem_c.dylib 0x0000000191d9d9c4 abort + 140
3 libc++abi.dylib 0x00000001918691b0 __cxa_bad_cast + 0
4 libc++abi.dylib 0x0000000191882c04 default_unexpected_handler() + 0
5 libobjc.A.dylib 0x0000000191890820 _objc_terminate() + 124
6 libc++abi.dylib 0x000000019187f5d4 std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x000000019187eef8 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 0
8 libobjc.A.dylib 0x000000019189066c _objc_exception_destructor(void*) + 0
9 CoreFoundation 0x0000000192e35ef4 __methodDescriptionForSelector + 0
10 CoreFoundation 0x0000000192e32f54 ___forwarding___ + 916
11 CoreFoundation 0x0000000192d2ed4c _CF_forwarding_prep_0 + 92
12 appname 0x00000001000c9ce4 -[PushPlugin setApplicationIconBadgeNumber:] (PushPlugin.m:573)
13 appname 0x000000010015d130 -[CDVCommandQueue execute:] + 504
14 appname 0x00000001000e6d98 -[CDVWKWebViewEngine handleCordovaMessage:] (CDVWKWebViewEngine.m:427)
15 appname 0x00000001000e6c40 -[CDVWKWebViewEngine userContentController:didReceiveScriptMessage:] (CDVWKWebViewEngine.m:413)
16 appname 0x00000001000e7b98 -[CDVWKWeakScriptMessageHandler userContentController:didReceiveScriptMessage:] (CDVWKWebViewEngine.m:601)
17 WebKit 0x000000019c729590 ScriptMessageHandlerDelegate::didPostMessage(WebKit::WebPageProxy&, WebKit::FrameInfoData const&, WebCore::SerializedScriptValue&) + 196
18 WebKit 0x000000019c6c8c48 WebKit::WebUserContentControllerProxy::didPostMessage(IPC::Connection&, unsigned long long, WebKit::FrameInfoData const&, unsigned long long, IPC::DataReference const&) + 176
19 WebKit 0x000000019c6cb0c0 void IPC::handleMessage<Messages::WebUserContentControllerProxy::DidPostMessage, WebKit::WebUserContentControllerProxy, void (WebKit::WebUserContentControllerProxy::*)(IPC::Connection&, unsigned long long, WebKit::FrameInfoData const&, unsigned long long, IPC::DataReference const&)>(IPC::Connection&, IPC::Decoder&, WebKit::WebUserContentControllerProxy*, void (WebKit::WebUserContentControllerProxy::*)(IPC::Connection&, unsigned long long, WebKit::FrameInfoData const&, unsigned long long, IPC::DataReference const&)) + 156
20 WebKit 0x000000019c4fbda4 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 120
21 WebKit 0x000000019c6a4830 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 32
22 WebKit 0x000000019c4c1c8c IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 164
23 WebKit 0x000000019c4c4484 IPC::Connection::dispatchOneMessage() + 232
24 JavaScriptCore 0x000000019769fff4 WTF::RunLoop::performWork() + 172
25 JavaScriptCore 0x00000001976a02cc WTF::RunLoop::performWork(void*) + 36
26 CoreFoundation 0x0000000192ddd42c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
27 CoreFoundation 0x0000000192ddcd9c __CFRunLoopDoSources0 + 540
28 CoreFoundation 0x0000000192dda9a8 __CFRunLoopRun + 744
29 CoreFoundation 0x0000000192d0ada4 CFRunLoopRunSpecific + 424
30 GraphicsServices 0x0000000194774074 GSEventRunModal + 100
31 UIKit 0x0000000198fbe058 UIApplicationMain + 208
32 appname 0x00000001000b2b78 main (main.m:32)
33 libdyld.dylib 0x0000000191d1959c start + 4
...
So I am receiving Crashlytics crash report for my iOS App. For some of the users the app has been crashing giving SIGABRT in the crash log.
I have been trying to find the cause of this error for countless hours but due to rarity of the error (around 1-2% users) I have been unable to reproduce the error and, due to limited amount of information from Crashlytics, I have been unable to find the root cause of this error.
The deployment target is iOS 7 for the app and devices of all sizes with iOS 10+ are experiencing the crash (I am not sure if iOS 9, 8 or 7 are also experiencing the error — Crashlytics is only showing crashes on iOS 10+)
Here is the stack trace:
CRASH_INFO_ENTRY_1
*** error for object 0x17127f4c0: Invalid pointer dequeued from free list
CRASH_INFO_ENTRY_0
abort() called
Crashed: com.apple.main-thread
SIGABRT ABORT 0x000000018e2ea014
#0. Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x18f6ca014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x18f791460 pthread_kill + 112
2 libsystem_c.dylib 0x18f63e3f4 abort + 140
3 libsystem_malloc.dylib 0x18f70ea38
_nano_vet_and_size_of_live + 330
4 libsystem_malloc.dylib 0x18f710bf0
_nano_malloc_check_clear + 392
5 libsystem_malloc.dylib 0x18f70fbb4 nano_calloc + 80
6 libsystem_malloc.dylib 0x18f701180 malloc_zone_calloc + 152
7 libsystem_malloc.dylib 0x18f7010c4 calloc + 40
8 libobjc.A.dylib 0x18f131cfc cache_t::reallocate(unsigned int, unsigned int) + 52
9 libobjc.A.dylib 0x18f1321fc cache_fill + 216
10 libobjc.A.dylib 0x18f13cd00 lookUpImpOrForward + 412
11 libobjc.A.dylib 0x18f147258 _objc_msgSend_uncached + 56
12 UIKit 0x1967274e8 -[UITableView _endCellAnimationsWithContext:] + 13964
13 Champion 0x100097bf4 -[MatchdayComposeController controllerDidChangeContent:] (MatchdayComposeController.m:427)
14 CoreData 0x192abfe28 __82-[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:]_block_invoke + 4760
15 CoreData 0x192abeb80 -[NSFetchedResultsController(PrivateMethods) _core_managedObjectContextDidChange:] + 124
16 CoreFoundation 0x19069622c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
17 CoreFoundation 0x190695930 _CFXRegistrationPost + 400
18 CoreFoundation 0x1906956ac ___CFXNotificationPost_block_invoke + 60
19 CoreFoundation 0x190704b9c -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1504
20 CoreFoundation 0x1905d7bf4 _CFXNotificationPost + 376
21 Foundation 0x1910de6bc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
22 CoreData 0x1929eed1c -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 724
23 CoreData 0x192a75170 -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:deletions:updates:refreshes:deferrals:wasMerge:] + 1336
24 CoreData 0x1929ed338 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 2116
25 CoreData 0x1929ebe3c -[NSManagedObjectContext save:] + 416
26 Champion 0x10008e2ac -[AppDelegate saveContext] (AppDelegate.m:263)
27 Champion 0x10009d1d4 +[Globals saveManagedObjectContext] (Globals.m:157)
28 Champion 0x10006ee4c -[EntitySyncClient saveUpdates:] (EntitySyncClient.m:232)
29 Champion 0x1000690a0 -[MatchController datepickerDidChangeValue:] (MatchController.m:994)
30 UIKit 0x1965799a0 -[UIApplication sendAction:to:from:forEvent:] + 96
31 UIKit 0x196579920 -[UIControl sendAction:to:forEvent:] + 80
32 UIKit 0x196563dd0 -[UIControl _sendActionsForEvents:withEvent:] + 452
33 UIKit 0x196e62c44 -[_UIDatePickerView pickerView:didSelectRow:inComponent:] + 540
34 UIKit 0x1967b965c -[UIPickerView _sendSelectionChangedForComponent:notify:] + 116
35 UIKit 0x1967b9894 -[UIPickerView _sendSelectionChangedFromTable:notify:] + 344
36 UIKit 0x196ce6878 -[UIPickerTableView _scrollingFinished] + 188
37 UIKit 0x196ce6a50 -[UIPickerTableView scrollViewDidEndDecelerating:] + 28
38 UIKit 0x196857abc -[UIScrollView(UIScrollViewInternal) _scrollViewDidEndDeceleratingForDelegate] + 132
39 UIKit 0x1966ed2cc -[UIScrollView(UIScrollViewInternal) _stopScrollDecelerationNotify:] + 332
40 UIKit 0x1966ece08 -[UIScrollView _smoothScrollWithUpdateTime:] + 2356
41 QuartzCore 0x1938ff640 CA::Display::DisplayLinkItem::dispatch(unsigned long long) + 44
42 QuartzCore 0x1938ff4ec CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 444
43 IOKit 0x190968570 IODispatchCalloutFromCFMessage + 372
44 CoreFoundation 0x19069256c __CFMachPortPerform + 180
45 CoreFoundation 0x1906aa934 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
46 CoreFoundation 0x1906aa0e8 __CFRunLoopDoSource1 + 436
47 CoreFoundation 0x1906a7bcc __CFRunLoopRun + 1840
48 CoreFoundation 0x1905d6048 CFRunLoopRunSpecific + 444
49 GraphicsServices 0x192059198 GSEventRunModal + 180
50 UIKit 0x1965af818 -[UIApplication _run] + 684
51 UIKit 0x1965aa550 UIApplicationMain + 208
52 Champion 0x1000b082c main (main.m:14)
53 libdispatch.dylib 0x18f5b85b8 (Missing)
I would be extremely grateful for any kind of assistance. I would also be grateful if I can get any kind of pointers for reproducing Crashlytics errors.
Updating the Question with Code
In the controllerDidChangeContent: mainly the table view is ending updates.
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller {
[self.tableView endUpdates];
if(controller.fetchedObjects.count == 0){
self.showsNoMatchesHint = YES;
}
else{
self.showsNoMatchesHint = NO;
}
}
Given the last gasp of your program was in _endCellAnimationsWithContext, and these types of animations usually occur on completion of cell editing, I'd look into problems when that particular table is completing a cell edit operation. There's a picker view and a notification also going on in there, so that should narrow it down some. Good luck.
It looks like caused by this line of code
[self.tableView endUpdates];
I would suggest you to make sure the logic of -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView is correct. For example, it doesn't return 0 while the array is empty. Good luck.
I'm trying to fix the crash issue of a mac app. It's using the web view.
I got the report from fabric but I have no idea how to fix it.
Any suggestion?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000000bbadbeef
Crashed: com.apple.main-thread
0 JavaScriptCore 0x7fff8d7a232e WTFCrash + 62
1 WebCore 0x7fff879ca13d WebCore::DocumentLoader::detachFromFrame() + 269
2 WebKitLegacy 0x7fff866f1f7e WebDocumentLoaderMac::detachFromFrame() + 14
3 WebCore 0x7fff87945178 WebCore::FrameLoader::setDocumentLoader(WebCore::DocumentLoader*) + 104
4 WebCore 0x7fff87ed90a0 WebCore::FrameLoader::transitionToCommitted(WebCore::CachedPage*) + 208
5 WebCore 0x7fff87944a3d WebCore::FrameLoader::commitProvisionalLoad() + 397
6 WebCore 0x7fff879e568d WebCore::DocumentLoader::commitLoad(char const*, int) + 77
7 WebCore 0x7fff879e5254 WebCore::DocumentLoader::dataReceived(WebCore::CachedResource*, char const*, int) + 292
8 WebCore 0x7fff879e4f51 WebCore::CachedRawResource::notifyClientsDataWasReceived(char const*, unsigned int) + 177
9 WebCore 0x7fff879e4b2a WebCore::CachedRawResource::addDataBuffer(WebCore::ResourceBuffer*) + 170
10 WebCore 0x7fff879e4802 WebCore::SubresourceLoader::didReceiveDataOrBuffer(char const*, int, WTF::PassRefPtr<WebCore::SharedBuffer>, long long, WebCore::DataPayloadType) + 210
11 WebCore 0x7fff87a08b0c WebCore::SubresourceLoader::didReceiveBuffer(WTF::PassRefPtr<WebCore::SharedBuffer>, long long, WebCore::DataPayloadType) + 44
12 WebCore 0x7fff87a08a4a WebCore::ResourceLoader::didReceiveBuffer(WebCore::ResourceHandle*, WTF::PassRefPtr<WebCore::SharedBuffer>, int) + 90
13 WebCore 0x7fff87a08985 -[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:] + 101
14 CFNetwork 0x7fff8552c81d __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 69
15 CFNetwork 0x7fff8552c681 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 232
16 CFNetwork 0x7fff8552c587 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
17 CFNetwork 0x7fff85538f74 _NSURLConnectionDidReceiveData_LengthReceived(_CFURLConnection*, __CFData const*, long, void const*) + 83
18 CFNetwork 0x7fff8552cf3b ___ZN27URLConnectionClient_Classic29_delegate_didReceiveDataArrayEv_block_invoke + 297
19 CFNetwork 0x7fff855e14a3 ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 94
20 CFNetwork 0x7fff8547feec RunloopBlockContext::_invoke_block(void const*, void*) + 72
21 CoreFoundation 0x7fff9122c664 CFArrayApplyFunction + 68
22 CFNetwork 0x7fff8547fdad RunloopBlockContext::perform() + 133
23 CFNetwork 0x7fff8547fb98 MultiplexerSource::perform() + 282
24 CFNetwork 0x7fff8547f9ba MultiplexerSource::_perform(void*) + 72
25 CoreFoundation 0x7fff91260a01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
26 CoreFoundation 0x7fff91252b8d __CFRunLoopDoSources0 + 269
27 CoreFoundation 0x7fff912521bf __CFRunLoopRun + 927
28 CoreFoundation 0x7fff91251bd8 CFRunLoopRunSpecific + 296
29 HIToolbox 0x7fff82b9356f RunCurrentEventLoopInMode + 235
30 HIToolbox 0x7fff82b932ea ReceiveNextEventCommon + 431
31 HIToolbox 0x7fff82b9312b _BlockUntilNextEventMatchingListInModeWithFilter + 71
32 AppKit 0x7fff8acc88ab _DPSNextEvent + 978
33 AppKit 0x7fff8acc7e58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
34 AppKit 0x7fff8acbdaf3 -[NSApplication run] + 594
35 AppKit 0x7fff8ac3a244 NSApplicationMain + 1832
36 libdyld.dylib 0x7fff896af5c9 start + 1
above is the log. Any idea why it happens and how to fix it?
I have a view which allocates a UILabel and sets the attributed string using NSAttributedString from HTML string. I get the crash during initialising the NSAttributedString. Following is the stack trace of the error:
Thread : Crashed: com.apple.main-thread
0 ??? 0x15e9d6c0
1 QuartzCore 0x2d967993 CA::Display::DisplayLink::get_link(CA::Display::Display*, __CFRunLoop*, X::List<__CFString const*> const*) + 254
2 QuartzCore 0x2d967723 CA::Display::DisplayLinkItem::update_link(__CFRunLoop*) + 162
3 QuartzCore 0x2d98a823 CA::Display::DisplayLinkItem::dispatch() + 170
4 QuartzCore 0x2d98a643 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
5 IOMobileFramebuffer 0x3288dc07 IOMobileFramebufferVsyncNotifyFunc + 90
6 IOKit 0x2b827001 IODispatchCalloutFromCFMessage + 256
7 CoreFoundation 0x2a86324d __CFMachPortPerform + 132
8 CoreFoundation 0x2a8737cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
9 CoreFoundation 0x2a873767 __CFRunLoopDoSource1 + 346
10 CoreFoundation 0x2a871d69 __CFRunLoopRun + 1608
11 CoreFoundation 0x2a7be201 CFRunLoopRunSpecific + 476
12 CoreFoundation 0x2a7be013 CFRunLoopRunInMode + 106
13 UIFoundation 0x3629bb7f -[NSHTMLReader _loadUsingWebKit] + 1950
14 UIFoundation 0x3629ce31 -[NSHTMLReader attributedString] + 24
15 UIFoundation 0x36244445 _NSReadAttributedStringFromURLOrData + 5648
16 UIFoundation 0x36242dad -[NSAttributedString(NSAttributedStringUIFoundationAdditions) initWithData:options:documentAttributes:error:] + 116
17 PageViewScrollView 0x0002ff54 #!objc ext.UIKit.ObjectiveC.NSAttributedString.init (ObjectiveC.NSAttributedString.Type)(data : ObjectiveC.NSData, options : Swift.Optional<Swift.Dictionary<ObjectiveC.NSObject, Swift.AnyObject>>, documentAttributes : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSDictionary>>, error : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSError>>) -> Swift.Optional<ObjectiveC.NSAttributedString> (HTMLTextView.swift)
18 PageViewScrollView 0x00029da4 ext.UIKit.ObjectiveC.NSAttributedString.init (ObjectiveC.NSAttributedString.Type)(data : ObjectiveC.NSData, options : Swift.Optional<Swift.Dictionary<ObjectiveC.NSObject, Swift.AnyObject>>, documentAttributes : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSDictionary>>, error : Swift.AutoreleasingUnsafeMutablePointer<Swift.Optional<ObjectiveC.NSError>>) -> Swift.Optional<ObjectiveC.NSAttributedString> (HTMLTextView.swift)
19 PageViewScrollView 0x00026fd4 PageViewScrollView.HTMLTextView.init (PageViewScrollView.HTMLTextView.Type)(frame : C.CGRect) -> PageViewScrollView.HTMLTextView (HTMLTextView.swift:33)
20 PageViewScrollView 0x000286ac PageViewScrollView.HTMLTextView.__allocating_init (PageViewScrollView.HTMLTextView.Type)(frame : C.CGRect) -> PageViewScrollView.HTMLTextView (HTMLTextView.swift)
21 PageViewScrollView 0x0003fe4c PageViewScrollView.ViewController.getView (PageViewScrollView.ViewController)(Swift.Int) -> Swift.Optional<ObjectiveC.UIView> (ViewController.swift:149)
22 PageViewScrollView 0x0003c7f8 PageViewScrollView.ViewController.scrollViewDidScroll (PageViewScrollView.ViewController)(ObjectiveC.UIScrollView) -> () (ViewController.swift:86)
23 PageViewScrollView 0x0003f5fc #objc PageViewScrollView.ViewController.scrollViewDidScroll (PageViewScrollView.ViewController)(ObjectiveC.UIScrollView) -> () (ViewController.swift)
24 UIKit 0x2e1dc115 -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 64
25 UIKit 0x2df451d5 -[UIScrollView setContentOffset:] + 632
26 UIKit 0x2e0be771 -[UIScrollView _smoothScrollWithUpdateTime:] + 3120
27 QuartzCore 0x2d98a7db CA::Display::DisplayLinkItem::dispatch() + 98
28 QuartzCore 0x2d98a643 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
29 IOMobileFramebuffer 0x3288dc07 IOMobileFramebufferVsyncNotifyFunc + 90
30 IOKit 0x2b827001 IODispatchCalloutFromCFMessage + 256
31 CoreFoundation 0x2a86324d __CFMachPortPerform + 132
32 CoreFoundation 0x2a8737cb __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
33 CoreFoundation 0x2a873767 __CFRunLoopDoSource1 + 346
34 CoreFoundation 0x2a871d69 __CFRunLoopRun + 1608
35 CoreFoundation 0x2a7be201 CFRunLoopRunSpecific + 476
36 CoreFoundation 0x2a7be013 CFRunLoopRunInMode + 106
37 GraphicsServices 0x3228f201 GSEventRunModal + 136
38 UIKit 0x2df8aa09 UIApplicationMain + 1440
39 PageViewScrollView 0x000448f4 main (AppDelegate.swift:14)
40 libdyld.dylib 0x397a3aaf start + 2
Here is the link to the source code of app where I've used this function. Basically it's a view pager using UIScrollView where views are added and removed as the user so as to keep minimal number of total view in memory. During initialisation of new views containing UILabel with NSAttributedString the above occurs. While scrolling from one view to other new view are created and older are removed from scrollView
I actually found the bug. The problem was that scrollViewDidScroll callbacks are sent on background thread. And I was performing UI updates on background which was causing the problem. Executing the code on main thread using dispatch_async(dispatch_get_main_queue(), block solved the issue.
My app started crashing after long time in background right when I launch it again.
The problem of course is when it wasn't killed - only when it was in the background.
the log is:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x32858a1c __pthread_kill + 8
1 libsystem_c.dylib 0x337013b4 pthread_kill + 52
2 libsystem_c.dylib 0x336f9bf8 abort + 72
3 libstdc++.6.dylib 0x30504a64 __gnu_cxx::__verbose_terminate_handler() + 376
4 libobjc.A.dylib 0x3068f06c _objc_terminate + 104
5 libstdc++.6.dylib 0x30502e36 __cxxabiv1::__terminate(void (*)()) + 46
6 libstdc++.6.dylib 0x30502e8a std::terminate() + 10
7 libstdc++.6.dylib 0x30502f5a __cxa_throw + 78
8 libobjc.A.dylib 0x3068dc84 objc_exception_throw + 64
9 CoreFoundation 0x3351048a +[NSException raise:format:arguments:] + 62
10 Foundation 0x326ea56c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 56
11 UIKit 0x31bc3a82 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 666
12 UIKit 0x31bc3764 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 28
13 UIKit 0x31bbc0c6 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 930
14 UIKit 0x31bbb276 -[UITableView layoutSubviews] + 134
15 UIKit 0x31b675f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 20
16 CoreFoundation 0x3347defc -[NSObject(NSObject) performSelector:withObject:] + 16
17 QuartzCore 0x33351bae -[CALayer layoutSublayers] + 114
18 QuartzCore 0x33351966 CALayerLayoutIfNeeded + 178
19 QuartzCore 0x333571be CA::Context::commit_transaction(CA::Transaction*) + 206
20 QuartzCore 0x33356fd0 CA::Transaction::commit() + 184
21 QuartzCore 0x3335004e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 50
22 CoreFoundation 0x334e7a2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10
23 CoreFoundation 0x334e945e __CFRunLoopDoObservers + 406
24 CoreFoundation 0x334ea754 __CFRunLoopRun + 848
25 CoreFoundation 0x3347aebc CFRunLoopRunSpecific + 224
26 CoreFoundation 0x3347adc4 CFRunLoopRunInMode + 52
27 GraphicsServices 0x311a5418 GSEventRunModal + 108
28 GraphicsServices 0x311a54c4 GSEventRun + 56
29 UIKit 0x31b90d62 -[UIApplication _run] + 398
30 UIKit 0x31b8e800 UIApplicationMain + 664
31 Vento 0x00002c64 main (main.m:14)
32 Vento 0x00002c0c start + 32
Any idea where to start digging?
Thank you!
Look at the log to see the exception detail.
Run the static code analyzer over your code. It may find the bug for you.