Writing random output to console output handle fails with no last error set #4635

Closed
opened 2026-01-30 23:52:28 +00:00 by claunia · 5 comments
Owner

Originally created by @benhillis on GitHub (Oct 24, 2019).

Originally assigned to: @miniksa on GitHub.

Environment

Windows build number: Microsoft Windows [Version 10.0.19002.1000]

Any other software?
WSL2

Steps to reproduce

https://github.com/microsoft/WSL/issues/4495

  1. Install Ubuntu 18.04 distro from store
  2. for i in /bin/*; do head ${i}; done
  3. Observe wsl window hang or crash

Expected behavior

Contents of the files are displayed, no hang / crash.

Actual behavior

WSL window will close, or hang. Seems like an issue with (or around) Utf8ToWideCharParser::_InvolvedParse.

Originally created by @benhillis on GitHub (Oct 24, 2019). Originally assigned to: @miniksa on GitHub. # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19002.1000] Any other software? WSL2 ``` # Steps to reproduce https://github.com/microsoft/WSL/issues/4495 1. Install Ubuntu 18.04 distro from store 2. `for i in /bin/*; do head ${i}; done` 3. Observe wsl window hang or crash # Expected behavior Contents of the files are displayed, no hang / crash. # Actual behavior WSL window will close, or hang. Seems like an issue with (or around) Utf8ToWideCharParser::_InvolvedParse.
Author
Owner

@jstarks commented on GitHub (Oct 28, 2019):

Should _InvolvedParse just stop passing MB_ERR_INVALID_CHARS to MultiByteToWideChar?

@jstarks commented on GitHub (Oct 28, 2019): Should `_InvolvedParse` just stop passing `MB_ERR_INVALID_CHARS` to `MultiByteToWideChar`?
Author
Owner

@benhillis commented on GitHub (Oct 28, 2019):

@jstarks - that was my naive take, I can try building a private with that change.

@benhillis commented on GitHub (Oct 28, 2019): @jstarks - that was my naive take, I can try building a private with that change.
Author
Owner

@jstarks commented on GitHub (Oct 28, 2019):

Although there's also a call to _RemoveInvalidSequences before that, which presumably should remove any invalid UTF-8 sequences.

@jstarks commented on GitHub (Oct 28, 2019): Although there's also a call to `_RemoveInvalidSequences` before that, which presumably should remove any invalid UTF-8 sequences.
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 28, 2019):

(This is being investigated.)

@DHowett-MSFT commented on GitHub (Oct 28, 2019): (This is being investigated.)
Author
Owner

@ghost commented on GitHub (Nov 26, 2019):

:tada:This issue was addressed in #3380, which has now been successfully released as Windows Terminal Preview v0.7.3291.0.🎉

Handy links:

@ghost commented on GitHub (Nov 26, 2019): :tada:This issue was addressed in #3380, which has now been successfully released as `Windows Terminal Preview v0.7.3291.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.7.3291.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4635