Unexpected debug logs when typing in a conhost WSL shell #2906

Closed
opened 2026-01-30 23:08:30 +00:00 by claunia · 1 comment
Owner

Originally created by @j4james on GitHub (Jul 24, 2019).

Environment

Windows build number: Version 10.0.18362.175
Windows Terminal version (if applicable): Built locally from commit dca0ffe6dd

Steps to reproduce

  1. Start conhost (Host.exe) from within the Visual Studio debugger.
  2. From the cmd prompt, open a WSL bash shell.
  3. Begin typing something on the command line.
  4. Watch the Output/Debug window in Visual Studio.
  5. Note the constant stream of debug messages being generated as you type.

Expected behavior

I wouldn't expect to see much of anything in the debug output unless there was a genuine error condition.

Actual behavior

It seems that for every key press I get a pair of debug messages similar to this:

...\terminal\src\host\directio.cpp(317)\OpenConsole.exe!00007FF764908C40: (caller: 00007FF76494E601) ReturnHr(19) tid(2c6c) D0030001
...\terminal\src\host\directio.cpp(387)\OpenConsole.exe!00007FF764908D00: (caller: 00007FF76494E606) ReturnHr(20) tid(2c6c) D0030001

As far as I can make out, the issue is that _DoGetConsoleInput method can successfully return either a STATUS_SUCCESS or a CONSOLE_STATUS_WAIT, but the latter is considered an error by the RETURN_NTSTATUS macro, so it's logged in the debug output.

I guess it's possible that's intentional, but I suspect it's more likely an oversight. If it's an expected outcome, I wouldn't think you'd want to keep flooding the logs with those messages. It makes it difficult to spot any real errors, and it's probably not helping performance.

Originally created by @j4james on GitHub (Jul 24, 2019). # Environment Windows build number: Version 10.0.18362.175 Windows Terminal version (if applicable): Built locally from commit dca0ffe6dd0f76ca7997807424a2c08684e07751 # Steps to reproduce 1. Start conhost (Host.exe) from within the Visual Studio debugger. 2. From the cmd prompt, open a WSL bash shell. 3. Begin typing something on the command line. 4. Watch the Output/Debug window in Visual Studio. 5. Note the constant stream of debug messages being generated as you type. # Expected behavior I wouldn't expect to see much of anything in the debug output unless there was a genuine error condition. # Actual behavior It seems that for every key press I get a pair of debug messages similar to this: ...\terminal\src\host\directio.cpp(317)\OpenConsole.exe!00007FF764908C40: (caller: 00007FF76494E601) ReturnHr(19) tid(2c6c) D0030001 ...\terminal\src\host\directio.cpp(387)\OpenConsole.exe!00007FF764908D00: (caller: 00007FF76494E606) ReturnHr(20) tid(2c6c) D0030001 As far as I can make out, the issue is that `_DoGetConsoleInput` method can successfully return either a `STATUS_SUCCESS` or a `CONSOLE_STATUS_WAIT`, but the latter is considered an error by the `RETURN_NTSTATUS` macro, so it's logged in the debug output. I guess it's possible that's intentional, but I suspect it's more likely an oversight. If it's an expected outcome, I wouldn't think you'd want to keep flooding the logs with those messages. It makes it difficult to spot any real errors, and it's probably not helping performance.
Author
Owner

@miniksa commented on GitHub (Aug 1, 2019):

Yes, that's an oversight. It should be using either the _EXPECTED version of the macros so it doesn't report or somehow skipping the macro for those scenarios as the debug message is not useful.

@miniksa commented on GitHub (Aug 1, 2019): Yes, that's an oversight. It should be using either the _EXPECTED version of the macros so it doesn't report or somehow skipping the macro for those scenarios as the debug message is not useful.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2906