Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] App crashes on wide-gamut indexed PNG decompression in Skia with wide-gamut enabled. #133013

Closed
2 tasks done
nerder opened this issue Aug 22, 2023 · 26 comments · Fixed by flutter/engine#45399
Closed
2 tasks done
Assignees
Labels
a: images Loading, displaying, rendering images c: fatal crash Crashes that terminate the process dependency: skia Skia team may need to help us e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. found in release: 3.13 Found to occur in 3.13 found in release: 3.14 Found to occur in 3.14 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version team-engine Owned by Engine team triaged-engine Triaged by Engine team waiting for PR to land (fixed) A fix is in flight

Comments

@nerder
Copy link

nerder commented Aug 22, 2023

Is there an existing issue for this?

Steps to reproduce

Simply running an app that contains an AssetImage containing a large image (~1MB) causes the app to crash in IOS.

As per my logs, this is happening starting from v3.13.0.

Expected results

The app not to crash

Actual results

The app crashes

Code sample

I've reproduced the bug in this small repository: https://github.com/nerder/ios_crash_asset_image

NOTE: I've also added a compressed version of the same image which instead will work. I couldn't manage to find the exact number of bytes that an image needs to be to generate the crash.

Logs

Logs
(lldb) 2023-08-22 03:03:47.288767+0200 Runner[8957:3341508] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(37)] Using the Impeller rendering backend.
Warning: Unable to create restoration in progress marker file
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
Debug service listening on ws://127.0.0.1:53633/mepV6IrsO1k=/ws
Syncing files to device iPhone de XXX..
* thread #18, name = 'io.worker.6', stop reason = EXC_BAD_ACCESS (code=1, address=0x38)
    frame #0: 0x0000000104f27f5c Flutter`SkPngCodec::applyXformRow(void*, void const*) + 52
