Comments (11)
We have hundreds of similar crashes on 3.22, only on iOS.
(We have not been able to isolate the conditions that cause it to happen - still investigating)
NativeCanvas._restore$Method$FfiNative
EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
Crashed: io.flutter.1.ui
1 App 0x13b500 NativeCanvas._restore$Method$FfiNative + 1232384 (painting.dart:1232384)
2 App 0x458eb4 MyPainter.paint + 1131 (masking_step.dart:1131)
3 App 0x13d4ec RenderCustomPaint._paintWithPainter + 588 (custom_paint.dart:588)
4 App 0x13d358 RenderCustomPaint.paint + 633 (custom_paint.dart:633)
5 App 0x13c110 RenderObject._paintWithContext + 3243 (object.dart:3243)
6 App 0x13c05c PaintingContext.paintChild + 234 (object.dart:234)
7 App 0x15353c RenderBoxContainerDefaultsMixin.defaultPaint (#5) + 3154 (box.dart:3154)
8 App 0x1533bc RenderStack.paint + 762 (stack.dart:762)
9 App 0x13c110 RenderObject._paintWithContext + 3243 (object.dart:3243)
10 App 0x13c05c PaintingContext.paintChild + 234 (object.dart:234)
from flutter.
We use lottie.asset without renderCache and framRate, but the issue still exists.
Crashes started from Flutter 3.22
By the way, we don't have lottie in logs
Logs
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000000010859bfd0
Exception Codes: 0x0000000000000001, 0x000000010859bfd0
VM Region Info: 0x10859bfd0 is not in any region. Bytes after previous region: 49105 Bytes before following region: 48
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_LARGE 10858c000-108590000 [ 16K] rw-/rwx SM=PRV
---> GAP OF 0xc000 BYTES
MALLOC_LARGE 10859c000-1085a8000 [ 48K] rw-/rwx SM=PRV
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [1339]
Triggered by Thread: 2
Thread 2 Crashed:
0 Flutter 0x0000000107a482d4 0x107700000 + 3441364
1 Flutter 0x0000000107a494ec 0x107700000 + 3445996
2 App 0x0000000110d613a8 NativeCanvas._restoreToCount$Method$FfiNative + 140 (painting.dart:0)
3 App 0x0000000110d612e4 _NativeCanvas.restoreToCount + 20 (painting.dart:5813)
4 App 0x0000000110d612e4 RenderPictureVectorGraphic.paint + 1132 (render_vector_graphic.dart:447)
5 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
6 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
7 App 0x0000000110d5584c RenderProxyBoxMixin.paint (#2) + 60 (proxy_box.dart:130)
8 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
9 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
10 App 0x0000000110d5584c RenderProxyBoxMixin.paint (#2) + 60 (proxy_box.dart:130)
11 App 0x0000000110d5113c RenderProxyBoxMixin.paint + 40 (proxy_box.dart:124)
12 App 0x0000000110d53bec PaintingContext.pushTransform + 540 (object.dart:687)
13 App 0x0000000110d54944 RenderFittedBox._paintChildWithTransform + 264 (proxy_box.dart:2784)
14 App 0x0000000110d547f4 RenderFittedBox.paint + 468 (proxy_box.dart:2814)
15 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
16 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
17 App 0x0000000110d5584c RenderProxyBoxMixin.paint (#2) + 60 (proxy_box.dart:130)
18 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
19 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
20 App 0x0000000110d5584c RenderProxyBoxMixin.paint (#2) + 60 (proxy_box.dart:130)
21 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
22 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
23 App 0x0000000110d57ed8 RenderShiftedBox.paint (#2) + 152 (shifted_box.dart:74)
24 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
25 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
26 App 0x0000000110d5c0e8 RenderBoxContainerDefaultsMixin.defaultPaint (#2) + 220 (box.dart:3158)
27 App 0x0000000110d5bf10 RenderFlex.paint + 76 (flex.dart:1014)
28 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
29 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
30 App 0x0000000110d5c0e8 RenderBoxContainerDefaultsMixin.defaultPaint (#2) + 220 (box.dart:3158)
31 App 0x0000000110d5bf10 RenderFlex.paint + 76 (flex.dart:1014)
32 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
33 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
34 App 0x0000000110d57ed8 RenderShiftedBox.paint (#2) + 152 (shifted_box.dart:74)
35 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
36 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
37 App 0x0000000110d5584c RenderProxyBoxMixin.paint (#2) + 60 (proxy_box.dart:130)
38 App 0x0000000110d53244 RenderDecoratedBox.paint + 492 (proxy_box.dart:2291)
39 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
40 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
41 App 0x0000000110d57ed8 RenderShiftedBox.paint (#2) + 152 (shifted_box.dart:74)
42 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
43 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
44 App 0x0000000110d5c0e8 RenderBoxContainerDefaultsMixin.defaultPaint (#2) + 220 (box.dart:3158)
45 App 0x0000000110d5bf10 RenderFlex.paint + 76 (flex.dart:1014)
46 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
47 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
48 App 0x0000000110d5c0e8 RenderBoxContainerDefaultsMixin.defaultPaint (#2) + 220 (box.dart:3158)
49 App 0x0000000110d5bf10 RenderFlex.paint + 76 (flex.dart:1014)
50 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
51 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
52 App 0x0000000110d5c0e8 RenderBoxContainerDefaultsMixin.defaultPaint (#2) + 220 (box.dart:3158)
53 App 0x0000000110d5bf10 RenderFlex.paint + 76 (flex.dart:1014)
54 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
55 App 0x0000000110d4a89c PaintingContext.paintChild + 172 (object.dart:250)
56 App 0x0000000110d583b0 RenderSingleChildViewport.paint.paintContents + 80 (single_child_scroll_view.dart:524)
57 App 0x0000000110d4ef2c PaintingContext.pushLayer + 232 (object.dart:486)
58 App 0x0000000110d4f288 PaintingContext.pushClipRect + 472 (object.dart:546)
59 App 0x0000000110d581cc RenderSingleChildViewport.paint + 308 (single_child_scroll_view.dart:528)
60 App 0x0000000110d0167c RenderObject._paintWithContext + 148 (object.dart:3239)
61 App 0x0000000110d01120 PaintingContext._repaintCompositedChild + 308 (object.dart:166)
62 App 0x0000000110d00cfc PaintingContext.repaintCompositedChild + 176 (object.dart:109)
63 App 0x0000000110d00cfc PipelineOwner.flushPaint + 288 (object.dart:1182)
64 App 0x0000000110d00df4 PipelineOwner.flushPaint + 536 (object.dart:1192)
65 App 0x0000000110cefe48 RendererBinding.drawFrame + 88 (binding.dart:579)
66 App 0x0000000110cef7b8 WidgetsBinding.drawFrame + 180 (binding.dart:1138)
67 App 0x0000000110cef174 RendererBinding._handlePersistentFrameCallback (#2) + 40 (binding.dart:443)
68 App 0x0000000110cef138 RendererBinding._handlePersistentFrameCallback + 36 (binding.dart:442)
69 App 0x0000000110bf7788 SchedulerBinding._invokeFrameCallback + 56 (binding.dart:1392)
70 App 0x0000000110bf752c SchedulerBinding.handleDrawFrame + 320 (binding.dart:1313)
71 App 0x0000000110bf73d0 SchedulerBinding._handleDrawFrame (#2) + 276 (binding.dart:1171)
72 App 0x0000000110bf72a8 SchedulerBinding._handleDrawFrame + 32 (binding.dart:1153)
73 App 0x0000000110bc7bd8 rootRun + 140 (zone.dart:1399)
74 App 0x0000000110bc7c90 rootRun (#2) + 120
75 App 0x0000000111127174 CustomZone.run + 160 (zone.dart:1301)
76 App 0x0000000111128450 CustomZone.runGuarded + 48 (zone.dart:1209)
77 App 0x0000000110be781c invoke + 156 (hooks.dart:314)
78 App 0x0000000110bea024 PlatformDispatcher._drawFrame + 36 (platform_dispatcher.dart:419)
79 App 0x0000000110be9fe8 drawFrame + 56 (hooks.dart:283)
80 App 0x0000000110bea054 drawFrame (#2) + 24 (hooks.dart:281)
81 App 0x0000000110bb7bf8 stub InvokeDartCode + 216
82 Flutter 0x0000000107d054a4 + -1 (:-1)
83 Flutter 0x0000000107e1d044 + -1 (:-1)
84 Flutter 0x0000000107b078f0 0x107700000 + 4225264
85 Flutter 0x0000000107ae72c4 0x107700000 + 4092612
86 Flutter 0x0000000107b1a230 + -1 (:-1)
87 Flutter 0x00000001079eb47c + -1 (:-1)
88 Flutter 0x00000001079ee9f4 + -1 (:-1)
89 CoreFoundation 0x0000000193c836e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1797)
90 CoreFoundation 0x0000000193c83388 __CFRunLoopDoTimer + 1004 (CFRunLoop.c:2404)
91 CoreFoundation 0x0000000193c0d184 __CFRunLoopDoTimers + 288 (CFRunLoop.c:2562)
92 CoreFoundation 0x0000000193c0a18c __CFRunLoopRun + 1856 (CFRunLoop.c:3122)
93 CoreFoundation 0x0000000193c09968 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
94 Flutter 0x00000001079eeae0 + -1 (:-1)
95 Flutter 0x00000001079ee728 + -1 (:-1)
96 Flutter 0x00000001079ee438 + -1 (:-1)
97 libsystem_pthread.dylib 0x00000001efbb9a90 _pthread_start + 136 (pthread.c:927)
98 libsystem_pthread.dylib 0x00000001efbb8fcc thread_start + 8 (:-1)
from flutter.
@synstin Ok after speaking to a coworker, we indeed are using lottie with the framerate set to max
but we do not have the render cache setting specified.
from flutter.
This does not happen in the simulator, only on the real device.
I'm attaching the error log as shown in Xcode.
io.flutter.1.ui (9)
#0 0x00000001082aed54 in flutter::DisplayListBuilder::Restore() ()
0x1082aed54 <+284>: ldrsb w8, [x24] io.flutter.1.ui (9): EXC_BAD_ACCESS (code=1, address=0x117467fa8)
Using only one of the renderCache and frameRate options will result in an error.
@huycozy Did you test on a real device and not be able to reproduce it?
@acoutts If you remove the framerate option it doesn't crash?
from flutter.
@synstin I tested on a physical device as mentioned above, issue is not reproduced. If you can reproduce this, please provide a minimal sample code (a GitHub repo would be helpful), Flutter version, and the entire crash stack trace.
from flutter.
@huycozy ssdly I cannot reproduce it on my device either but I think we should leave it open for discussion because several other people here have reported it too.
We downgraded to flutter 3.19 and the user who had repeated crashes is now able to open and use the app.
We tried disabling impeller and that did not fix it but downgrading flutter did fix it.
from flutter.
I found the cause.
The error occurs when setting Lottie's renderCache and frameRate option.
Using only one of the renderCache and frameRate options will result in an error.
Occurs on IOS only. Does not occur on Android.
example
Lottie.asset('test.json', renderCache: RenderCache.raster, frameRate: FrameRate(60));
The problem only occurs in version 3.22 and later.
earlier versions will not throw an error even if the option is present.
Currently, I'm using Flutter 3.22.1 in production after removing the renderCache and frameRate options from lottie.
Additional
This does not happen in the simulator, only on the real device.
from flutter.
@synstin I tried using lottie example with two params as above but couldn't reproduce the crash in release
mode (test in local environment with iPhone 7, iOS 15.8
). Could you share a complete (and minimal) sample code?
@acoutts Are you also using two params as @synstin found above? It would be helpful if you could share a sample code (in case @synstin couldn't accomplish it)
from flutter.
Labeling the issue for other's input.
from flutter.
Hi @acoutts
It seems you are using Lottie animations in your app. I tried symbolizing this but it failed on Flutter trace:
➜ ~ dart pub global run symbolizer:symbolize https://github.com/flutter/flutter/issues/149340\#issue-2326350155 "flutter#5dcb86f arm64 release force ios"
...
symbolized using symbols for f6344b75dcf861d8bf1f1322780b8811f982e31a ios-arm64-release
#00 000000010272c2d4 Flutter (Missing)
#01 0000000108967408 App NativeCanvas._restore$Method$FfiNative + 124 (painting.dart:)
#02 0000000108d341b4 App _NativeCanvas.restore + 16 (painting.dart:580)
#03 0000000108d341b4 App BaseLayer.draw + 1716 (base_layer.dart:24)
#04 0000000108d5d904 App CompositionLayer.drawLayer + 480 (composition_layer.dart:10)
#05 0000000108d33d70 App BaseLayer.draw + 624 (base_layer.dart:19)
#06 0000000108d5d904 App CompositionLayer.drawLayer + 480 (composition_layer.dart:10)
#07 0000000108d33d70 App BaseLayer.draw + 624 (base_layer.dart:19)
#08 00000001089797c0 App LottieDrawable.draw + 768 (lottie_drawable.dart:23)
#09 00000001089794a8 App RenderLottie.paint + 140 (render_lottie.dart:26)
#10 0000000108db3350 App RenderObject._paintWithContext + 148 (object.dart:323)
#11 0000000108967f64 App PaintingContext.paintChild + 172 (object.dart:25)
#12 000000010896d74c App RenderProxyBoxMixin.paint (#2) + 60 (proxy_box.dart:13)
#13 0000000108db3350 App RenderObject._paintWithContext + 148 (object.dart:323)
#14 0000000108907130 App PaintingContext._repaintCompositedChild + 308 (object.dart:16)
#15 0000000108906dbc App PaintingContext.repaintCompositedChild + 176 (object.dart:10)
#16 0000000108906dbc App PipelineOwner.flushPaint + 288 (object.dart:118)
#17 0000000108906eb4 App PipelineOwner.flushPaint + 536 (object.dart:119)
#18 00000001088fe058 App RendererBinding.drawFrame + 88 (binding.dart:57)
#19 00000001088fdb14 App WidgetsBinding.drawFrame + 180 (binding.dart:113)
#20 00000001088fd460 App RendererBinding._handlePersistentFrameCallback (#2) + 40 (binding.dart:44)
#21 00000001088fd424 App RendererBinding._handlePersistentFrameCallback + 36 (binding.dart:44)
#22 0000000108d980d8 App SchedulerBinding._invokeFrameCallback + 56 (binding.dart:139)
#23 0000000108d97e7c App SchedulerBinding.handleDrawFrame + 320 (binding.dart:131)
#24 000000010887eac4 App SchedulerBinding._handleDrawFrame (#2) + 276 (binding.dart:117)
#25 000000010887e99c App SchedulerBinding._handleDrawFrame + 32 (binding.dart:115)
#26 000000010887f564 App invoke + 128 (hooks.dart:31)
#27 0000000108881080 App PlatformDispatcher._drawFrame + 36 (platform_dispatcher.dart:41)
#28 0000000108881044 App drawFrame + 56 (hooks.dart:28)
#29 00000001088810b0 App drawFrame (#2) + 24 (hooks.dart:28)
#30 0000000108857bf8 App stub InvokeDartCode + 216
#31 00000001029e94a4 Flutter (Missing)
#32 0000000102b01044 Flutter (Missing)
#33 00000001027eb8f0 Flutter (Missing)
#34 00000001027cb2c4 Flutter (Missing)
#35 00000001027fe230 Flutter (Missing)
#36 00000001026cf47c Flutter (Missing)
#37 00000001026d29f4 Flutter (Missing)
#38 000000019690f6e4 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:179)
#39 000000019690f388 CoreFoundation __CFRunLoopDoTimer + 1004 (CFRunLoop.c:240)
#40 0000000196899184 CoreFoundation __CFRunLoopDoTimers + 288 (CFRunLoop.c:256)
#41 000000019689618c CoreFoundation __CFRunLoopRun + 1856 (CFRunLoop.c:312)
#42 0000000196895968 CoreFoundation CFRunLoopRunSpecific + 608 (CFRunLoop.c:342)
#43 00000001026d2ae0 Flutter (Missing)
#44 00000001026d2728 Flutter (Missing)
#45 00000001026d2438 Flutter (Missing)
#46 00000001f2845a90 libsystem_pthread.dylib _pthread_start + 136 (pthread.c:92)
#47 00000001f2844fcc libsystem_pthread.dylib thread_start + 8 (:-)
I found an issue with a similar trace at #130478 which happened before 3.22.0 and still needs reproduction info to investigate.
To confirm if this is a similar issue, does this happen before you upgrade Flutter? What time did you add Lottie package to your project?
from flutter.
Thanks @huycozy - we did not receive any reports until after we upgraded to 3.22 recently. We have ran lottie since day 1 and have not seen this crash since before we upgraded flutter. Since upgrading we've have 2 different users on different devices report the issue.
We have a lottie animation on our app start screen, so for these users they launched the app and it immediately crashed on them.
from flutter.
Related Issues (20)
- GoRouter - Location cannot be empty. HOT 10
- [tool_crash] FileSystemException: Creation failed, OS Error: The system cannot find the file specified., errno = 2 HOT 1
- Sometimes the ColorScheme generated by ColorScheme.fromSeed has the same color for different color role HOT 2
- Error starting debug session in Xcode: Timed out waiting for CONFIGURATION_BUILD_DIR to update HOT 1
- Pigeon throws `TypeError` with `copyrightHeader` in `kotlinOptions` HOT 6
- MouseRegion for Touchscreens HOT 3
- [Method Channel][ActivityAware] global variable activity is null when it call in setmethodhandler and app is running in background HOT 2
- [image_picker] maxWidth and maxHeight setting do not work with images taken from a device camera in Portrait orientation HOT 1
- Failed build for Web app with Flutter 3.22.2 HOT 3
- [Android] Upgrading to minSdk 23, makes app size 2 times bigger with flutter build apk HOT 4
- TextFormField autofillHints generates error message on WEB HOT 2
- Support MaskFilter on Canvas.drawVertices. HOT 3
- App sometimes crashes if VoiceOver is enabled on iOS HOT 9
- Just another bug. HOT 3
- Context from navigation key is not equal to context from build method of a widget HOT 1
- Layout on the iOS profile and release mode happens with zero max size first and then the actual max size. HOT 2
- [camera_android_camerax] CameraController.stopVideoRecording fail when CameraController.value.isRecordingVideo == true HOT 1
- Flutter-3.22.2 - Repeated launches of any application in the Android emulator freeze HOT 3
- [camera_avfoundation] Separate time offsets for video and audio can cause shifted audio HOT 4
- [Web] IME's conversion target background display and caret display position is misaligned HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.