Application hanging in __semwait_signal () - objective-c

I have a user of my application that sometimes when they run the application it gets stuck at the following point ...
0x92542782 in __semwait_signal ()
(gdb) where
#0 0x92542782 in __semwait_signal ()
#1 0x9254243e in _pthread_cond_wait ()
#2 0x925440d8 in pthread_cond_wait$UNIX2003 ()
#3 0x95232670 in fe_fragment_render_quad ()
#4 0x9522f07f in fe_sw_quad ()
#5 0x9522edf9 in fe_context_quad ()
#6 0x95227915 in fe_tree_render_apply_1 ()
#7 0x9522244f in fe_tree_render_apply ()
#8 0x95220c9b in fe_tree_render_ ()
#9 0x9522443c in fe_tree_render_texture ()
#10 0x95224295 in texture_retain ()
#11 0x95223d5d in fe_texture_new ()
#12 0x95222a62 in fe_tree_create_texture ()
#13 0x95222159 in fe_tree_render_apply ()
#14 0x95220c9b in fe_tree_render_ ()
#15 0x9522443c in fe_tree_render_texture ()
#16 0x95224295 in texture_retain ()
#17 0x95223d5d in fe_texture_new ()
#18 0x95222a62 in fe_tree_create_texture ()
#19 0x95222159 in fe_tree_render_apply ()
#20 0x95220c9b in fe_tree_render_ ()
#21 0x9522443c in fe_tree_render_texture ()
#22 0x95224295 in texture_retain ()
#23 0x95223d5d in fe_texture_new ()
#24 0x95222a62 in fe_tree_create_texture ()
#25 0x95222159 in fe_tree_render_apply ()
#26 0x95220c9b in fe_tree_render_ ()
#27 0x95220bef in fe_tree_render_ ()
#28 0x9522443c in fe_tree_render_texture ()
#29 0x95224295 in texture_retain ()
#30 0x95223d5d in fe_texture_new ()
#31 0x95222a62 in fe_tree_create_texture ()
#32 0x95222159 in fe_tree_render_apply ()
#33 0x95220c9b in fe_tree_render_ ()
#34 0x952201e2 in fe_tree_render_tree ()
#35 0x9520e72a in fe_tree_render_image ()
#36 0x9520dfea in fe_image_render_ ()
#37 0x9520dae7 in fe_image_get_bitmap ()
#38 0x9520d8b7 in -[CIContextImpl render:toBitmap:rowBytes:bounds:format:colorSpace:] ()
#39 0x918f29e8 in cgxcoreimage_instance_render ()
#40 0x918f2ae8 in cgxcoreimage_provider_create_data ()
#41 0x9841d601 in faultDataAcquireBytePointer ()
#42 0x9837f20f in CGAccessSessionGetBytePointer ()
#43 0x983db0e0 in img_decode_read ()
#44 0x983daf47 in img_colormatch_read ()
#45 0x983dad7c in img_alphamerge_read ()
#46 0x983b8ee9 in img_data_lock ()
#47 0x983b5ee6 in CGSImageDataLock ()
#48 0x92b16748 in ripc_AcquireImage ()
#49 0x92b143be in ripc_DrawImage ()
#50 0x983b5b60 in CGContextDrawImage ()
#51 0x990ed9c6 in CUIPenCG::DrawImage ()
#52 0x990f9e85 in CUIRenderer::DrawImage ()
#53 0x990eaa94 in CUIRenderer::Draw ()
#54 0x90d6059c in -[NSCoreUIImageRep draw] ()
#55 0x90d60481 in -[NSImageRep drawInRect:] ()
#56 0x90d602fd in __-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke_2 ()
#57 0x90d6025b in NSGraphicsContextPushContextWithFlippedMetadata_drawWithBlock_ ()
#58 0x90cb4673 in __-[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:]_block_invoke_1 ()
#59 0x90cb3b39 in -[NSImageRep drawInRect:fromRect:operation:fraction:respectFlipped:hints:] ()
#60 0x90caed89 in -[NSImage _drawMappingAlignmentRectToRect:withState:backgroundStyle:operation:fraction:flip:hints:] ()
#61 0x90d5f42e in -[NSButtonCell drawImage:withFrame:inView:] ()
#62 0x90d5e941 in -[NSButtonCell _configureAndDrawImageWithRect:cellFrame:controlView:] ()
#63 0x90d5cba8 in -[NSButtonCell drawInteriorWithFrame:inView:] ()
#64 0x90d5c1bd in -[NSButtonCell drawWithFrame:inView:] ()
#65 0x90d5489e in -[NSControl drawRect:] ()
#66 0x90d4cce1 in -[NSView _drawRect:clip:] ()
#67 0x90d4b97f in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#68 0x90d4bcb4 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#69 0x90d4bcb4 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#70 0x90d730c2 in -[NSToolbarItemViewer _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#71 0x90d4bcb4 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#72 0x90d4bcb4 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#73 0x90d4bcb4 in -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] ()
#74 0x90d49e9e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#75 0x90d49a13 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#76 0x90d46359 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ()
#77 0x90ca6f26 in -[NSView displayIfNeeded] ()
#78 0x90c70292 in -[NSWindow displayIfNeeded] ()
#79 0x90c6ed30 in -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] ()
#80 0x90c6e892 in -[NSWindow orderWindow:relativeTo:] ()
#81 0x90c6c054 in -[NSWindow makeKeyAndOrderFront:] ()
#82 0x000151a2 in -[AppController applicationFinishedLaunching:] ()
#83 0x9208f253 in _nsnote_callback ()
#84 0x98facc29 in __CFXNotificationPost ()
#85 0x98fac65a in _CFXNotificationPostNotification ()
#86 0x92084120 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#87 0x920914fd in -[NSNotificationCenter postNotificationName:object:] ()
#88 0x90ca78f2 in -[NSApplication _postDidFinishNotification] ()
#89 0x90ca7802 in -[NSApplication _sendFinishLaunchingNotification] ()
#90 0x90dfe565 in -[NSApplication(NSAppleEventHandling) _handleAEOpen:] ()
#91 0x90dfe185 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()
#92 0x920c446c in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#93 0x920c4230 in _NSAppleEventManagerGenericHandler ()
#94 0x929c0de6 in aeDispatchAppleEvent ()
#95 0x929c0ce5 in dispatchEventAndSendReply ()
#96 0x929c0bf2 in aeProcessAppleEvent ()
#97 0x97cae381 in AEProcessAppleEvent ()
#98 0x90c77ed2 in _DPSNextEvent ()
#99 0x90c7750a in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#100 0x90c3969b in -[NSApplication run] ()
#101 0x90c31735 in NSApplicationMain ()
#102 0x0000262e in start ()
(gdb)
When you debug a bit more and print the NSImage instance it is trying to draw ...
(gdb) frame 60
(gdb) po *(int*)($ebp+8)
<NSImage 0x1261f10 Name=ForwardTemplate Size={20, 20} Reps=(
NSPDFImageRep 0x18abc30 Size={20, 20} ColorSpace=NSCalibratedRGBColorSpace BPS=0 Pixels=20x20 Alpha=NO
)>
This is one of the template images for the "forward transport" custom button in the application's toolbar. (see http://www.cancelmonday.com/beatler for a screen shot)
I am just looking for ideas on what I can do to try and debug this further as the hard thing is that it is only this one user that is reporting this issue and I cannot reproduce it locally.
Any help would be greatly appreciated.
Update
Thanks to diciu I ran ...
thread apply all bt
This did show up a problem with a load of threads sat waiting and an example stack for a thread is ...
Thread 365 (process 1866):
#0 0x92542782 in __semwait_signal ()
#1 0x9254243e in _pthread_cond_wait ()
#2 0x925440d8 in pthread_cond_wait$UNIX2003 ()
#3 0x920b7b5e in -[NSCondition wait] ()
#4 0x920a5531 in -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] ()
#5 0x920b7cb7 in -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] ()
#6 0x000183e8 in -[BLImageLoader main] ()
#7 0x920b73b3 in -[__NSOperationInternal start] ()
#8 0x920b6fe0 in ____startOperations_block_invoke_2 ()
#9 0x925487b8 in _dispatch_call_block_and_release ()
#10 0x9253a97e in _dispatch_worker_thread2 ()
#11 0x9253a401 in _pthread_wqthread ()
#12 0x9253a246 in start_wqthread ()
These threads do update the UI but it is always done through ...
[item performSelectorOnMainThread:#selector(setDisplayImage:) withObject:image waitUntilDone:YES];
I thought this would be safe, are there any issues with lots of threads e.g. 400+ all wanting to ...
performSelectorOnMainThread
...within the same time period?

Your main thread is blocked waiting for a condition to happen (pthread_cond_wait$UNIX2003).
Are you updating the UI from a non-main thread?
In gdb
thread apply all bt
will show you the state of all your application's threads - it may be that your main thread is blocked by some other thread doing UI stuff.

Related

How to print self in debugger console on private method

Here's my stack trace for an exception.
#0 0x049f088a in objc_exception_throw ()
#1 0x05f933b5 in __NSFastEnumerationMutationHandler ()
#2 0x03046e9d in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] ()
#3 0x03047043 in __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke ()
#4 0x03046f14 in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] ()
#5 0x03047043 in __85-[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:]_block_invoke ()
#6 0x03046f14 in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] ()
#7 0x03046d3e in -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:] ()
#8 0x03052187 in -[UIView(Internal) _addSubview:positioned:relativeTo:] ()
#9 0x03045846 in -[UIView(Hierarchy) insertSubview:atIndex:] ()
#10 0x02fde714 in __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke ()
#11 0x0304c3ef in +[UIView(Animation) performWithoutAnimation:] ()
#12 0x02fddc96 in -[_UINavigationParallaxTransition animateTransition:] ()
#13 0x03118e4e in -[UINavigationController _startCustomTransition:] ()
#14 0x031250c7 in -[UINavigationController _startDeferredTransitionIfNeeded:] ()
#15 0x03125cb9 in -[UINavigationController __viewWillLayoutSubviews] ()
#16 0x0325f181 in -[UILayoutContainerView layoutSubviews] ()
#17 0x03055267 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] ()
#18 0x04a0281f in -[NSObject performSelector:withObject:] ()
#19 0x023b12ea in -[CALayer layoutSublayers] ()
#20 0x023a50d4 in CA::Layer::layout_if_needed(CA::Transaction*) ()
#21 0x023a4f40 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) ()
#22 0x0230cae6 in CA::Context::commit_transaction(CA::Transaction*) ()
#23 0x0230de71 in CA::Transaction::commit() ()
#24 0x0230e544 in CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) ()
#25 0x05ecb4ce in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#26 0x05ecb41f in __CFRunLoopDoObservers ()
#27 0x05ea9344 in __CFRunLoopRun ()
#28 0x05ea8ac3 in CFRunLoopRunSpecific ()
#29 0x05ea88db in CFRunLoopRunInMode ()
#30 0x058939e2 in GSEventRunModal ()
#31 0x05893809 in GSEventRun ()
#32 0x02fead3b in UIApplicationMain ()
#33 0x000035f8 in main at /Users/dmueller39/Projects/ios-bloomberg/Bloomberg/main.mm:18
I had the debugger paused when I captured this. How do I print the value of self on frame #2?
You cannot print self simply by typing po self on stack frames that you do not have the source code for.
What you need to do is print the correct register.
See more information here:
http://www.clarkcox.com/blog/2009/02/04/inspecting-obj-c-parameters-in-gdb/
Make sure to select the correct architecture you are debugging on (i.e. if your binary is 32-bit, 64-bit, arm, simulator, etc).
Would
(lldb) frame select 2
(lldb) po self
work for you?

UITextField crashes on touch

Our ios application crashes when a UITextField with default type is touched.
There is another uitextfield which is numpad and it works okay.
The crash only occurs on ios 5.0.1 and ios 4.x works okay.
The UITextField is created with interface builder and I didn't add any delegates for it.
The project was created on 4.0.2 and I also tested the same project on 4.2.
If I create a new project and just put a UITextField in it there is no problem.
Somehow something in my project causes the UITextField to crash and I don't have any idea how to debug it.
The crash log is like following:
(gdb) bt
#0 0x33fa2fdc in CFRetain ()
#1 0x37991db6 in ___init_block_invoke_2 ()
#2 0x36c8e7ea in _dispatch_barrier_sync_f_invoke ()
#3 0x36c8e65a in dispatch_barrier_sync_f$VARIANT$up ()
#4 0x36c8e28e in dispatch_sync_f$VARIANT$up ()
#5 0x36c8e910 in dispatch_sync$VARIANT$up ()
#6 0x36c90576 in dispatch_once_f$VARIANT$up ()
#7 0x37992706 in CPLoggingAddCustomLogFile ()
#8 0x306ee658 in __MCLoggingInitialize_block_invoke_1 ()
#9 0x36c90576 in dispatch_once_f$VARIANT$up ()
#10 0x306ee6a4 in MCLoggingInitialize ()
#11 0x306ef060 in -[MCProfileConnection _init] ()
#12 0x306ef764 in +[MCProfileConnection sharedConnection] ()
#13 0x31758cce in _FTAreIDsEquivalent ()
#14 0x31758a46 in _FTAreIDsEquivalent ()
#15 0x317589c8 in _FTAreIDsEquivalent ()
#16 0x36c90576 in dispatch_once_f$VARIANT$up ()
#17 0x31758976 in _FTAreIDsEquivalent ()
#18 0x35026378 in GCC_except_table11 ()
#19 0x3504571c in _NSStringDescriptionForIMAVChatParticipantState ()
#20 0x350456a8 in _NSStringDescriptionForIMAVChatParticipantState ()
#21 0x36c90576 in dispatch_once_f$VARIANT$up ()
#22 0x35045656 in _NSStringDescriptionForIMAVChatParticipantState ()
#23 0x377931e2 in -[UIDictationController init] ()
#24 0x37793350 in +[UIDictationController sharedInstance] ()
#25 0x37793590 in +[UIDictationController fetchCurrentInputModeSupportsDictation] ()
#26 0x376b21d0 in -[UIKeyboardLayoutStar shouldShowDictationKey] ()
#27 0x374f4138 in -[UIKeyboardLayoutStar updateMoreAndInternationalKeys] ()
#28 0x374f206e in -[UIKeyboardLayoutStar setKeyplaneName:] ()
#29 0x374f0e62 in -[UIKeyboardLayoutStar showKeyboardType:appearance:orientation:withShift:] ()
#30 0x37481bc4 in -[UIKeyboardImpl updateLayout] ()
#31 0x37425f6a in -[UIKeyboardImpl setDelegate:force:] ()
#32 0x37407f22 in -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] ()
#33 0x37407c6e in -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] ()
#34 0x374077aa in -[UIResponder becomeFirstResponder] ()
#35 0x37505d76 in -[UITextInteractionAssistant setFirstResponderIfNecessary] ()
#36 0x37505640 in -[UITextInteractionAssistant oneFingerTap:] ()
#37 0x37504f06 in _UIGestureRecognizerSendActions ()
#38 0x37496c1c in -[UIGestureRecognizer _updateGestureWithEvent:] ()
#39 0x376c2508 in ___UIGestureRecognizerUpdate_block_invoke_0541 ()
#40 0x37411d68 in _UIGestureRecognizerApplyBlocksToArray ()
#41 0x374108b6 in _UIGestureRecognizerUpdate ()
#42 0x3741d3cc in _UIGestureRecognizerUpdateGesturesFromSendEvent ()
#43 0x3741d20e in -[UIWindow _sendGesturesForEvent:] ()
#44 0x3741cddc in -[UIWindow sendEvent:] ()
#45 0x374034ec in -[UIApplication sendEvent:] ()
#46 0x37402d2c in _UIApplicationHandleEvent ()
#47 0x30835df2 in PurpleEventCallback ()
#48 0x3402e552 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#49 0x3402e4f4 in __CFRunLoopDoSource1 ()
#50 0x3402d342 in __CFRunLoopRun ()
#51 0x33fb04dc in CFRunLoopRunSpecific ()
#52 0x33fb03a4 in CFRunLoopRunInMode ()
#53 0x30834fcc in GSEventRunModal ()
#54 0x37431742 in UIApplicationMain ()
#55 0x00002462 in main (argc=1, argv=0x2fdffb04) at /Users/xxxx/Desktop/ios5/
Change "Product Name"
I had exactly same problem. I've solved it with changing "Product Name" property on build settings of target. Looks like having Non-USA characters, special characters like "ü, ğ, ç" etc. masses up your application.
I've absolutely no idea why this creates a problem such. But making product name something like "Ocu" instead of "Öcü" fixes it.
I found about this information on another question's answer and here is the link.
Make sure in interface builder that the UITextField does not have any current outlets. It's a common mishap to duplicate existing UITextFields and not realize that they were previously linked to other outlets or making references to things that are no longer there.

Strange behavior with inApp purchases

I've got a very strange problem recently. I have a code which processes inApp purchases in my app. I haven't changed anything in the code for month and this week I got a crash when calling the following method:
//
// call this before making a purchase
//
- (BOOL)canMakePurchases
{return [SKPaymentQueue canMakePayments];
}
I've tried to perform bt command in gdb and got following:
#0 0x33adffdc in CFRetain ()
#1 0x31f5bdb6 in ___init_block_invoke_2 ()
#2 0x36e797ea in _dispatch_barrier_sync_f_invoke ()
#3 0x36e7965a in dispatch_barrier_sync_f$VARIANT$up ()
#4 0x36e7928e in dispatch_sync_f$VARIANT$up ()
#5 0x36e79910 in dispatch_sync$VARIANT$up ()
#6 0x36e7b576 in dispatch_once_f$VARIANT$up ()
#7 0x31f5c706 in CPLoggingAddCustomLogFile ()
#8 0x320a2658 in __MCLoggingInitialize_block_invoke_1 ()
#9 0x36e7b576 in dispatch_once_f$VARIANT$up ()
#10 0x320a26a4 in MCLoggingInitialize ()
#11 0x320a3060 in -[MCProfileConnection _init] ()
#12 0x320a3764 in +[MCProfileConnection sharedConnection] ()
#13 0x31750764 in +[SKPaymentQueue canMakePayments] ()
#14 0x00037702 in -[InAppPay canMakePurchases] (self=0x44b1a0, _cmd=0x149c1e) at /Users/lowfreq/Desktop/Projects/magazinereader/Archive/InAppPay.m:32
#15 0x00039444 in -[PreViewArchives Tap:] (self=0x46aba0, _cmd=0x149d03, sender=0x46f030) at /Users/lowfreq/Desktop/Projects/magazinereader/Archive/PreViewArchives.m:161
#16 0x33af1434 in -[NSObject performSelector:withObject:withObject:] ()
#17 0x34c1f9ea in -[UIApplication sendAction:to:from:forEvent:] ()
#18 0x34c1f9a6 in -[UIApplication sendAction:toTarget:fromSender:forEvent:] ()
#19 0x34c1f984 in -[UIControl sendAction:to:forEvent:] ()
#20 0x34c1f6f4 in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
#21 0x34c2002c in -[UIControl touchesEnded:withEvent:] ()
#22 0x34c1e50e in -[UIWindow _sendTouchesForEvent:] ()
#23 0x34c1df00 in -[UIWindow sendEvent:] ()
#24 0x34c044ec in -[UIApplication sendEvent:] ()
#25 0x34c03d2c in _UIApplicationHandleEvent ()
#26 0x3572edf2 in PurpleEventCallback ()
#27 0x33b6b552 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#28 0x33b6b4f4 in __CFRunLoopDoSource1 ()
#29 0x33b6a342 in __CFRunLoopRun ()
#30 0x33aed4dc in CFRunLoopRunSpecific ()
#31 0x33aed3a4 in CFRunLoopRunInMode ()
#32 0x3572dfcc in GSEventRunModal ()
#33 0x34c32742 in UIApplicationMain ()
#34 0x00002364 in main (argc=1, argv=0x2fdffb38) at /Users/lowfreq/Desktop/Projects/magazinereader/main.m:14
Current language: auto; currently objective-c
What's going on? I can't understand the reason why the code which worked for month without any problem now giving me a crash?
I've tried to rebuild provisioning profiles from scratch, reset my iPad but still no luck
Thanks in advance for any clues!
since you are trying for SKPaymentQueue canMakePayments try both in device and simulator.. if it crashes in both.. then it got to be code error..then post the code.

iOS iPad GUI deadlock on startup. Hung on splash screen

My iPad app hangs on startup sometimes. It looks like the main thread is getting deadlocked with another thread but not sure why. Any ideas on what's causing this and how to debug this?
FYI my app starts as a splitview controller with a listview on the left and a webview on the right. If I start in portrait mode with the list view hidden the problem doesn't occur. Also, if I disable renderig of my cell when not on the main thread the app doesn't hang but the cells appear as black rectangles.
Thanks!
Here's my main thread. All of the code on this stack is Apple framework...
#0 0x971c0142 in semaphore_wait_signal_trap ()
#1 0x971c5c06 in pthread_mutex_lock ()
#2 0x02685903 in CGFontCacheLock ()
#3 0x02685869 in CGGlyphLockLockGlyphBitmaps ()
#4 0x0a90bb5b in ripc_RenderGlyphs ()
#5 0x0a9199f8 in ripc_DrawGlyphs ()
#6 0x0268464c in draw_glyphs ()
#7 0x02683e97 in CGContextShowGlyphsWithAdvances ()
#8 0x035aafba in WebCore::Font::drawGlyphs ()
#9 0x035aaaf5 in WebCore::Font::drawGlyphBuffer ()
#10 0x035aa81a in WebCore::Font::drawSimpleText ()
#11 0x035aa4c0 in drawAtPoint ()
#12 0x035a9d5c in -[NSString(WebStringDrawing) _web_drawAtPoint:forWidth:withFont:ellipsis:letterSpacing:includeEmoji:] ()
#13 0x0043f632 in -[NSString(UIStringDrawing) drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:] ()
#14 0x0043f325 in -[NSString(UIStringDrawing) drawAtPoint:forWidth:withFont:lineBreakMode:] ()
#15 0x0055ba70 in -[UILabel _drawTextInRect:baselineCalculationOnly:] ()
#16 0x00559178 in -[UILabel drawTextInRect:] ()
#17 0x0045418f in -[UIView(CALayerDelegate) drawLayer:inContext:] ()
#18 0x02a708d2 in -[CALayer drawInContext:] ()
#19 0x02a704b0 in backing_callback ()
#20 0x02a6fd52 in CABackingStoreUpdate ()
#21 0x02a6f01d in -[CALayer _display] ()
#22 0x02a6eac7 in CALayerDisplayIfNeeded ()
#23 0x02a609e1 in CA::Context::commit_transaction ()
#24 0x02a60732 in CA::Transaction::commit ()
#25 0x00427556 in -[UIApplication _reportAppLaunchFinished] ()
#26 0x0042dd3e in -[UIApplication handleEvent:withNewEvent:] ()
#27 0x004294f7 in -[UIApplication sendEvent:] ()
#28 0x004311d8 in _UIApplicationHandleEvent ()
#29 0x033f817c in PurpleEventCallback ()
#30 0x02bec89c in CFRunLoopRunSpecific ()
#31 0x02beb8a8 in CFRunLoopRunInMode ()
#32 0x00427221 in -[UIApplication _run] ()
#33 0x0042f372 in UIApplicationMain ()
And another thread rendering a cell in my list view. MyFancyPantsCell & ABTableViewCellView are my classes.
#0 0x971c0142 in semaphore_wait_signal_trap ()
#1 0x971c5c06 in pthread_mutex_lock ()
#2 0x02685903 in CGFontCacheLock ()
#3 0x02685869 in CGGlyphLockLockGlyphBitmaps ()
#4 0x0a90bb5b in ripc_RenderGlyphs ()
#5 0x0a9199f8 in ripc_DrawGlyphs ()
#6 0x0268464c in draw_glyphs ()
#7 0x02683e97 in CGContextShowGlyphsWithAdvances ()
#8 0x035aafba in WebCore::Font::drawGlyphs ()
#9 0x035aaaf5 in WebCore::Font::drawGlyphBuffer ()
#10 0x035aa81a in WebCore::Font::drawSimpleText ()
#11 0x035aa4c0 in drawAtPoint ()
#12 0x035a9d5c in -[NSString(WebStringDrawing) _web_drawAtPoint:forWidth:withFont:ellipsis:letterSpacing:includeEmoji:] ()
#13 0x0043f632 in -[NSString(UIStringDrawing) drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:] ()
#14 0x0043f381 in -[NSString(UIStringDrawing) drawAtPoint:withFont:] ()
#15 0x000635ec in -[SymbolCellPainter drawContentView:selected:editing:frame:]
#16 0x000452d0 in -[MyFancyPantsCell drawContentView:]
#17 0x00044624 in -[ABTableViewCellView drawRect:]
#18 0x0045418f in -[UIView(CALayerDelegate) drawLayer:inContext:] ()
#19 0x02a708d2 in -[CALayer drawInContext:] ()
#20 0x02a704b0 in backing_callback ()
#21 0x02a6fd52 in CABackingStoreUpdate ()
#22 0x02a6f01d in -[CALayer _display] ()
#23 0x02a6eac7 in CALayerDisplayIfNeeded ()
#24 0x02a609e1 in CA::Context::commit_transaction ()
#25 0x02a60732 in CA::Transaction::commit ()
#26 0x02a9e04f in CA::Transaction::release_thread ()
#27 0x971f61e3 in _pthread_tsd_cleanup ()
#28 0x971f5df6 in _pthread_exit ()
#29 0x00183bf2 in +[NSThread exit] ()
#30 0x00183b5b in __NSThread__main__ ()
#31 0x971ed81d in _pthread_start ()
#32 0x971ed6a2 in thread_start ()
I looks like you've created another thread, e.g. via [object performSelectorInBackground:#selector(foo) withObject:bar]. And in that thread you call GUI methods. You should call the GUI methods with [object performSelectorOnMainThread:#selector(alpha) withObject:beta waitUntilDone:YES] (maybe create another method that just contains the GUI methods and call that one this way instead of doing 20 performSelectorOnMainThreads).
All GUI methods should run on the main thread.
Are you using CATransitions somewhere in your code ?
Core Animation supports two types of transactions: implicit transactions and explicit transactions. Implicit transactions are created automatically when the layer tree is modified by a thread without an active transaction and are committed automatically when the thread's run-loop next iterates. Explicit transactions occur when the the application sends the CATransaction class a begin message before modifying the layer tree, and a commit message afterwards.
It seems that implicit transactions can fire in background threads calling drawRect from there.
If there's some drawing going on in the main thread at the same time - you're in trouble.
In this case, [CATransaction begin] / [CATransaction commit] MAY help.

ASIHTTPRequest crash in ASIInputStream forwardInvocation:

Does somebody else has randomly seen crashes in ASIInputStream forwardInvocation: during the use of ASIFormDataRequest? (the request was startAsynchronous)
Here is the backtrace:
#0 0x95877b83 in CFRunLoopSourceSignal ()
#1 0x958daa45 in _CFStreamScheduleWithRunLoop ()
#2 0x9588d05d in __invoking___ ()
#3 0x9588cfc8 in -[NSInvocation invoke] ()
#4 0x958c8f28 in -[NSInvocation invokeWithTarget:] ()
#5 0x0001d7ee in -[ASIInputStream forwardInvocation:] (self=0x228d40, _cmd=0x972d80c0, anInvocation=0x225a70) at /Users/catlan/Projekte/TBU/ASIInputStream.m:75
#6 0x9588de54 in ___forwarding___ ()
#7 0x9588d982 in __forwarding_prep_0___ ()
#8 0x958da8f8 in CFReadStreamScheduleWithRunLoop ()
#9 0x958daa26 in _CFStreamScheduleWithRunLoop ()
#10 0x958daa26 in _CFStreamScheduleWithRunLoop ()
#11 0x00015d4d in -[ASIHTTPRequest scheduleReadStream] (self=0x2318e0, _cmd=0x23490) at /Users/catlan/Projekte/TBU/ASIHTTPRequest.m:2608
#12 0x0000de97 in -[ASIHTTPRequest startRequest] (self=0x2318e0, _cmd=0x23827) at /Users/catlan/Projekte/TBU/ASIHTTPRequest.m:1005
#13 0x0000b56c in -[ASIHTTPRequest main] (self=0x2318e0, _cmd=0x973cfd56) at /Users/catlan/Projekte/TBU/ASIHTTPRequest.m:624
#14 0x0000b0a8 in -[ASIHTTPRequest startAsynchronous] (self=0x2318e0, _cmd=0x2136e) at /Users/catlan/Projekte/TBU/ASIHTTPRequest.m:546
#15 0x00004b0f in -[TBUploadWindowController requestUserInfo] (self=0x2f09e10, _cmd=0x205ed) at /Users/catlan/Projekte/TBU/TBUploadWindowController.m:119
#16 0x92591ad9 in __NSFireDelayedPerform ()
#17 0x95851edb in __CFRunLoopRun ()
#18 0x9584f864 in CFRunLoopRunSpecific ()
#19 0x9584f691 in CFRunLoopRunInMode ()
#20 0x908fdf6c in RunCurrentEventLoopInMode ()
#21 0x908fdd23 in ReceiveNextEventCommon ()
#22 0x908fdba8 in BlockUntilNextEventMatchingListInMode ()
#23 0x96b4eac5 in _DPSNextEvent ()
#24 0x96b4e306 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#25 0x96b1049f in -[NSApplication run] ()
#26 0x96b08535 in NSApplicationMain ()
#27 0x00002c8c in main (argc=1, argv=0xbffff858) at /Users/catlan/Projekte/TBU/main.m:13
Any idea on how to debug this?
This sounds like a bug in ASIHTTPRequest I fixed earlier today, so grab a new copy and hopefully that will resolve the problem.
My apologies to everyone who got caught by this. Clearly, I need more tests! ;)
I can confirm that rel. 1.6 fixes this problem. I had it also (strangely, it was working perfectly in the simulator but crashing on the device) and this new version fixes it.
Thanks to the developers for the fix (other than the whole package!) and to catlan for reporting the problem.