You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Functions emulator decodes runtime output per chunk and shares one line buffer between stdout and stderr #11522
The first log line consists of 25,000 "日" characters with no U+FFFD replacement characters.
stderr and stdout are buffered independently, producing > stderr-line followed by > stdout-1 stdout-2.
[REQUIRED] Actual behavior
In the first log line, the "日" straddling the 64 KiB pipe read boundary (e6 | 97 a5) is decoded as three U+FFFD replacement characters instead of "日".
The unfinished stdout write and the stderr line are concatenated into one log entry:
> stdout-1 stderr-line
> stdout-2
In src/emulator/functionsRuntimeWorker.ts, RuntimeWorker passes both childProc.stdout and childProc.stderr chunks into processStream(data, stdBuffer), which shares a single stdBuffer across both streams and decodes each Buffer chunk independently with buf += s.toString() instead of using a per-stream StringDecoder or setEncoding("utf8").
Activity