Debugging EXC_BAD_ACCESS with NSZombie - ios

I am getting a rather peculiar issue of EXC_BAD_ACCESS. In an inventory based app, when creating a receipt..the app works fine if the vehicle already exists in the database and crashes when a receipt with new vehicle is being viewed.
I tried to run the app with NSZombieEnabled but nothing gets logged onto the console when the app crashes except lldb.
So the question is that if NSZombieEnabled does not work, how do I determine what is causing the crash in an app.
I am running Xcode 5 (latest version) for development.
Edit On running bt in command prompt..here's the backtrace I get
(lldb) bt
* thread #1: tid = 0x16915d, 0x006e427f OpenGLES`+[EAGLContext setCurrentContext:] + 80, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc)
frame #0: 0x006e427f OpenGLES`+[EAGLContext setCurrentContext:] + 80
frame #1: 0x0c725f2a CoreImage`CIEAGLContextTexImageIOSurface + 389
frame #2: 0x0c70b6a8 CoreImage`CI::GLESTextureManager::attach_IOSurface(__IOSurface*, bool, int, unsigned int, int, int, int, bool) + 950
frame #3: 0x0c70f6ab CoreImage`CI::GLESContext::bind_surface(__IOSurface*, int, bool, bool, bool) + 261
frame #4: 0x0c70ec6a CoreImage`CI::GLESContext::bind_textures(CI::SerialObjectPtrArray*, CI::Kernel*) + 336
frame #5: 0x0c70e7a7 CoreImage`CI::GLESContext::render_apply_node(CI::Node const*, bool) + 151
frame #6: 0x0c70e5bb CoreImage`CI::GLESContext::recursive_render(CI::Node const*, bool) + 697
frame #7: 0x0c70e498 CoreImage`CI::GLESContext::recursive_render(CI::Node const*, bool) + 406
frame #8: 0x0c70e36b CoreImage`CI::GLESContext::recursive_render(CI::Node const*, bool) + 105
frame #9: 0x0c70e498 CoreImage`CI::GLESContext::recursive_render(CI::Node const*, bool) + 406
frame #10: 0x0c70e36b CoreImage`CI::GLESContext::recursive_render(CI::Node const*, bool) + 105
frame #11: 0x0c70f068 CoreImage`CI::GLESContext::render(CI::Node*) + 176
frame #12: 0x0c71bfa9 CoreImage`CI::image_get_cgimage(CI::Context*, CI::Image*, CGRect, CGColorSpace*, CI::PixelFormat) + 2069
frame #13: 0x0c6f41c3 CoreImage`-[CIContext createCGImage:fromRect:format:colorSpace:] + 671
frame #14: 0x0c6f3eb6 CoreImage`-[CIContext createCGImage:fromRect:] + 99
frame #15: 0x0c55a82f CoreUI`-[CUITextEffectStack drawProcessedMask:atBounds:inContext:withScale:] + 909
frame #16: 0x0c55b8dd CoreUI`-[CUITextEffectStack drawGlyphs:inContext:usingFont:atPositions:count:lineHeight:inBounds:atScale:] + 540
frame #17: 0x0c565460 CoreUI`-[CUICatalog drawGlyphs:atPositions:inContext:withFont:count:stylePresetName:styleConfiguration:foregroundColor:] + 1770
frame #18: 0x0c3e0c05 UIFoundation`-[NSLineFragmentRenderingContext drawAtPoint:inContext:] + 3657
frame #19: 0x0c41721a UIFoundation`__NSStringDrawingEngine + 18606
frame #20: 0x0c41a10b UIFoundation`-[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] + 622
frame #21: 0x01bd6891 UIKit`-[UILabel _drawTextInRect:baselineCalculationOnly:] + 6626
frame #22: 0x01bd4574 UIKit`-[UILabel drawTextInRect:] + 581
frame #23: 0x01bd6996 UIKit`-[UILabel drawRect:] + 98
frame #24: 0x01a4b95c UIKit`-[UIView(CALayerDelegate) drawLayer:inContext:] + 519
frame #25: 0x00a7fd61 QuartzCore`-[CALayer drawInContext:] + 118
frame #26: 0x00a7fc97 QuartzCore`backing_callback(CGContext*, void*) + 96
frame #27: 0x009644fe QuartzCore`CABackingStoreUpdate_ + 2788
frame #28: 0x00a7fc2f QuartzCore`___ZN2CA5Layer8display_Ev_block_invoke + 93
frame #29: 0x00ab5416 QuartzCore`x_blame_allocations + 15
frame #30: 0x00a7fa95 QuartzCore`CA::Layer::display_() + 1591
frame #31: 0x00a7fce6 QuartzCore`-[CALayer _display] + 33
frame #32: 0x00a7f456 QuartzCore`CA::Layer::display() + 142
frame #33: 0x00a7fcc0 QuartzCore`-[CALayer display] + 33
frame #34: 0x00a73ef6 QuartzCore`CA::Layer::display_if_needed(CA::Transaction*) + 322
frame #35: 0x00a73f7c QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 38
frame #36: 0x009d23c6 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 284
frame #37: 0x009d378c QuartzCore`CA::Transaction::commit() + 392
frame #38: 0x009d3e58 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #39: 0x032df9de CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
frame #40: 0x032df920 CoreFoundation`__CFRunLoopDoObservers + 400
frame #41: 0x032d535a CoreFoundation`__CFRunLoopRun + 1226
frame #42: 0x032d4bcb CoreFoundation`CFRunLoopRunSpecific + 443
frame #43: 0x032d49fb CoreFoundation`CFRunLoopRunInMode + 123
frame #44: 0x0622124f GraphicsServices`GSEventRunModal + 192
frame #45: 0x0622108c GraphicsServices`GSEventRun + 104
frame #46: 0x019c08b6 UIKit`UIApplicationMain + 1526
* frame #47: 0x0028951d Racks`main(argc=1, argv=0xbff245a8) + 141 at main.m:16
frame #48: 0x03dbdac9 libdyld.dylib`start + 1

Related

EAGLContext presentRenderbuffer cause deadlock

I use openGLES in my IOS app. The deadlock occurs in some case. The deadlocked Threads are as following. It seem The EAGLContext presentRenderbuffer cause semaphore::wait() in the sync queue 'gputools.DYSharedMemoryTransport.0x109700000.send', then the main thread reach to wait the same queue, this is deadlock. My question is how EAGLContext presentRenderbuffer cause that wait semaphore::wait()?
thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00000001a6c788b0 libsystem_kernel.dylib`__ulock_wait + 8
frame #1: 0x000000010915b720 libdispatch.dylib`_dlock_wait + 52
frame #2: 0x000000010915b504 libdispatch.dylib`_dispatch_thread_event_wait_slow + 48
frame #3: 0x0000000109169c60 libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 340
frame #4: 0x0000000109169694 libdispatch.dylib`_dispatch_sync_f_slow + 176
frame #5: 0x0000000109389284 GPUToolsCore`-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 556
frame #6: 0x00000001093759e0 GPUToolsCore`-[DYSharedMemoryTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 232
frame #7: 0x00000001a6e52094 CoreFoundation`__NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
frame #8: 0x00000001a6d5566c CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 192
frame #9: 0x0000000109381a60 GPUToolsCore`CADisplayLink_initWithDisplayLink(CADisplayLink*, objc_selector*, void*) + 240
frame #10: 0x00000001ad6a7fdc QuartzCore`+[CADisplayLink(CADisplayLinkPrivate) displayLinkWithDisplay:target:selector:] + 276
frame #11: 0x0000000109381fd4 GPUToolsCore`CADisplayLink_displayLinkWithDisplay_target_selector(objc_class*, objc_selector*, CADisplay*, objc_object*, objc_selector*) + 112
frame #12: 0x00000001aae4b8ec UIKitCore`-[_UITouchForceObservable receiveObservedValue:] + 164
frame #13: 0x00000001aaa65444 UIKitCore`-[UIGestureRecognizer _updateForceClassifierWithEvent:] + 72
frame #14: 0x00000001aaa655a0 UIKitCore`-[UIGestureRecognizer _touchesBegan:withEvent:] + 232
frame #15: 0x00000001aaeddda8 UIKitCore`-[UITouchesEvent _sendEventToGestureRecognizer:] + 360
frame #16: 0x00000001aaa5b7f8 UIKitCore`__47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke + 68
frame #17: 0x00000001aaa5b8f4 UIKitCore`-[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 216
frame #18: 0x00000001aaa5b77c UIKitCore`-[UIGestureEnvironment _updateForEvent:window:] + 204
frame #19: 0x00000001aae9d238 UIKitCore`-[UIWindow sendEvent:] + 3324
frame #20: 0x00000001aae79f64 UIKitCore`-[UIApplication sendEvent:] + 336
frame #21: 0x00000001aaef0868 UIKitCore`__dispatchPreprocessedEventFromEventQueue + 5880
frame #22: 0x00000001aaef2dc4 UIKitCore`__handleEventQueueInternal + 4924
frame #23: 0x00000001aaeebc38 UIKitCore`__handleHIDEventFetcherDrain + 108
frame #24: 0x00000001a6dfd090 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #25: 0x00000001a6dfcfe8 CoreFoundation`__CFRunLoopDoSource0 + 80
frame #26: 0x00000001a6dfc780 CoreFoundation`__CFRunLoopDoSources0 + 180
frame #27: 0x00000001a6df78cc CoreFoundation`__CFRunLoopRun + 1080
frame #28: 0x00000001a6df716c CoreFoundation`CFRunLoopRunSpecific + 464
frame #29: 0x00000001b0c2f328 GraphicsServices`GSEventRunModal + 104
frame #30: 0x00000001aae61d0c UIKitCore`UIApplicationMain + 1936
frame #31: 0x00000001046d4e00 BAvatar`main(argc=1, argv=0x000000016bc0f7b0) at main.m:14:16
frame #32: 0x00000001a6c82424 libdyld.dylib`start + 4
thread #91
frame #0: 0x00000001a6c56630 libsystem_kernel.dylib`semaphore_wait_trap + 8
frame #1: 0x00000001c9d68864 caulk`caulk::mach::semaphore::wait() + 24
frame #2: 0x00000001c9d63538 caulk`caulk::semaphore::timed_wait(double) + 140
frame #3: 0x00000001c9d67220 caulk`caulk::concurrent::details::worker_thread::run() + 40
frame #4: 0x00000001c9d673b0 caulk`void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 56
frame #5: 0x00000001a6b9c1f0 libsystem_pthread.dylib`_pthread_start + 124
* thread #187, queue = 'gputools.DYSharedMemoryTransport.0x109700000.send'
frame #0: 0x00000001a6c78238 libsystem_kernel.dylib`__semwait_signal + 8
frame #1: 0x00000001a6ae5664 libsystem_c.dylib`nanosleep + 212
frame #2: 0x00000001a6ae553c libsystem_c.dylib`usleep + 64
frame #3: 0x0000000109376bac GPUToolsCore`-[DYSharedMemoryTransport _waitEAGAIN] + 40
frame #4: 0x0000000109398940 GPUToolsCore`-[DYBaseStreamTransport _writeBuffers:] + 232
frame #5: 0x0000000109398ed4 GPUToolsCore`-[DYBaseStreamTransport _sendMessage:error:] + 476
frame #6: 0x0000000109389408 GPUToolsCore`__63-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:]_block_invoke.153 + 100
frame #7: 0x000000010915ac88 libdispatch.dylib`_dispatch_client_callout + 16
frame #8: 0x0000000109169dcc libdispatch.dylib`_dispatch_sync_invoke_and_complete_recurse + 132
frame #9: 0x0000000109389284 GPUToolsCore`-[DYTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 556
frame #10: 0x00000001093759e0 GPUToolsCore`-[DYSharedMemoryTransport send:inReplyTo:error:replyQueue:timeout:handler:] + 232
frame #11: 0x0000000106710470 libglInterpose.dylib`handle_frame_boundary + 456
frame #12: 0x00000001068ca0d8 libglInterpose.dylib`_EAGLContext_PresentInterposeCommon(EAGLContext*, unsigned int, unsigned long, double, bool () block_pointer) + 1012
frame #13: 0x00000001068c7ee4 libglInterpose.dylib`EAGLContext_presentRenderbuffer(EAGLContext*, objc_selector*, unsigned long) + 80```
EAGLContext is part of OpenGL, which is deprecated. You should switch to Metal on this link: https://developer.apple.com/documentation/coreimage/cicontext/1437609-init

