title: How to debug Flutter iOS crash
body: <p>We're getting some crashes back from our Testflight distribution of our flutter app. It's hard for us to pinpoint where exactly the problem lies since the crash log's don't tell us much.</p>
  
  <p>Here's the log (<a href="https://gist.github.com/teameh/2088d9e11addbf9521828dbb308aee88" rel="nofollow noreferrer">gist of full crash log</a> / <a href="https://i.stack.imgur.com/f7jMy.png" rel="nofollow noreferrer">Xcode screenshot</a>):</p>
  
  <pre><code>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  
  ---&gt;  
        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
  </code></pre>
  
  <p>We've tried to symbolicate the logs futher by following this guide <a href="https://github.com/flutter/flutter/wiki/Crashes" rel="nofollow noreferrer">https://github.com/flutter/flutter/wiki/Crashes</a>. Using these steps: </p>
  
  <ul>
  <li>Get our flutter engine revision</li>
  <li>Download the right dSYM file for our version of the Flutter.framework</li>
  <li>Try to symbolicate with: </li>
  </ul>
  
  <pre><code>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 &gt; symbolicated.crash
  </code></pre>
  
  <p>But it did not really improve, see changes <a href="https://gist.github.com/teameh/a147d59f8ab51e87c97c5d30aa51d800/revisions" rel="nofollow noreferrer">in this gist</a></p>
  
  <p>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.</p>
  
  <p>Also, we’re unable to reproduce this crash, since we don’t know where to look.</p>