Comments (3)
This issue will be discussed in person next week, but here is some info for future reference:
The current flutter stable (5.22.2) depends on version 5.8.8+1 of unified_analytics1. The relevant code. The crash happens at L285:
var records = logFile.readAsLinesSync();
Given that this read tried to allocate >9GB, I assume then that this log file somehow reached ~9GB in size. This is surprising, because we limit the number of event payloads we keep saved to kLogFileLength
(2500). From here, I hypothesize that one or more payloads that got logged were massive.
This almost certainly means that we have a bug somewhere (either in unified_analytics, but more likely the flutter tool). I can't imagine any legitimate reason for a payload being somewhere between somewhere between 9GB/2500=3.6MB and 9GB in size. Another reason this is troubling is that we are potentially wasting a significant amount of the user's network bandwidth2.
Focusing back on the issue on allocating 9GB. I/@christopherfujino see two ways forward:
- Patch unified_analtyics (v5 and v6) to stop this logging completely.
- Rework the troublesome code to more robustly guard against massive payloads. Just as one example, instead of constraining the file using number of payloads logged, we could discard any payload (new or existing) that exceeds 1kB. In this case I would also recommend patching this code to catch and discard any
FileSystemException
encountered—the risk of such an exception is completely opaque to callers, and logging these payloads is not important enough to warrant crashing callers. This was already patched into v6 with 6.1.1, but we should probably do this for v5 as well and get this hotfixed into the stable flutter release.
Footnotes
-
https://github.com/flutter/flutter/blob/27dfff1c8601594113540034e08a47d7488b37f7/packages/flutter_tools/pubspec.yaml#L55 ↩
-
Maybe we should file another issue on this? Either the tool should add guards that make sure we aren't sending massive payloads, or we could make the
Analytics
class (from unified_analtyics) configurable with a means to guard against this. Opinions, @christopherfujino ? ↩
from flutter.
@andrewkolos we should take a look at this one
from flutter.
2. Maybe we should file another issue on this? Either the tool should add guards that make sure we aren't sending massive payloads, or we could make the
Analytics
class (from unified_analtyics) configurable with a means to guard against this. Opinions, @christopherfujino ? ↩
I talked with @christopherfujino briefly (this is still going to be discussed more next week). He agreed that we should do something about sending massive payloads. Perhaps we should continue to send these (to avoid events "disappearing" in a confusing way), but we should also send a special "large event" event when this happens. We can then then triage these special events independently. It's also entirely possible that we can already query our analytics for massive payloads and troubleshoot from there, but this is something we would need to investigate.
from flutter.
Related Issues (20)
- FlutterUndoManagerPlugin is not released causes the crash (when not initializing FlutterEngine in global scope) HOT 14
- Does flutter support cleartext basic-auth in the URL? (https://username:[email protected]) HOT 10
- As requested,, I'm reporting a "we should provide substanittailly more information" exception HOT 2
- Possibility to arrange SegmentedButton vertically HOT 5
- Using Material 3 on Android, the Status Bar color changes when using Flutter Engine Cache HOT 2
- Flutter Ios - Cocoapods & Ruby issue... HOT 6
- Flutter prints "Error" instead of the actual Exception if the function is async [3.22] HOT 8
- [url_launcher] Add support for TWA (trusted web activity) on Android
- StatusBarColor doesn't change when I use android 14 on SMA73 phone in release mode HOT 2
- I also get "Future isn't a type"... without much explanation. HOT 3
- Can't change PopupMenuButton padding (container padding) HOT 2
- Multiple device debugging like native android HOT 1
- TestDeviceException(Shell subprocess crashed with SIGABRT (-6).) after upgrading to v3.22.2 HOT 2
- Flutter CLI should require confirmation before running with root perms HOT 2
- I am getting "Downloaded archive for * had wrong content-hash" error when running dart pub get HOT 1
- mac-26 lost external connection phone device. HOT 2
- linux-62 lost external connection phone device. HOT 2
- mac-7 lost external connection phone device. HOT 2
- linux-46 lost external connection phone device. HOT 2
- mac-6 & mac-28 lost external connection phone device. 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.