Skip to content

[Tool] FormatException in UTF-8 Process Output Decoding #188448

Description

@bkonyi

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.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions