简体   繁体   English

如何调试 Flutter iOS 崩溃

[英]How to debug Flutter iOS crash

We're getting some crashes back from our Testflight distribution of our flutter app.我们从我们的 Flutter 应用程序的 Testflight 发行版中得到了一些崩溃。 It's hard for us to pinpoint where exactly the problem lies since the crash log's don't tell us much.我们很难确定问题究竟出在哪里,因为崩溃日志并没有告诉我们太多。

Here's the log (gist of full crash log / Xcode screenshot ):这是日志(完整崩溃日志/ Xcode 屏幕截图的要点):

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000003b3801090
VM Region Info: 0x3b3801090 is not in any region.  Bytes after previous region: 4622127249  
      REGION TYPE                      START - END             [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC_NANO            0000000280000000-00000002a0000000 [512.0M] rw-/rwx SM=PRV  
--->  
      UNUSED SPACE AT END

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [4572]
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   libobjc.A.dylib                 0x000000018a902090 objc_msgSend + 16
1   Flutter                         0x00000001009d6f4c -[SemanticsObject hasChildren] + 60 (accessibility_bridge.mm:160)
2   Flutter                         0x00000001009d8334 -[SemanticsObject accessibilityContainer] + 36 (accessibility_bridge.mm:287)
3   UIAccessibility                 0x0000000195f88898 -[NSObject(AXPrivCategory) _accessibilityParentView] + 84 (NSObjectAccessibility.m:7787)
4   UIAccessibility                 0x0000000195f88734 -[NSObject(AXPrivCategory) _accessibilityWindow] + 92 (NSObjectAccessibility.m:7762)
5   UIAccessibility                 0x0000000195f8ff68 -[NSObject(AXPrivCategory) _accessibilityConvertSystemBoundedScreenRectToContextSpace:] + 48 (NSObjectAccessibility.m:10192)
6   UIAccessibility                 0x0000000195f83ee8 -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 4624 (NSObjectAccessibility.m:5303)
7   UIAccessibility                 0x0000000195f6637c _copyMultipleAttributeValuesCallback + 540 (UIAccessibilityRuntime.m:345)
8   AXRuntime                       0x0000000194fc56e0 ___AXXMIGCopyMultipleAttributeValues_block_invoke + 60 (AccessibilityPriv.m:1262)
9   AXRuntime                       0x0000000194fc5264 _handleNonMainThreadCallback + 60 (AccessibilityPriv.m:466)
10  AXRuntime                       0x0000000194fc5570 _AXXMIGCopyMultipleAttributeValues + 332 (AccessibilityPriv.m:1261)
11  AXRuntime                       0x0000000194fbf4b4 _XCopyMultipleAttributeValues + 392 (AccessibilityClientDefsServer.c:1354)
12  AXRuntime                       0x0000000194fd443c mshMIGPerform + 268 (MachServerHelper.c:447)
13  CoreFoundation                  0x000000018ab5d07c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1937)
14  CoreFoundation                  0x000000018ab5c7a8 __CFRunLoopDoSource1 + 444 (CFRunLoop.c:2075)
15  CoreFoundation                  0x000000018ab5767c __CFRunLoopRun + 2168 (CFRunLoop.c:3098)
16  CoreFoundation                  0x000000018ab56adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192)
17  GraphicsServices                0x0000000194adc328 GSEventRunModal + 104 (GSEvent.c:2246)
18  UIKitCore                       0x000000018ec51ae0 UIApplicationMain + 1936 (UIApplication.m:4773)
19  Runner                          0x0000000100666cec main + 96 (AppDelegate.swift:5)
20  libdyld.dylib                   0x000000018a9e0360 start + 4

We've tried to symbolicate the logs futher by following this guide https://github.com/flutter/flutter/wiki/Crashes .我们已经尝试通过遵循本指南https://github.com/flutter/flutter/wiki/Crashes进一步象征化日志。 Using these steps:使用这些步骤:

  • Get our flutter engine revision获取我们的颤振引擎修订版
  • Download the right dSYM file for our version of the Flutter.framework为我们的 Flutter.framework 版本下载正确的 dSYM 文件
  • Try to symbolicate with:尝试用以下符号表示:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

cp -i /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash ./

symbolicatecrash 2020-01-11.crash Flutter.dSYM > symbolicated.crash

But it did not really improve, see changes in this gist但它并没有真正改善,请参阅此要点中的更改

Any tips on where to start looking for the programming error that caused crashes like this.有关从何处开始查找导致此类崩溃的编程错误的任何提示。 We're looking for both tips on debugging internal flutter crashes in general and this specific case.我们正在寻找有关调试内部颤振崩溃的一般技巧和这种特殊情况的技巧。

Also, we're unable to reproduce this crash, since we don't know where to look.此外,我们无法重现这次崩溃,因为我们不知道去哪里寻找。

Accordingly to your crash report VM Region Info: 0x3b3801090 is not in any region.根据您的崩溃报告VM Region Info: 0x3b3801090 is not in any region. The crash probably happens because some memory not allocated is being accessed... This could be happening because ___AXXMIGCopyMultipleAttributeValues_block_invoke is being called from outside the main thread (looks like according to the stack trace).崩溃可能是因为正在访问一些未分配的内存......这可能是因为___AXXMIGCopyMultipleAttributeValues_block_invoke是从主线程外部调用的(看起来像根据堆栈跟踪)。 But I don't know if you can debug the lib AXRuntime.但是不知道能不能调试lib AXRuntime。

Have you tried to symbolicate the crash report with view logs window in xcode?您是否尝试过在 xcode 中使用查看日志窗口来表示崩溃报告? (you must have an physical iphone X (iphone10) so the architecture doesn't get lost in the middle of the process... This page may help. (你必须有一个物理的 iphone X (iphone10),所以架构不会在过程中丢失......这个页面可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM