Skip to content

crash with image that is larger than _maximumSizeBytes from image_cache.dart #19345

@SteveAlexander

Description

@SteveAlexander

Steps to Reproduce

  1. clone https://github.com/SteveAlexander/flutter_issue
  2. run in an iPhone simulator
  3. see that there's a busy loop continually reloading the PNG asset until it crashes

I think what's going on is, in painting/image_cache.dart, a decoded image that is larger than _maximumSizeBytes gets evicted from the cache as soon as it is put in there, and this somehow causes the asset to be continually reloaded from the device.

Logs

See https://gist.github.com/SteveAlexander/44243bd32462249567f88ba346ecbbd3

$ flutter analyze
Analyzing flutter_issue...
No issues found! (ran in 2.3s)
$ flutter doctor -v
[✓] Flutter (Channel dev, v0.5.6, on Mac OS X 10.13.5 17F77, locale en-GB)
    • Flutter version 0.5.6 at /Users/steve/code/flutter
    • Framework revision 472bbccf75 (2 weeks ago), 2018-06-26 17:01:46 -0700
    • Engine revision 6fe748490d
    • Dart version 2.0.0-dev.63.0.flutter-4c9689c1d2

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at /Users/steve/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

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

[✓] Connected devices (1 available)
    • iPhone X • 9655AB90-1BE3-43D8-B65C-937C0D5F86E7 • ios • iOS 11.4 (simulator)

• No issues found!

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions