Repository navigation
[android] App crash on exit (back button press) when showing animated WEBP image #166410
Copy link
Copy link
Closed
Closed
Copy link
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolee: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: 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
- Make app that shows animated WEBP file from local assets
- Open app
- Press Android device back button. App will crash 1 out of 3 times.
Also sometimes the OS will display a message asking if you want to clear cache for the app because it keeps crashing.
Happens both in debug and release mode.
Expected results
No app crash when exiting.
Actual results
App crashes.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(
appBar: AppBar(title: Text('Demo')),
body: SizedBox(
height: 250,
width: 250,
child: Image.asset('assets/nyan.webp'),
),
),
);
}
}The file I used is this one but I managed to reproduce with other animated WEBP files too: https://mathiasbynens.be/demo/animated-webp-supported.webp
To reproduce bug download it and place it in assets directory.
Using Image.network does not seem to trigger the bug.
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
I/ViewRootImpl@1e6a54e[MainActivity](13256): ViewPostIme key 0
D/Activity(13256): onKeyDown(KEYCODE_BACK)
I/ViewRootImpl@1e6a54e[MainActivity](13256): ViewPostIme key 1
D/Activity(13256): onKeyUp(KEYCODE_BACK) isTracking()=true isCanceled()=false hasCallback=false
I/ViewRootImpl@1e6a54e[MainActivity](13256): handleWindowFocusChanged: 0 0 call from android.view.ViewRootImpl.-$$Nest$mhandleWindowFocusChanged:0
I/ImeFocusController(13256): onPreWindowFocus: skipped, hasWindowFocus=false mHasImeFocus=true
I/ImeFocusController(13256): onPostWindowFocus: skipped, hasWindowFocus=false mHasImeFocus=true
D/InputTransport(13256): Input channel destroyed: 'ClientS', fd=148
I/ViewRootImpl@1e6a54e[MainActivity](13256): handleAppVisibility mAppVisible = true visible = false
I/ViewRootImpl@1e6a54e[MainActivity](13256): stopped(true) old = false
D/ViewRootImpl@1e6a54e[MainActivity](13256): WindowStopped on com.example.appexitbug/com.example.appexitbug.MainActivity set to true
D/OpenGLRenderer(13256): CacheManager::trimMemory(20)
D/SurfaceView(13256): 166526462 windowPositionLost, frameNr = 0
I/SurfaceView@fb6d811(13256): aOrMT: ViewRootImpl@1e6a54e[MainActivity] t = android.view.SurfaceControl$Transaction@fbfb95f fN = 0 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionLost:1697 android.graphics.RenderNode$CompositePositionUpdateListener.positionLost:376
I/ViewRootImpl@1e6a54e[MainActivity](13256): mWNT: t=0xb40000738593e990 mBlastBufferQueue=0xb4000073e5957110 fn= 0 mRenderHdrSdrRatio=1.0 caller= android.view.SurfaceView.applyOrMergeTransaction:1599 android.view.SurfaceView.-$$Nest$mapplyOrMergeTransaction:0 android.view.SurfaceView$SurfaceViewPositionUpdateListener.positionLost:1697
I/SurfaceView@fb6d811(13256): windowStopped(true) false io.flutter.embedding.android.FlutterSurfaceView{fb6d811 V.E...... ........ 0,0-1080,2196} of ViewRootImpl@1e6a54e[MainActivity]
I/SurfaceView(13256): 263641105 Changes: creating=false format=false size=false visible=true alpha=false hint=false visible=true left=false top=false z=false attached=true lifecycleStrategy=false
I/SurfaceView@fb6d811(13256): 263641105 Cur surface: Surface(name=null)/@0x6ab6768
I/SurfaceView(13256): 263641105 surfaceDestroyed
I/SurfaceView@fb6d811(13256): surfaceDestroyed callback.size 1 #1 io.flutter.embedding.android.FlutterSurfaceView{fb6d811 V.E...... ........ 0,0-1080,2196}
I/SurfaceView@fb6d811(13256): updateSurface: mVisible = false mSurface.isValid() = true
I/SurfaceView@fb6d811(13256): releaseSurfaces: viewRoot = ViewRootImpl@1e6a54e[MainActivity]
V/SurfaceView@fb6d811(13256): Layout: x=0 y=0 w=1080 h=2196, frame=Rect(0, 0 - 1080, 2196)
D/SurfaceView@fb6d811(13256): updateSurface: surface is not valid
I/SurfaceView@fb6d811(13256): releaseSurfaces: viewRoot = ViewRootImpl@1e6a54e[MainActivity]
D/SurfaceView@fb6d811(13256): 263641105 setAlpha: alpha=0.0
D/SurfaceView@fb6d811(13256): updateSurface: surface is not valid
I/SurfaceView@fb6d811(13256): releaseSurfaces: viewRoot = ViewRootImpl@1e6a54e[MainActivity]
W/WindowOnBackDispatcher(13256): sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda19@2bea8b
I/SurfaceView@fb6d811(13256): onWindowVisibilityChanged(8) false io.flutter.embedding.android.FlutterSurfaceView{fb6d811 G.E...... ......I. 0,0-1080,2196} of ViewRootImpl@1e6a54e[MainActivity]
D/SurfaceView@fb6d811(13256): updateSurface: surface is not valid
I/SurfaceView@fb6d811(13256): releaseSurfaces: viewRoot = ViewRootImpl@1e6a54e[MainActivity]
I/SurfaceView(13256): 263641105 Detaching SV
D/SurfaceView@fb6d811(13256): updateSurface: surface is not valid
I/SurfaceView@fb6d811(13256): releaseSurfaces: viewRoot = ViewRootImpl@1e6a54e[MainActivity]
I/SurfaceView@fb6d811(13256): onDetachedFromWindow: tryReleaseSurfaces()
I/SurfaceView@fb6d811(13256): releaseSurfaces: viewRoot = ViewRootImpl@1e6a54e[MainActivity]
D/OpenGLRenderer(13256): CacheManager::trimMemory(20)
I/ViewRootImpl@1e6a54e[MainActivity](13256): dispatchDetachedFromWindow
D/InputTransport(13256): Input channel destroyed: 'a927e9e', fd=121
F/libc (13256): Fatal signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x43006500630061 in tid 13256 (mple.appexitbug), pid 13256 (mple.appexitbug)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/r0qksx/r0q:14/UP1A.231005.007/S901NKSS7EYB3:user/release-keys'
Revision: '16'
ABI: 'arm64'
Processor: '0'
Timestamp: 2025-04-02 19:22:19.370855039+0900
Process uptime: 28s
Cmdline: com.example.appexitbug
pid: 13256, tid: 13256, name: mple.appexitbug >>> com.example.appexitbug <<<
uid: 10314
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0x0043006500630061
x0 002e00640069006f x1 b400007415adaf90 x2 0000000000000000 x3 00000075614a3794
x4 0000000000000004 x5 0000000000000004 x6 00000000140297c8 x7 00000000001d8e38
x8 00000000006e0061 x9 0000007118225566 x10 000000711832929c x11 000000000000000a
x12 0000000000005243 x13 000000007fffffff x14 0000000000000000 x15 000012f0e3a5822e
x16 0043006500630061 x17 000000758bcfde70 x18 000000758fbec000 x19 0000000000000000
x20 b400007415adaf90 x21 b4000074859f6430 x22 0000000000000000 x23 00000075614be020
x24 0000000000000000 x25 b400007325918598 x26 000000758f3e4000 x27 0000000000000002
x28 0000007fe308ba40 x29 0000007fe308b7a0
lr 0000007118497554 sp 0000007fe308b760 pc 0043006500630061 pst 0000000080001400
60 total frames
backtrace:
#00 pc 0000006500630061 <unknown>
#01 pc 0000000000286550 /vendor/lib64/hw/vulkan.adreno.so (qglinternal::vkDestroyImageView(VkDevice_T*, VkImageView_T*, VkAllocationCallbacks const*)+72) (BuildId: 9658e965533c502845097e16b987d3c8)
#02 pc 000000000002381c /system/lib64/libvulkan.so (vulkan::api::(anonymous namespace)::DestroyImageView(VkDevice_T*, VkImageView_T*, VkAllocationCallbacks const*)+136) (BuildId: 9b06a1f4deaf795678bf690c75f1f9af)
#03 pc 000000000210d1ac /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#04 pc 000000000210d3f8 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#05 pc 000000000210d330 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#06 pc 000000000210d494 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#07 pc 000000000210d1ec /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#08 pc 0000000001cdb62c /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#09 pc 0000000002132a84 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#10 pc 0000000001cdb62c /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#11 pc 00000000020bcfd4 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#12 pc 00000000020bcfec /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#13 pc 000000000216e2c0 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#14 pc 00000000021639e4 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#15 pc 0000000002176890 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#16 pc 0000000002176864 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#17 pc 0000000002177038 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#18 pc 0000000001d07b9c /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#19 pc 0000000001d07b18 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#20 pc 0000000001d07a70 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#21 pc 0000000001d0d610 /data/app/~~YCgszt7Xiqfzt2XF5IWIXg==/com.example.appexitbug-RaSS49V7dgUfl9x5Jlwnxg==/base.apk!libflutter.so (offset 0xf1c000) (BuildId: 231568c2bc519fbb1b96e1ed2e68a8abcdf9ee25)
#22 pc 0000000000018b70 /system/lib64/libutils.so (android::Looper::pollInner(int)+1252) (BuildId: a0e0ad47138267db6c479fc556e32d00)
#23 pc 0000000000018628 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+124) (BuildId: a0e0ad47138267db6c479fc556e32d00)
#24 pc 00000000001904d0 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+48) (BuildId: 48c986354b8fd6a648640756f15e7db5)
#25 pc 000000000233473c /memfd:jit-cache (deleted) (offset 0x2000000) (art_jni_trampoline+140)
#26 pc 000000000206a464 /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.MessageQueue.next+356)
#27 pc 0000000002069854 /memfd:jit-cache (deleted) (offset 0x2000000) (android.os.Looper.loopOnce+164)
#28 pc 000000000036d840 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#29 pc 0000000000366af8 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+2048) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#30 pc 000000000076e870 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+12208) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#31 pc 00000000003863d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#32 pc 00000000002416d8 /system/framework/framework.jar (android.os.Looper.loop+0)
#33 pc 0000000000358eec /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.17771861963221910393)+428) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#34 pc 0000000000367314 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+4124) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#35 pc 000000000076e870 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+12208) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#36 pc 00000000003863d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#37 pc 00000000001d2f1c /system/framework/framework.jar (android.app.ActivityThread.main+0)
#38 pc 0000000000358278 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1932) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#39 pc 0000000000383e98 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#40 pc 000000000036d840 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#41 pc 0000000000369190 /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+732) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#42 pc 00000000006c9134 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#43 pc 0000000000383d70 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#44 pc 000000000036d574 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#45 pc 0000000000366a80 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+1928) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#46 pc 000000000076e870 /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+12208) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#47 pc 00000000003863d8 /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#48 pc 000000000026b8a0 /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+0)
#49 pc 0000000000358278 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+1932) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#50 pc 0000000000383e98 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#51 pc 0000000000cb03e4 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3396)
#52 pc 000000000036d840 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#53 pc 0000000000358c08 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+204) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#54 pc 0000000000356bbc /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+512) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#55 pc 000000000073cefc /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+104) (BuildId: c35c9ebf7bb06435e4b31977d87bd5d5)
#56 pc 00000000000e4be8 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+108) (BuildId: 48c986354b8fd6a648640756f15e7db5)
#57 pc 00000000000f15bc /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+856) (BuildId: 48c986354b8fd6a648640756f15e7db5)
#58 pc 0000000000002558 /system/bin/app_process64 (main+1280) (BuildId: 26457af26875f94d5dfa717e22a87e7c)
#59 pc 0000000000053e50 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: edc1b601d9f8344c1eccd3d77a458f65)
Lost connection to device.
Exited.Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3.1 24D70 darwin-arm64, locale en-GB) [2.4s]
• Flutter version 3.29.2 on channel stable at /Users/joey/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c236373904 (3 weeks ago), 2025-03-13 16:17:06 -0400
• Engine revision 18b71d647a
• Dart version 3.7.2
• DevTools version 2.42.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [2.1s]
• Android SDK at /Users/joey/Library/Android/sdk
• Platform android-35, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [1,305ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [11ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) [11ms]
• 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.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.98.2) [10ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.108.0
[✓] Network resources [845ms]
• All expected network resources are available.
• No issues found!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolee: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: 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
Activity
[-]App crash on exit (back button press) on Android when showing animated WEBP image[/-][+][android] App crash on exit (back button press) when showing animated WEBP image[/+]maheshj01 commentedon Apr 3, 2025
Hey @cu-kha, Thanks for filing the issue. I am able to reproduce the issue on Pixel 7 Android 15 While the app is being closed with back button the app crashes. Reproduces on stable and the master channel.
I tried disabling impeller and I was not able to reproduce the crash.
logs
(logs)Impeller disabled
flutter doctor -v
master
stable
jonahwilliams commentedon Apr 3, 2025
@maheshj01 I'm having a bit of trouble reproducing this (probably need a matching phone). It would help if you get a the full strack trace. If you make the following change to the project used to trigger the crash, the stack trace should be symbolized:
maheshj01 commentedon Apr 3, 2025
@jonahwilliams here you go.
stack trace (master)
bug.zip
jonahwilliams commentedon Apr 3, 2025
Perfect, thank you!
cu-kha commentedon Apr 3, 2025
@jonahwilliams In case it helps, I've found this file triggers the bug more consistently
qr.webp.zip
@maheshj01 I noticed your crash log looks slightly different than mine (
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE)vsFatal signal 7 (SIGBUS), code 1 (BUS_ADRALN)jonahwilliams commentedon Apr 3, 2025
Thanks. I managed to reproduce this on a different device.
The problem is that we're shutting down without considering pending image decode work. So once the decoding finishes we may end up trying to destroy the resulting image after tearing down some of the code used the manage the vulkan driver. The adreno drivers in particular can crash when this happens. We should be able to handle this by making sure any inprogress image deocdes are cancelled or waited for when shutting down.
jason-simmons commentedon Apr 3, 2025
One factor that complicates this is that the UI task runner is now running on the platform thread.
Reproduced this on a Pixel 3. The sequence of events that I'm seeing is:
Shellshutdown starts executing on the platform thread.Shelldtor queues a task to the IO thread and waits for it to complete.Shelldtor resumes execution on the platform thread.CanvasImage, and it queues a lambda holding a reference to theCanvasImageonto the UI task runner.Shellshutdown. TheShelldtor then deletes the platform view, including the ImpellerContextVK.ContextVKdtor deletes the Vulkan memory allocator. The VMA fails an assertion because the lambda is still inside the UI task runner's queue and the texture that it owns has not yet been freed.This issue was not seen when the UI task runner had its own thread. In that setup, the task queued by the IO thread would run promptly on the UI thread. The task would see that the Dart isolate has shut down, and it would exit and drop its reference to the texture. So deletion of the texture would likely win the race against the platform thread's destruction of the platform view and the VMA.
Anything that queues tasks to the UI task runner may need to avoid capturing any real Vulkan objects. The task could instead hold some kind of handle representing an underlying object that can be safely deleted before the task executes.
[Impeller] keep device holder and allocator alive until last vk image…
github-actions commentedon Apr 23, 2025
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 -vand a minimal reproduction of the issue.[Impeller] keep device holder and allocator alive until last vk image…