-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FailFast in System.ConsolePal.WindowsConsoleStream.WriteFileNative #23776
Comments
That assert is dubious, AFAIR there is no guarantee that |
@mikedn the interesting thing here is that count < numBytesWritten. |
Ah, that's funny. It does looks like a mix up between bytes and chars 😄 |
In the case where count > numBytesWritten,
are we supposed to call WriteFile again (with an incremented pointer/lower count)? I'm not sure what else it would mean, since we can't just carry on and let it read more from our buffer at an arbitrary future time. |
Yes, that's how it usually works. However, I doubt that it is needed here, note that the MSDN doc refers to pipes opened in non-blocking mode, that's a very unusual case. It's also a very different situation than the issue you're experiencing. |
Agreed, although interestingly we recently hit upon that situation on Linux in a docker container, and needed to add explicit blocking to address it. |
Triage: @danmosemsft it looks that the assert problem was addressed with this commit: |
I don't think we're going to investigate further without reports of an issue. So we can close this. |
While debugging OpenCover, which invoked xunit.console, if I select in the console (to block console output) I sometimes get a failfast as below.
In this case, writeSuccess is true, but count == 50 and numBytesWritten is 100. The string to write is 50 characters: "xUnit.net console test runner (64-bit .NET Core).\n". MSDN seems clear that count is in bytes, however. Note: this is on RS3.
MSDN says
Of course, this is the reverse situation but perhaps the assert would fail in this case also. I assume that WriteFile wants you to call it again for the remainder in this case (which we don't do)
Console.OutputEncoding.CodePage=437 (OEM)
The text was updated successfully, but these errors were encountered: