如何找出我的应用程序在 UIPasteboard 内收到 SIGKILLed 的原因?

发布于 2024-12-18 14:00:24 字数 1325 浏览 4 评论 0原文

极少数情况下,我们的应用程序会因为收到 SIGKILL 而崩溃。情况不同,但回溯总是相同的:

#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 ()

我将如何找出导致此崩溃的原因?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七七 2024-12-25 14:00:24

对于任何类型的异常,SIGKILL 都会发送到应用程序。因此,我们必须做出有根据的猜测,在这种情况下异常原因是什么。在上面的情况下,看起来可访问性正在检查是否存在某种类型的粘贴板类型。

由于这种情况发生在 Apple 代码中,很可能这是 iOS 中的一个错误,因为 containsPasteboardTypes: 方法永远不应该抛出异常。仅当传递的参数为 nil 时才可能出现这种情况,但错误将出现在 UIAccessibilityTextFieldElement 中,这也是 Apple 的责任。

长话短说:您需要提交雷达。作为解决方法,您可以在有问题的操作周围添加 @try 块。这将捕获并忽略异常。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文