flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
163.65k stars 26.91k forks source link

[Impeller] iOS crashes on some devices using impeller #150183

Closed TimBaumgart closed 5 days ago

TimBaumgart commented 1 month ago

Steps to reproduce

Unable to reproduce because it only happens on iPhone 13 and newer with mostly iOS 17. It happens for approx. 5% of my users.

Expected results

App should not crash

Actual results

App crashed for 5% of my users. All users are using iOS devices (iPhone 13-15) with mostly iOS 17.

See the crashlytics report below for more details.

This is the same issue as mentioned here: https://github.com/flutter/flutter/issues/144594

My crash log shows some more details, so I thought to file a new issue. @jonahwilliams

Code sample

Code sample ```dart [Paste your code here] ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs ```console Crashed: io.flutter.1.ui 0 libsystem_kernel.dylib 0xc42c __pthread_kill + 8 1 libsystem_pthread.dylib 0x7c0c pthread_kill + 268 2 libsystem_c.dylib 0x75ba0 abort + 180 3 Flutter 0x5d2250 InternalFlutterGpu_Texture_AsImage + 50988 4 Flutter 0x6ac8d0 InternalFlutterGpu_Texture_AsImage + 945580 5 Flutter 0x616968 InternalFlutterGpu_Texture_AsImage + 331332 6 Flutter 0x671b3c InternalFlutterGpu_Texture_AsImage + 704536 7 Flutter 0x5e434c InternalFlutterGpu_Texture_AsImage + 124968 8 Flutter 0x6280a8 InternalFlutterGpu_Texture_AsImage + 402820 9 App 0xbef0 stub CallBootstrapNative + 32496 10 App 0x2f9a0 SendPort._sendInternal + 250 (isolate_patch.dart:250) 11 App 0x2cfec IOService._dispatch + 231 (isolate_patch.dart:231) 12 App 0x6fa014 RawSecureSocket._pushAllFilterStages + 1145 (secure_socket.dart:1145) 13 App 0x6f96fc RawSecureSocket._tryFilter + 1006 (secure_socket.dart:1006) 14 App 0x6f9674 RawSecureSocket._scheduleFilter + 989 (secure_socket.dart:989) 15 App 0x6f9618 RawSecureSocket._secureHandshake + 928 (secure_socket.dart:928) 16 App 0x87fa48 SuspendState._createAsyncStarCallback. + 384 (async_patch.dart:384) 17 App 0x7453c FutureListener.handleValue + 1662 (zone.dart:1662) 18 App 0x743d8 Future._propagateToListeners.handleValueCallback + 849 (future_impl.dart:849) 19 App 0x121ac Future._propagateToListeners + 880 (future_impl.dart:880) 20 App 0x11e34 Future._completeWithValue + 647 (future_impl.dart:647) 21 App 0x11da8 Future._asyncCompleteWithValue. + 721 (future_impl.dart:721) 22 App 0x11c04 microtaskLoop + 34 (schedule_microtask.dart:34) 23 App 0x11b04 startMicrotaskLoop (#2) + 54 (schedule_microtask.dart:54) 24 App 0x11ac8 startMicrotaskLoop + 44 (schedule_microtask.dart:44) 25 App 0xbbf8 stub InvokeDartCode + 31736 26 Flutter 0x6054a4 InternalFlutterGpu_Texture_AsImage + 260480 27 Flutter 0x71d044 InternalFlutterGpu_Texture_AsImage + 1406240 28 Flutter 0x41c23c (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c) 29 Flutter 0x2eb710 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c) 30 Flutter 0x2ee9f4 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c) 31 CoreFoundation 0xb7a2c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32 32 CoreFoundation 0xb76d0 __CFRunLoopDoTimer + 1004 33 CoreFoundation 0xb722c __CFRunLoopDoTimers + 288 34 CoreFoundation 0x53888 __CFRunLoopRun + 1856 35 CoreFoundation 0x52cd8 CFRunLoopRunSpecific + 608 36 Flutter 0x2eeae0 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c) 37 Flutter 0x2ee728 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c) 38 Flutter 0x2ee438 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c) 39 libsystem_pthread.dylib 0x606c _pthread_start + 136 40 libsystem_pthread.dylib 0x10d8 thread_start + 8 ```

Flutter Doctor output

Doctor output ```console [√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.22631.3593], locale de-DE) • Flutter version 3.22.2 on channel stable at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 761747bfc5 (8 days ago), 2024-06-05 22:15:13 +0200 • Engine revision edd8546116 • Dart version 3.4.3 • DevTools version 2.34.3 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\TimBa\AppData\Local\Android\sdk • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.10+0--11572160) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.27) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools • Visual Studio Build Tools 2019 version 16.11.33801.447 • Windows 10 SDK version 10.0.19041.0 [!] Android Studio (version 2022.2) • Android Studio at C:\Program Files\Android\Android Studio • 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 X Unable to determine bundled Java version. • Try updating or re-installing Android Studio. [√] Android Studio (version 2023.3) • Android Studio at C:\Program Files\Android\Android Studio1 • 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 17.0.10+0--11572160) [√] VS Code (version 1.90.0) • VS Code at C:\Users\TimBa\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.90.0 [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3593] • Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142 • Edge (web) • edge • web-javascript • Microsoft Edge 125.0.2535.67 [√] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. ```
darshankawar commented 1 month ago
Flutter                        0x41c23c (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c)
29 Flutter                        0x2eb710 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c)
30 Flutter                        0x2ee9f4 (Fehlt UUID 4c4c44aa55553144a1b885a3aa65815c)