main thread was blocked when i use UIWebView

Today i find a bug in my app relate to UIWebView, there are two case for it, the url i request is https://estore-cn.pandora.net/Bracelets-1/
When I use UIWebView to show a web page, and I exit that page, the webView's dealloc been called, but the UI thread been blocked, and several minutes later it recovers.
This is the thread stack here when I press pause program execution button in Xcode.
* thread #1: tid = 0x580710, 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8
frame #1: 0x0000000180e7239c libsystem_pthread.dylib`_pthread_mutex_lock_wait + 96
frame #2: 0x0000000180e7257c libsystem_pthread.dylib`_pthread_mutex_lock_slow + 296
frame #3: 0x00000001850dc3b0 WebCore`_WebTryThreadLock(bool) + 52
frame #4: 0x00000001850dcb3c WebCore`WebThreadLock + 108
frame #5: 0x00000001865abfc0 UIKit`-[UIWebView dealloc] + 36
frame #6: 0x000000010032ba64 QDaily`-[QDWebView dealloc](self=0x00000001575f3980, _cmd="dealloc") + 148 at QDWebView.m:63
frame #7: 0x0000000180889ae8 libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 508
frame #8: 0x00000001810e89fc CoreFoundation`_CFAutoreleasePoolPop + 28
frame #9: 0x00000001811bebc0 CoreFoundation`__CFRunLoopRun + 1636
frame #10: 0x00000001810e8c50 CoreFoundation`CFRunLoopRunSpecific + 384
frame #11: 0x00000001829d0088 GraphicsServices`GSEventRunModal + 180
frame #12: 0x00000001863d6088 UIKit`UIApplicationMain + 204
frame #13: 0x000000010037490c QDaily`main(argc=1, argv=0x000000016fd03af0) + 172 at main.m:16
frame #14: 0x0000000180c868b8 libdyld.dylib`start + 4
second case is ,when i begin skip into the webView page, the same case happened.
thread #1: tid = 0x5801dc, 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x0000000180da3f6c libsystem_kernel.dylib`__psynch_mutexwait + 8
frame #1: 0x0000000180e7239c libsystem_pthread.dylib`_pthread_mutex_lock_wait + 96
frame #2: 0x0000000180e7257c libsystem_pthread.dylib`_pthread_mutex_lock_slow + 296
frame #3: 0x00000001850dc3b0 WebCore`_WebTryThreadLock(bool) + 52
frame #4: 0x00000001850dcb3c WebCore`WebThreadLock + 108
frame #5: 0x00000001867f3dc4 UIKit`-[UIWebView _webViewCommonInitWithWebView:scalesPageToFit:] + 128
frame #6: 0x00000001865a83ec UIKit`-[UIWebView initWithFrame:] + 80
frame #7: 0x00000001002abb60 QDaily`-[QDWebView initWithFrame:](self=0x0000000000000000, _cmd="initWithFrame:", frame=(origin = (x = 0, y = 20), size = (width = 414, height = 666))) + 120 at QDWebView.m:71
frame #8: 0x0000000100212244 QDaily`-[QDSimpleWebViewController viewDidLoad](self=0x0000000131225070, _cmd="viewDidLoad") + 796 at QDSimpleWebViewController.m:57
frame #9: 0x000000018636cc40 UIKit`-[UIViewController loadViewIfRequired] + 996
frame #10: 0x00000001863850d0 UIKit`-[UIViewController __viewWillAppear:] + 132
frame #11: 0x000000018651fe5c UIKit`-[UINavigationController _startCustomTransition:] + 1052
frame #12: 0x000000018642be40 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 688
frame #13: 0x000000018642bb1c UIKit`-[UINavigationController __viewWillLayoutSubviews] + 60
frame #14: 0x000000018642ba84 UIKit`-[UILayoutContainerView layoutSubviews] + 208
frame #15: 0x00000001863681e4 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 656
frame #16: 0x0000000183cf698c QuartzCore`-[CALayer layoutSublayers] + 148
frame #17: 0x0000000183cf15c8 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 292
frame #18: 0x0000000183cf1488 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
frame #19: 0x0000000183cf0ab8 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 252
frame #20: 0x0000000183cf0818 QuartzCore`CA::Transaction::commit() + 500
frame #21: 0x000000018636aff4 UIKit`_UIApplicationHandleEventQueue + 4980
frame #22: 0x00000001811c109c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #23: 0x00000001811c0b30 CoreFoundation`__CFRunLoopDoSources0 + 540
frame #24: 0x00000001811be830 CoreFoundation`__CFRunLoopRun + 724
frame #25: 0x00000001810e8c50 CoreFoundation`CFRunLoopRunSpecific + 384
frame #26: 0x00000001829d0088 GraphicsServices`GSEventRunModal + 180
frame #27: 0x00000001863d6088 UIKit`UIApplicationMain + 204
frame #28: 0x00000001002f490c QDaily`main(argc=1, argv=0x000000016fd83af0) + 172 at main.m:16
frame #29: 0x0000000180c868b8 libdyld.dylib`start + 4
I don't know how to resolve it
ADD: this is the webThread when happened dead lock
* thread #19: tid = 0x58076c, 0x00000001854180f0 WebCore`WTF::HashMap<unsigned long, WTF::RefPtr<WebCore::ResourceLoader>, WTF::IntHash<unsigned long>, WTF::HashTraits<unsigned long>, WTF::HashTraits<WTF::RefPtr<WebCore::ResourceLoader> > >::remove(unsigned long const&) + 164, name = 'WebThread'
* frame #0: 0x00000001854180f0 WebCore`WTF::HashMap<unsigned long, WTF::RefPtr<WebCore::ResourceLoader>, WTF::IntHash<unsigned long>, WTF::HashTraits<unsigned long>, WTF::HashTraits<WTF::RefPtr<WebCore::ResourceLoader> > >::remove(unsigned long const&) + 164
frame #1: 0x0000000185126e54 WebCore`WebCore::DocumentLoader::removeSubresourceLoader(WebCore::ResourceLoader*) + 40
frame #2: 0x00000001851292a0 WebCore`WebCore::ResourceLoader::cancel(WebCore::ResourceError const&) + 492
frame #3: 0x0000000185087764 WebCore`WebCore::ResourceLoader::init(WebCore::ResourceRequest const&) + 404
frame #4: 0x00000001850873fc WebCore`WebCore::SubresourceLoader::startLoading() + 36
frame #5: 0x000000018508735c WebCore`WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadScheduler::HostInformation*, WebCore::ResourceLoadPriority) + 516
frame #6: 0x00000001851070b8 WebCore`WebCore::ResourceLoadScheduler::servePendingRequests(WebCore::ResourceLoadPriority) + 412
frame #7: 0x0000000185079f1c WebCore`WebCore::ThreadTimers::sharedTimerFiredInternal() + 148
frame #8: 0x0000000185079e5c WebCore`WebCore::timerFired(__CFRunLoopTimer*, void*) + 36
frame #9: 0x00000001811c1794 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
frame #10: 0x00000001811c1438 CoreFoundation`__CFRunLoopDoTimer + 884
frame #11: 0x00000001811beb4c CoreFoundation`__CFRunLoopRun + 1520
frame #12: 0x00000001810e8c50 CoreFoundation`CFRunLoopRunSpecific + 384
frame #13: 0x00000001850da108 WebCore`RunWebThread(void*) + 456
frame #14: 0x0000000180e6fb28 libsystem_pthread.dylib`_pthread_body + 156
frame #15: 0x0000000180e6fa8c libsystem_pthread.dylib`_pthread_start + 156
frame #16: 0x0000000180e6d028 libsystem_pthread.dylib`thread_start + 4
ADD: JavaScriptCore :: Marking thread
* thread #20: tid = 0x58076d, 0x0000000180da3f24 libsystem_kernel.dylib`__psynch_cvwait + 8, name = 'JavaScriptCore::Marking'
* frame #0: 0x0000000180da3f24 libsystem_kernel.dylib`__psynch_cvwait + 8
frame #1: 0x0000000180e6ece8 libsystem_pthread.dylib`_pthread_cond_wait + 648
frame #2: 0x00000001807fb42c libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56
frame #3: 0x0000000184bc0d5c JavaScriptCore`JSC::GCThread::waitForNextPhase() + 144
frame #4: 0x0000000184bc0df4 JavaScriptCore`JSC::GCThread::gcThreadMain() + 84
frame #5: 0x0000000184896614 JavaScriptCore`WTF::threadEntryPoint(void*) + 212
frame #6: 0x0000000184896524 JavaScriptCore`WTF::wtfThreadEntryPoint(void*) + 24
frame #7: 0x0000000180e6fb28 libsystem_pthread.dylib`_pthread_body + 156
frame #8: 0x0000000180e6fa8c libsystem_pthread.dylib`_pthread_start + 156
frame #9: 0x0000000180e6d028 libsystem_pthread.dylib`thread_start + 4

App crashes while using custom fonts in iOS 9 beta 5

My app is in app store which supports iOS 7.1.2 to iOS 8.4 and it is working fine till 8.4 version. When I tried to run the same app on iOS 9 beta 5 its getting crashed.It was working fine in iOS 9 beta 4. After debugging I found that the crash is due to the custom font we have used in our app. Is this the problem with iOs 9 beta 5 ? What should I do to support my app on iOS 9.0 main release which will be expecting in a week.
Below is the stack trace of crash
thread #1: tid = 0x6d68, 0x0000000184d6e1a4 CoreTextOTL::GPOS::ApplyPairPos(OTL::LookupSubtable const*,
OTL::TGlyphIterator&, OTL::Coverage const&) const + 636, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1,
address=0x3020451cc)
frame #0: 0x0000000184d6e1a4 CoreTextOTL::GPOS::ApplyPairPos(OTL::LookupSubtable const*,
OTL::TGlyphIterator&, OTL::Coverage const&) const + 636
frame #1: 0x0000000184d72b14 CoreTextOTL::GPOS::ApplyLookupSubtable(OTL::Lookup const&, unsigned
int, OTL::LookupSubtable const*, OTL::TGlyphIterator&, OTL::Coverage
const&) const + 116
frame #2: 0x0000000184d81690 CoreTextOTL::GPOS::ApplyLookups(TRunGlue&, int, OTL::GlyphLookups&)
const + 544
frame #3: 0x0000000184d80dc0 CoreTextTOpenTypePositioningEngine::PositionRuns(SyncState&,
KerningStatus&) + 628
frame #4: 0x0000000184cea7b4 CoreTextTKerningEngine::PositionGlyphs(TRunGlue&, ShapingType,
AnnexTableFlag) + 188
frame #5: 0x0000000184ce90a4 CoreTextCTFontTransformGlyphs + 440
frame #6: 0x000000019504c85c UIFoundation__NSStringDrawingEngine + 8788
frame #7: 0x000000019504a5bc UIFoundation-[NSString(NSExtendedStringDrawing)
boundingRectWithSize:options:attributes:context:] + 156
frame #8: 0x0000000189731724 UIKit-[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 780
frame #9: 0x000000018973137c UIKit-[UILabel _intrinsicSizeWithinSize:] + 132
frame #10: 0x000000018982c548 UIKit-[UILabel intrinsicContentSize] + 72
frame #11: 0x000000018982c3a8 UIKit-[UIView(UIConstraintBasedLayout)
_generateContentSizeConstraints] + 48
frame #12: 0x000000018982bdbc UIKit-[UIView(UIConstraintBasedLayout) _updateContentSizeConstraints]
588
frame #13: 0x0000000189827e5c UIKit-[UIView(AdditionalLayoutSupport) updateConstraints] + 244
frame #14: 0x000000018982bb60 UIKit-[UILabel updateConstraints] + 220
frame #15: 0x0000000189f28c8c UIKit`-[UIView(AdditionalLayoutSupport)
_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:forSecondPass:]
460
frame #16: 0x0000000189f28ef4 UIKit`-[UIView(AdditionalLayoutSupport)
_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:forSecondPass:]
200
frame #17: 0x0000000189f28bbc UIKit`-[UIView(AdditionalLayoutSupport)
_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:forSecondPass:]
252
frame #18: 0x00000001850b0c00 Foundation-[NSISEngine withBehaviors:performModifications:] + 168
frame #19: 0x000000018982ab78 UIKit-[UIView(AdditionalLayoutSupport)
_withAutomaticEngineOptimizationDisabledIfEngineExists:] + 64
frame #20: 0x0000000189f28ec8 UIKit`-[UIView(AdditionalLayoutSupport)
_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:forSecondPass:]
156
frame #21: 0x0000000189f28bbc UIKit`-[UIView(AdditionalLayoutSupport)
_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:forSecondPass:]
252
frame #22: 0x0000000189f28ef4 UIKit`-[UIView(AdditionalLayoutSupport)
_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:forSecondPass:]
200
frame #23: 0x000000018982ba5c UIKit__60-[UIView(AdditionalLayoutSupport)
updateConstraintsIfNeeded]_block_invoke + 100
frame #24: 0x00000001850b0c00 Foundation-[NSISEngine withBehaviors:performModifications:] + 168
frame #25: 0x000000018982ab78 UIKit-[UIView(AdditionalLayoutSupport)
_withAutomaticEngineOptimizationDisabledIfEngineExists:] + 64
frame #26: 0x000000018982b690 UIKit-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] +
244
frame #27: 0x0000000189848094 UIKit-[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded] +
108
frame #28: 0x0000000189f29598 UIKit-[UIView(AdditionalLayoutSupport)
_updateConstraintsAtEngineLevelIfNeeded] + 268
frame #29: 0x0000000189a27808 UIKit-[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 176
frame #30: 0x0000000189722640 UIKit-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 688
frame #31: 0x0000000188f31f14 QuartzCore-[CALayer layoutSublayers] + 148
frame #32: 0x0000000188f2cb20 QuartzCoreCA::Layer::layout_if_needed(CA::Transaction*) + 292
frame #33: 0x0000000188f2c9e0 QuartzCoreCA::Layer::layout_and_display_if_needed(CA::Transaction*) +
32
frame #34: 0x0000000188f2c07c QuartzCoreCA::Context::commit_transaction(CA::Transaction*) + 252
frame #35: 0x0000000188f2bdd0 QuartzCoreCA::Transaction::commit() + 516
frame #36: 0x0000000188f254bc QuartzCoreCA::Transaction::observer_callback(CFRunLoopObserver*,
unsigned long, void*) + 80
frame #37: 0x00000001841cc768 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
32
frame #38: 0x00000001841ca50c CoreFoundation__CFRunLoopDoObservers + 372
frame #39: 0x00000001840f98c0 CoreFoundationCFRunLoopRunSpecific + 416
frame #40: 0x00000001897931ec UIKit-[UIApplication _run] + 460
frame #41: 0x000000018978e0d4 UIKitUIApplicationMain + 204 * frame #42: 0x000000010004eb08 SampleFontmain(argc=1,
argv=0x000000016fdb7af0) + 124 at main.m:14
frame #43: 0x00000001994ae8b8 libdyld.dylibstart + 4

All exception breakpoint can't catch objc_exception_throw

I recently get a strange problem, exception breakpoint can't catch objc_exception_throw. In this case, I can't locate where is the problem? Follow is stack strace:
(lldb) bt
* thread #7: tid = 0x40df6f, 0x00000001097a9b8a libobjc.A.dylib`objc_exception_throw, name = 'com.apple.NSURLConnectionLoader', stop reason = breakpoint 1.3 2.2
* frame #0: 0x00000001097a9b8a libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000109b749ad CoreFoundation`+[NSException raise:format:] + 205
frame #2: 0x00000001091abab7 Foundation`NSRequestConcreteImplementation + 240
frame #3: 0x00000001091b2da2 Foundation`-[NSStream(NSStream) streamStatus] + 39
frame #4: 0x0000000107ab011d CFNetwork`HTTPProtocol::useNetStreamInfoForRequest(MetaNetStreamInfo*, HTTPRequestMessage const*, unsigned char) + 311
frame #5: 0x0000000107abc561 CFNetwork`HTTPConnectionCacheEntry::dispatchConnectionToProtocol(HTTPNetConnection*, HTTPConnectionCacheEnqueuedRequestInfo*, unsigned char) + 265
frame #6: 0x0000000107abb67a CFNetwork`HTTPConnectionCacheEntry::ingestTube(Tube*) + 728
frame #7: 0x0000000107abf0d1 CFNetwork`___ZN24HTTPConnectionCacheEntry12newTubeReadyEP4TubeP9__CFError_block_invoke + 26
frame #8: 0x00000001079f7d16 CFNetwork`RunloopBlockContext::_invoke_block(void const*, void*) + 72
frame #9: 0x0000000109a7cb44 CoreFoundation`CFArrayApplyFunction + 68
frame #10: 0x00000001079f7bd7 CFNetwork`RunloopBlockContext::perform() + 133
frame #11: 0x00000001079f7a16 CFNetwork`MultiplexerSource::perform() + 256
frame #12: 0x00000001079f782c CFNetwork`MultiplexerSource::_perform(void*) + 72
frame #13: 0x0000000109aa9c91 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #14: 0x0000000109a9fb5d CoreFoundation`__CFRunLoopDoSources0 + 269
frame #15: 0x0000000109a9f194 CoreFoundation`__CFRunLoopRun + 868
frame #16: 0x0000000109a9ebc6 CoreFoundation`CFRunLoopRunSpecific + 470
frame #17: 0x0000000107a7d250 CFNetwork`+[NSURLConnection(Loader) _resourceLoadLoop:] + 434
frame #18: 0x00000001091201dd Foundation`__NSThread__main__ + 1194
frame #19: 0x000000010a874268 libsystem_pthread.dylib`_pthread_body + 131
frame #20: 0x000000010a8741e5 libsystem_pthread.dylib`_pthread_start + 176
frame #21: 0x000000010a87241d libsystem_pthread.dylib`thread_start + 13
Any suggestion will be appreciation!

