-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: regressionIt was better in the past than it is nowIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.27Found to occur in 3.27Found to occur in 3.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Steps to reproduce
Reproducible with flutter 3.27.1, introduced in commit fc01196
Not reproducible with parent commit e466195 and not reproducible on 3.24.5
- Run the sample app on an iOS physical device using Flutter version 3.27.1
- Pan down on the main page
- Tap on the next arrow to go to the next page in the sample app
- Move the app to the background by putting another app in the foreground
- Move the sample app back to the foreground
- Observe console errors
Exception: Image upload failed due to loss of GPU access.
related: #159397 and fluttercandies/extended_image#724
attempting to reproduce with a binary search on various flutter commits, the first commit introducing the issue is commit fc01196
note that today's master branch commit 2d17299 does not exhibit the issue
Expected results
Expected no exceptions
Actual results
After putting app in foreground after putting it in background, images in the UI fail to render with the following error to console:
Exception: Image upload failed due to loss of GPU access.
With an "All Exceptions" breakpoint I get the following stack trace:
MultiFrameImageStreamCompleter._decodeNextFrameAndSchedule (development/flutter/packages/flutter/lib/src/painting/image_stream.dart:1064)
<asynchronous gap> (Unknown Source:0)
Code sample
Sample app that loads several images
import 'package:extended_image/extended_image.dart';
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.blue),
useMaterial3: true,
),
debugShowCheckedModeBanner: false,
home: const MyHomePage(title: 'Loss of GPU Access Demo'),
);
}
}
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) {
final int imageWidth = MediaQuery.sizeOf(context).width.toInt();
final int imageHeight = 200;
final urls = List.generate(50, (i) {
return 'https://picsum.photos/seed/$i/$imageWidth/$imageHeight';
});
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
actions: [
IconButton(
icon: const Icon(Icons.navigate_next),
tooltip: 'Next',
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const SecondScreen()),
);
},
),
],
),
body: ListView.builder(
itemCount: urls.length,
// No error occurs when removing cacheExtent
cacheExtent: MediaQuery.sizeOf(context).height * 5,
itemBuilder: (context, index) {
if (index == 0) {
return Wrap(
children: [
Text(
'To reproduce: Scroll down, then use the next button, then put app in background, bring to foreground',
),
],
);
}
return SizedBox(
width: double.infinity,
height: imageHeight.toDouble(),
child: ExtendedImage.network(urls[index]),
);
},
),
);
}
}
class SecondScreen extends StatefulWidget {
const SecondScreen({super.key});
@override
State<SecondScreen> createState() => SecondScreenState();
}
class SecondScreenState extends State<SecondScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text('Second Page'),
),
body: Center(child: Text('Second Page')),
);
}
}Screenshots or Video
no screenshots
Logs
Logs
════════ Exception caught by image resource service ════════════════════════════
Exception: Image upload failed due to loss of GPU access.
════════════════════════════════════════════════════════════════════════════════Flutter Doctor output
Doctor output
bug % flutter doctor -v
[✓] Flutter (Channel stable, 3.27.1, on macOS 14.6 23G80 darwin-arm64, locale en-CA)
• Flutter version 3.27.1 on channel stable at /Users/dgreen/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (3 weeks ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /Users/dgreen/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.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 21.0.3+-79915917-b509.11)
[✓] IntelliJ IDEA Community Edition (version 2024.1.7)
• IntelliJ at /Applications/IntelliJ IDEA CE.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
[✓] VS Code (version 1.96.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.102.0
[✓] Connected device (5 available)
• David’s iPhone (mobile) • 00008130-000C5C322179001C • ios • iOS 18.1.1 22B91
• iPhone 16 Pro Max (mobile) • 485BC19C-49C5-47D9-802A-43749F36014E • ios • com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.6 23G80 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.6 23G80 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.205
! Error: Browsing on the local area network for Old iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network
as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
• No issues found!xSILENCEx, evanhu1, waitwalker, alex-dosa92, muttsu-623 and 36 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: regressionIt was better in the past than it is nowIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.27Found to occur in 3.27Found to occur in 3.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team