Flutter`SkPngCodec::applyXformRow:
->  0x104f27f5c <+52>: ldp    w5, w8, [x9, #0x38]
    0x104f27f60 <+56>: sxtw   x8, w8
    0x104f27f64 <+60>: add    x0, x19, x8
    0x104f27f68 <+64>: ldr    w8, [x9, #0x48]
Target 0: (Runner) stopped.
Lost connection to device.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.13.0, on macOS 13.3.1 22E772610a darwin-arm64, locale en-IT)
    • Flutter version 3.13.0 on channel stable at /Users/nerder/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision efbf63d9c6 (6 days ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/nerder/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/nerder/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10406996/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Android Studio (version 2022.2)
    • Android Studio at /Users/nerder/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.10121639/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 17.0.6+0-17.0.6b802.4-9586694)

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/nerder/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/223.8836.35.2231.10406996/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 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at /Users/nerder/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 74.0.4
    • Dart plugin version 231.9392.3

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at /Users/nerder/Library/Application
      Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/232.8660.185/IntelliJ IDEA.app
    • 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

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.5)
    • IntelliJ at /Users/nerder/Library/Application
      Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.9392.1/IntelliJ IDEA.app
    • 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

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4)
    • IntelliJ at /Users/nerder/Library/Application
      Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.9225.16/IntelliJ IDEA.app
    • 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

[✓] Connected device (1 available)
    • macOS (desktop)                 • macos                     • darwin-arm64 • macOS 13.3.1 22E772610a
      darwin-arm64

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@nerder nerder changed the title AssetImage makes IOS app crash when loading large image AssetImage makes IOS app crash when rendering a large image Aug 22, 2023
@dam-ease dam-ease added the in triage Presently being triaged by the triage team label Aug 22, 2023
@dam-ease
Copy link

Hi @nerder. Thanks for filing this. I'm unable to reproduce this on the latest master and stable channels. The image_crash.png loads without a crash. Also tried reproducing with another image of size 2.4 MB and still can't reproduce the crash.

file sizes Screenshot
Screenshot 2023-08-22 at 10 39 04

Can you provide more information on the reproduction steps and the device the crash occurs on?

stable, master flutter doctor -v

[✓] Flutter (Channel stable, 3.13.0, on macOS 13.0 22A380 darwin-arm64, locale
    en-NG)
    • Flutter version 3.13.0 on channel stable at
      /Users/damilolaalimi/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision efbf63d9c6 (6 days ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/damilolaalimi/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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
      17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.50.0

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        •
      android-arm64  • Android 14 (API 34) (emulator)
    • iPhone 8 (mobile)           • 218697C0-911E-4F4E-9568-C387ACB184ED • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)             • macos                                •
      darwin-arm64   • macOS 13.0 22A380 darwin-arm64
    • Chrome (web)                • chrome                               •
      web-javascript • Google Chrome 116.0.5845.96

[✓] Network resources
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.14.0-9.0.pre.27, on macOS 13.0 22A380 darwin-arm64, locale en-NG)
    • Flutter version 3.14.0-9.0.pre.27 on channel master at /Users/damilolaalimi/fvm/versions/master
    ! Warning: `flutter` on your path resolves to /Users/damilolaalimi/sdks/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/damilolaalimi/fvm/versions/master. Consider adding /Users/damilolaalimi/fvm/versions/master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/damilolaalimi/sdks/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/damilolaalimi/fvm/versions/master. Consider adding /Users/damilolaalimi/fvm/versions/master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e085e613c8 (74 minutes ago), 2023-08-22 02:58:24 -0400
    • Engine revision e183e8a940
    • Dart version 3.2.0 (build 3.2.0-94.0.dev)
    • DevTools version 2.26.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/damilolaalimi/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.50.0

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554                        • android-arm64  • Android 14 (API 34) (emulator)
    • iPhone 8 (mobile)           • 218697C0-911E-4F4E-9568-C387ACB184ED • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)             • macos                                • darwin-arm64   • macOS 13.0 22A380 darwin-arm64
    • Chrome (web)                • chrome                               • web-javascript • Google Chrome 116.0.5845.96

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 22, 2023
@nerder
Copy link
Author

nerder commented Aug 22, 2023

Hey @dam-ease, I was only able to reproduce it on a real device (Iphone 11), but since this was shipped in production we have logs from a variety of devices (ie: iPhone 14)

Since this is a memory issue I think it might be unlikely to be reproduced on the simulator, but I haven't tried tbh.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 22, 2023
@dam-ease
Copy link

dam-ease commented Aug 23, 2023

Hi @nerder. Thanks for your response. I tested with a real device and I am able to reproduce this issue on the latest master and stable channels. This seems to be peculiar to impeller as without impeller, this works fine and no crash occurs.

Code Sample

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
            image: DecorationImage(
          image: AssetImage(
            "assets/images/image_crash.png",
          ),
          fit: BoxFit.cover,
        )),
        child: Container(),
      ),
    );
  }
}

Log

* thread #15, name = 'io.worker.3', stop reason = EXC_BAD_ACCESS (code=1, address=0x38)
frame #0: 0x00000001036dbf5c Flutter`SkPngCodec::applyXformRow(void*, void const*) + 52
Flutter`SkPngCodec::applyXformRow:
-> 0x1036dbf5c <+52>: ldp w5, w8, [x9, #0x38]
0x1036dbf60 <+56>: sxtw x8, w8
0x1036dbf64 <+60>: add x0, x19, x8
0x1036dbf68 <+64>: ldr w8, [x9, #0x48]
Target 0: (Runner) stopped.
Lost connection to device.

stable, master flutter doctor -v

[✓] Flutter (Channel stable, 3.13.0, on macOS 13.0 22A380 darwin-arm64, locale
    en-NG)
    • Flutter version 3.13.0 on channel stable at
      /Users/damilolaalimi/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision efbf63d9c6 (7 days ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/damilolaalimi/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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
      17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.50.0

[✓] Connected device (4 available)
    • Damilola’s iPhone (mobile) • 71c843fa5f3dec767999f36224653c0faa78660e •
      ios            • iOS 16.6 20G75
    • iPhone 8 (mobile)          • 218697C0-911E-4F4E-9568-C387ACB184ED     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-arm64   • macOS 13.0 22A380 darwin-arm64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 116.0.5845.110

[✓] Network resources
    • All expected network resources are available.

• No issues found!
[✓] Flutter (Channel master, 3.14.0-9.0.pre.27, on macOS 13.0 22A380 darwin-arm64, locale en-NG)
    • Flutter version 3.14.0-9.0.pre.27 on channel master at /Users/damilolaalimi/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e085e613c8 (25 hours ago), 2023-08-22 02:58:24 -0400
    • Engine revision e183e8a940
    • Dart version 3.2.0 (build 3.2.0-94.0.dev)
    • DevTools version 2.26.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/damilolaalimi/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/damilolaalimi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • 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 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.50.0

[✓] Connected device (4 available)
    • Damilola’s iPhone (mobile) • 71c843fa5f3dec767999f36224653c0faa78660e • ios            • iOS 16.6 20G75
    • iPhone 8 (mobile)          • 218697C0-911E-4F4E-9568-C387ACB184ED     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                    • darwin-arm64   • macOS 13.0 22A380 darwin-arm64
    • Chrome (web)               • chrome                                   • web-javascript • Google Chrome 116.0.5845.110

[✓] Network resources
    • All expected network resources are available.

• No issues found!

@dam-ease dam-ease added platform-ios iOS applications specifically a: images Loading, displaying, rendering images has reproducible steps The issue has been confirmed reproducible and is ready to work on c: fatal crash Crashes that terminate the process e: impeller Impeller rendering backend issues and features requests team-ios Owned by iOS platform team found in release: 3.13 Found to occur in 3.13 found in release: 3.14 Found to occur in 3.14 and removed in triage Presently being triaged by the triage team labels Aug 23, 2023
@hyped0001
Copy link

hyped0001 commented Aug 24, 2023

Is it possible to increase priority on this issue? It can be dangerous since it doesn't normally occur on simulator, leading developers to believe they aren't effected. @dam-ease

@dam-ease
Copy link

Hi @hyped0001. The issue needs to be identified by the domain expert and the priority label follows. See https://github.com/flutter/flutter/wiki/Issue-hygiene#priorities for more information on this.
Thank you!

@chinmaygarde chinmaygarde removed the e: impeller Impeller rendering backend issues and features requests label Aug 25, 2023
@stuartmorgan
Copy link
Contributor

@chinmaygarde According to the repro above this is specific to impeller; is there a reason you removed the impeller label?

(Sending back to engine queue for triage, as is standard for impeller issues.)

@stuartmorgan stuartmorgan added team-engine Owned by Engine team and removed team-ios Owned by iOS platform team labels Aug 28, 2023
@chinmaygarde
Copy link
Member

The crash is in SkPngCodec::applyXformRow. The codecs are identical and hit before Impeller. My guess is that pngcrush (or whatever was used to compress the image) got rid of the problematic bits the decoder was having trouble with.

I do think this is an engine bug. Just not an Impeller one.

@TahaTesser TahaTesser added the engine flutter/engine repository. See also e: labels. label Aug 29, 2023
@romandrahan
Copy link

romandrahan commented Aug 30, 2023

confirming it's reproduced in https://github.com/nerder/ios_crash_asset_image on the real iPhone with both Flutter 3.13.0 and 3.13.1

though fine on 3.10.6 and 3.10.7

jason-simmons added a commit to jason-simmons/flutter_engine that referenced this issue Aug 31, 2023
Skia's PNG codec does not support wide gamut output formats for some
images (such as palette-based images)

See flutter/flutter#133013
@jason-simmons
Copy link
Member

This started when wide gamut support was enabled by default for iOS apps using Impeller.

ImageDecoderImpeller looks at the PNG asset's color space, determines that it is wide gamut, and selects kBGR_101010x_XR_SkColorType as the output format for decoding.

But Skia's PNG codec is unable to decode the image into that format because this PNG asset uses a palette. Specifically, SkSwizzler::Make can not create a swizzler for the combination of SkEncodedInfo::kPalette_Color input and kBGR_101010x_XR_SkColorType output.

For now, apps can work around this by disabling wide gamut using this entry in ios/Runner/Info.plist:

<key>FLTEnableWideGamut</key>
<false/>

Within the Flutter engine, we could work around this by disabling wide gamut when decoding PNG images. I've prototyped this at flutter/engine#45357

@gaaclarke

@jason-simmons jason-simmons added the dependency: skia Skia team may need to help us label Aug 31, 2023
@gaaclarke
Copy link
Member

Within the Flutter engine, we could work around this by disabling wide gamut when decoding PNG images. I've prototyped this at flutter/engine#45357

This sounds like an oversight in the Skia decoder that should be addressed. PNG files can definitely contain wide gamut content. So throwing them out would be throwing out the baby with the bath water. We had to implement that pixel format in Skia for this feature so we should fix it.

@chinmaygarde chinmaygarde added the triaged-engine Triaged by Engine team label Sep 5, 2023
@danagbemava-nc danagbemava-nc changed the title AssetImage makes IOS app crash when rendering a large image [iOS] app crashes when rendering a large image Sep 6, 2023
@danagbemava-nc
Copy link
Member

Updated title as this is not specific to asset images. See #134063

@chinmaygarde chinmaygarde changed the title [iOS] app crashes when rendering a large image [iOS] App crashes on encoding in Skia with wide-gamut enabled. Sep 6, 2023
@chinmaygarde chinmaygarde added e: impeller Impeller rendering backend issues and features requests waiting for PR to land (fixed) A fix is in flight labels Sep 6, 2023
@chinmaygarde chinmaygarde changed the title [iOS] App crashes on encoding in Skia with wide-gamut enabled. [iOS] App crashes on image decompression in Skia with wide-gamut enabled. Sep 6, 2023
@chinmaygarde chinmaygarde changed the title [iOS] App crashes on image decompression in Skia with wide-gamut enabled. [Impeller] App crashes on image decompression in Skia with wide-gamut enabled. Sep 6, 2023
@chinmaygarde
Copy link
Member

The compression side crash with wide-gamut is here #133942. I'll add a point of discussion for this in the weekly to figure out hot-fixes and such.

@gaaclarke gaaclarke changed the title [Impeller] App crashes on image decompression in Skia with wide-gamut enabled. [Impeller] App crashes on indexed PNG decompression in Skia with wide-gamut enabled. Sep 6, 2023
@gaaclarke gaaclarke changed the title [Impeller] App crashes on indexed PNG decompression in Skia with wide-gamut enabled. [Impeller] App crashes on wide-gamut indexed PNG decompression in Skia with wide-gamut enabled. Sep 6, 2023
@gaaclarke
Copy link
Member

I'll update the title one more time in the past 24 hours =). @chinmaygarde fyi this only effects decoding wide-gamut images PNG files that use indexed colors

@Livinglist
Copy link

Is this fix gonna be in 3.13.4?

@chinmaygarde
Copy link
Member

After taking into account the severity, workaround, and hot-fix window, the consensus was that this will not be cherry-picked into 3.13.

gaaclarke added a commit to flutter/engine that referenced this issue Sep 13, 2023
…ix for Skia. (#45399)

fixes flutter/flutter#133013
depends on skia fix:
https://skia-review.googlesource.com/c/skia/+/751696

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Sep 14, 2023
gaaclarke added a commit to gaaclarke/engine that referenced this issue Sep 20, 2023
…ix for Skia. (flutter#45399)

fixes flutter/flutter#133013
depends on skia fix:
https://skia-review.googlesource.com/c/skia/+/751696

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
@sarthakydv
Copy link

It was not included in 3.13.4 and 3.13.5 as well, when can we expect this to be released?

@LeoAiolia
Copy link

What are some temporary ways to solve it?

@SethuSenthil
Copy link

The update is out on stable now so flutter upgrade should be good enough :)

@LeoAiolia
Copy link

nice, flutter 3.13.6 is working fine

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: images Loading, displaying, rendering images c: fatal crash Crashes that terminate the process dependency: skia Skia team may need to help us e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. found in release: 3.13 Found to occur in 3.13 found in release: 3.14 Found to occur in 3.14 has reproducible steps The issue has been confirmed reproducible and is ready to work on P1 High-priority issues at the top of the work list platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version team-engine Owned by Engine team triaged-engine Triaged by Engine team waiting for PR to land (fixed) A fix is in flight
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.