Even though there are more entries, but they are missing Flutter frames, so this also essentially becomes same issue as you linked.

https://github.com/flutter/flutter/issues/146708 also mentions same stacktrace for which It seems to be similar / related to https://github.com/flutter/flutter/issues/144594. If you could provide us reproducible code or missing Flutter frames, then we can make it actionable.

TimBaumgart commented 1 month ago

I have not located where the issue comes from exactly, so I cannot provide reproducible code right now. I will try my best to find that out and also get the missing stack trace entries.

percula commented 3 weeks ago

@TimBaumgart do you use Lottie? I have a similar stacktrace and the crash only occurs on iPads. Coincidentally, I only show the lottie animation on larger screens, so that's my hunch.

TimBaumgart commented 3 weeks ago

@TimBaumgart do you use Lottie? I have a similar stacktrace and the crash only occurs on iPads. Coincidentally, I only show the lottie animation on larger screens, so that's my hunch.

No, I do not use Lottie in my app.

percula commented 3 weeks ago

@TimBaumgart I ended up finding the culprit in my app. It was an SVG image. After using SVGO to optimize the SVG, the error went away. Hope this helps in your case 🙂.

percula commented 3 weeks ago

@darshankawar I've uploaded a minimum repo of my issue here: https://github.com/percula/impeller_svg_issue

Simply change line 93 of main.dart from:

        child: SvgPicture.asset("assets/images/gardening_background_shed.svg")

to

        child: SvgPicture.asset("assets/images/gardening_background_shed.min.svg")

where the first causes the impeller issue and the second one does not. This same SVG worked in previous Flutter versions.

bigbang489 commented 3 weeks ago

I am having the same issue, the app crash with some SVGs. When I disable the impeller, the issue disappeared.

darshankawar commented 3 weeks ago

Thanks for the updates. Maybe related to https://github.com/flutter/flutter/issues/149309 which has been fixed in master, so @percula and @bigbang489 please switch to latest master and re-run your scenario to confirm.

bigbang489 commented 3 weeks ago

Thanks for the updates. Maybe related to #149309 which has been fixed in master, so @percula and @bigbang489 please switch to latest master and re-run your scenario to confirm.

I confirm the issued was fixed in the master channel.

github-actions[bot] commented 5 days ago

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones. Thanks for your contribution.