This issue is one of the top crashers identified in the Flutter 3.44.3 stable release.
The Flutter tool crashes with a FormatException: Missing extension byte when helper processes output non-UTF-8 bytes (e.g., on Windows/WSL under certain non-UTF-8 system locales).
Root Cause
In process.dart, ProcessUtils.stream uses the strict utf8LineDecoder (which has allowMalformed = false) to decode stdout/stderr. Any invalid byte sequence causes a fatal exception.
Proposed Solution
Update the process streaming mechanism to use the fault-tolerant utf8AllowMalformedLineDecoder instead, replacing invalid bytes with the Unicode replacement character (U+FFFD) to prevent crashes while preserving output.
This issue is one of the top crashers identified in the Flutter 3.44.3 stable release.
The Flutter tool crashes with a
FormatException: Missing extension bytewhen helper processes output non-UTF-8 bytes (e.g., on Windows/WSL under certain non-UTF-8 system locales).Root Cause
In
process.dart,ProcessUtils.streamuses the strictutf8LineDecoder(which hasallowMalformed = false) to decode stdout/stderr. Any invalid byte sequence causes a fatal exception.Proposed Solution
Update the process streaming mechanism to use the fault-tolerant
utf8AllowMalformedLineDecoderinstead, replacing invalid bytes with the Unicode replacement character (U+FFFD) to prevent crashes while preserving output.