Repository: flutter
Issue: iOS Flutter 2.10.3 got crash because of EXC_BAD_ACCESS KERN_INVALID_ADDRESS
Labels: c: crash,platform-ios,engine,a: accessibility,a: production,P2,team-ios,triaged-ios

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. 67% of this crash happens when app is in foreground.
2. The crash got reported to Firebase console.
3. I havn't found a way to reproduce it.

**Expected results:** <!-- what did you want to see? -->

**Actual results:** <!-- what did you see? -->
```
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010
Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x1540 objc_msgSend + 32
1  Flutter                        0x37504 (missing UUID be105c8b7c053a8ba51f83e291732357)
2  Flutter                        0x3664c (missing UUID be105c8b7c053a8ba51f83e291732357)
3  Flutter                        0x41ff4 (missing UUID be105c8b7c053a8ba51f83e291732357)
4  Flutter                        0x3d42f0 (missing UUID be105c8b7c053a8ba51f83e291732357)
5  Flutter                        0x2fbbf0 (missing UUID be105c8b7c053a8ba51f83e291732357)
6  Flutter                        0x2ff1bc (missing UUID be105c8b7c053a8ba51f83e291732357)
7  CoreFoundation                 0xae318 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
8  CoreFoundation                 0x32cf0 __CFRunLoopDoTimer + 1076
9  CoreFoundation                 0x2d4ec __CFRunLoopDoTimers + 328
10 CoreFoundation                 0xbd08 __CFRunLoopRun + 1944
11 CoreFoundation                 0x1f468 CFRunLoopRunSpecific + 600
12 GraphicsServices               0x138c GSEventRunModal + 164
13 UIKitCore                      0x5195d0 -[UIApplication _run] + 1100
14 UIKitCore                      0x297f74 UIApplicationMain + 364
15 Runner                         0x7ca8 main + 10 (main.swift:10)
16 ???                            0x1017c1aa4 (missing)
```
<details>
<summary>Code sample</summary>

<!--
      Please create a minimal reproducible sample that shows the problem
      and attach it below between the lines with the backticks.

      To create it you can use `flutter create bug` command and update the `main.dart` file.

      Alternatively, you can use https://dartpad.dev/
      which is capable of creating and running small Flutter apps.

      Without this we will unlikely be able to progress on the issue, and because of that
      we regretfully will have to close it.
-->

```dart
```

</details>

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010
Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x1540 objc_msgSend + 32
1  Flutter                        0x37504 (missing UUID be105c8b7c053a8ba51f83e291732357)
2  Flutter                        0x3664c (missing UUID be105c8b7c053a8ba51f83e291732357)
3  Flutter                        0x41ff4 (missing UUID be105c8b7c053a8ba51f83e291732357)
4  Flutter                        0x3d42f0 (missing UUID be105c8b7c053a8ba51f83e291732357)
5  Flutter                        0x2fbbf0 (missing UUID be105c8b7c053a8ba51f83e291732357)
6  Flutter                        0x2ff1bc (missing UUID be105c8b7c053a8ba51f83e291732357)
7  CoreFoundation                 0xae318 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
8  CoreFoundation                 0x32cf0 __CFRunLoopDoTimer + 1076
9  CoreFoundation                 0x2d4ec __CFRunLoopDoTimers + 328
10 CoreFoundation                 0xbd08 __CFRunLoopRun + 1944
11 CoreFoundation                 0x1f468 CFRunLoopRunSpecific + 600
12 GraphicsServices               0x138c GSEventRunModal + 164
13 UIKitCore                      0x5195d0 -[UIApplication _run] + 1100
14 UIKitCore                      0x297f74 UIApplicationMain + 364
15 Runner                         0x7ca8 main + 10 (main.swift:10)
16 ???                            0x1017c1aa4 (missing)
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.10.3, on macOS 11.6 20G165 darwin-arm, locale
    zh-Hans-CN)
    • Flutter version 2.10.3 at /Users/Shared/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e9793dee1 (5 weeks ago), 2022-03-02 11:23:12 -0600
    • Engine revision bd539267b4
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/blake/Library/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • ANDROID_HOME = /Users/blake/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.63.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.75

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->