UIWebView Crashing on Drop Down

We are loading HTML with Select control (Drop Down) in UIWebView and when we click on Drop down, the app is crashing. This is happening only when text having lengthy text, but works fine with short Text.
When we debugged, we found its an issue with UILabel in UIPopoverController coming from UIWebView. When UILabel has text with 2 lines, this issue is happening, single line its fine. We are unable to identify the issue whether its with Storyboard or Settings...etc.
Any help will be much appreciated.
Here is the Crash
* thread #1: tid = 0x1bd3, 0x034ad930 CoreFoundation`CFArrayGetValueAtIndex + 112, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x034ad930 CoreFoundation`CFArrayGetValueAtIndex + 112
frame #1: 0x007d1b41 CoreText`TCharStream::CopyBreakIterator(__CFString const*) + 261
frame #2: 0x007d18f4 CoreText`TCharStream::FindLineBreak(CFRange, bool, __CFString const*) const + 246
frame #3: 0x00758a4a CoreText`TTypesetter::SuggestLineBreak(TLine const&, long, double, double) + 328
frame #4: 0x007586b9 CoreText`CTLineSuggestLineBreakWithOffset + 55
frame #5: 0x0839d89f UIFoundation`__NSStringDrawingEngine + 20275
frame #6: 0x08398940 UIFoundation`-[NSString(NSExtendedStringDrawing) boundingRectWithSize:options:attributes:context:] + 201
frame #7: 0x01b265c1 UIKit`-[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 1425
frame #8: 0x01b25e7e UIKit`-[UILabel textRectForBounds:limitedToNumberOfLines:] + 85
frame #9: 0x01d1d0cb UIKit`-[UITableViewCellLayoutManager intrinsicContentSizeForCell:] + 554
frame #10: 0x01c16594 UIKit`-[UITableViewCell sizeThatFits:] + 46
frame #11: 0x02092ade UIKit`-[UIView(UIConstraintBasedLayout) systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 130
frame #12: 0x01c01c9f UIKit`-[UITableViewCell systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 220
frame #13: 0x01a3f847 UIKit`-[UITableView _heightForCell:atIndexPath:] + 386
frame #14: 0x01a302fb UIKit`__53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 2244
frame #15: 0x019987af UIKit`+[UIView(Animation) performWithoutAnimation:] + 82
frame #16: 0x019987f8 UIKit`+[UIView(Animation) _performWithoutAnimation:] + 40
frame #17: 0x01a2fa2f UIKit`-[UITableView _configureCellForDisplay:forIndexPath:] + 355
frame #18: 0x01a381da UIKit`-[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 503
frame #19: 0x01a3829e UIKit`-[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 77
frame #20: 0x01a11a6b UIKit`-[UITableView _updateVisibleCellsNow:isRecursive:] + 3034
frame #21: 0x01a2c3d1 UIKit`-[UITableView layoutSubviews] + 222
frame #22: 0x019a1dd1 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608
frame #23: 0x02f55771 libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
frame #24: 0x0061f28f QuartzCore`-[CALayer layoutSublayers] + 152
frame #25: 0x00613115 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 397
frame #26: 0x00612f70 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 26
frame #27: 0x005713c6 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 284
frame #28: 0x0057278c QuartzCore`CA::Transaction::commit() + 392
frame #29: 0x00572e58 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #30: 0x034fa9de CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
frame #31: 0x034fa920 CoreFoundation`__CFRunLoopDoObservers + 400
frame #32: 0x034f035a CoreFoundation`__CFRunLoopRun + 1226
frame #33: 0x034efbcb CoreFoundation`CFRunLoopRunSpecific + 443
frame #34: 0x034ef9fb CoreFoundation`CFRunLoopRunInMode + 123
frame #35: 0x04d4224f GraphicsServices`GSEventRunModal + 192
frame #36: 0x04d4208c GraphicsServices`GSEventRun + 104
frame #37: 0x019168b6 UIKit`UIApplicationMain + 1526
* frame #38: 0x000f85bd main(argc=1, argv=0xbff5e584) + 141 at main.m:16
frame #39: 0x04400ac9 libdyld.dylibstart + 1
Thanks,
Vijay
This is a duplicate, see my answer here: https://stackoverflow.com/a/26692948/4206060
In short, put this into your web view delegate:
-(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_USEC), dispatch_get_main_queue(),
^{
[super presentViewController:viewControllerToPresent animated:flag completion:completion];
});
}
This is solved. The issue was because of hardcoding "AppleLanguages" NSDefaults Key to a String. When UIWebview tries to show UILabel it tries to fetch AppleLanguages as Array and crashing.

Resources