Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find out why my app is getting SIGKILLed inside UIPasteboard?

Very infrequently, our app is crashing because it receives SIGKILL. The circumstances are different, but the backtrace is always the same:

#0  0x94a00afa in mach_msg_trap ()
#1  0x94a01267 in mach_msg ()
#2  0x00fa9d5c in _UIPasteboardServerContainsTypesAtIndex ()
#3  0x00faa9ae in UIPasteboardServerContainsTypesAtIndex ()
#4  0x00fa5417 in -[UIPasteboard containsPasteboardTypes:] ()
#5  0x00de4054 in -[UITextField canPerformAction:withSender:] ()
#6  0x087038a8 in -[UIResponder(UITextAccessibilityUtilities) _accessibilityHasTextOperations] ()
#7  0x08704df5 in -[UIAccessibilityTextFieldElement _accessibilityHasTextOperations] ()
#8  0x08791dcf in -[NSObject(AXPrivCategory) accessibilityAttributeValue:] ()
#9  0x0878a3b4 in _copyMultipleAttributeValuesCallback ()
#10 0x087c5c95 in _AXXMIGCopyMultipleAttributeValues ()
#11 0x087c0a6c in _XCopyMultipleAttributeValues ()
#12 0x087c8e66 in mshMIGPerform ()
#13 0x020cf1c5 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#14 0x02034022 in __CFRunLoopDoSource1 ()
#15 0x0203290a in __CFRunLoopRun ()
#16 0x02031db4 in CFRunLoopRunSpecific ()
#17 0x02031ccb in CFRunLoopRunInMode ()
#18 0x02a43879 in GSEventRunModal ()
#19 0x02a4393e in GSEventRun ()
#20 0x00d2ba9b in UIApplicationMain ()
#21 0x0000284d in main (argc=1, argv=0xbfffed44) at [myapp]/main.m:14
#22 0x000027c5 in start ()

How would I go about finding out what is causing this crash?

like image 650
Simon Avatar asked Nov 29 '11 13:11

Simon


1 Answers

The SIGKILL is sent to apps for any kind of exceptions. Se we have to make an educated guess what the exception reason would be in this case. In the above case it looks like accessibility is checking for a certain kind of pasteboard type to be present.

Since this is happening in Apple code most likely this is a bug in iOS, because the containsPasteboardTypes: method should never throw an exception. Only possibly if the passed parameter is nil, but then the bug would lie in UIAccessibilityTextFieldElement which too is Apple's responsibility.

Long story short: you need to file a radar. As a workaround you can add an @try block around the offending operation. This would catch and ignore the exception.

like image 57
Cocoanetics Avatar answered Nov 12 '22 22:11

Cocoanetics