Skip to content
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

Test failure Color.RedirectedOutputDoesNotUseAnsiSequences #60819

Closed
VincentBu opened this issue Oct 25, 2021 · 7 comments · Fixed by #60886
Closed

Test failure Color.RedirectedOutputDoesNotUseAnsiSequences #60819

VincentBu opened this issue Oct 25, 2021 · 7 comments · Fixed by #60886
Labels
arch-x64 area-Interop-coreclr bug os-windows untriaged New issue has not been triaged by the area owner
Milestone

Comments

@VincentBu
Copy link
Contributor

Run: runtime 20211024.12

Failed test:

net7.0-windows-Release-x64-CoreCLR_checked-Windows.10.Amd64.Open

- Color.RedirectedOutputDoesNotUseAnsiSequences

Error message:

System.IO.IOException : Unknown error (0xa5b8)


Stack trace
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded) in /_/src/libraries/System.Console/src/System/ConsolePal.Windows.cs:line 1076
   at System.ConsolePal.ResetColor() in /_/src/libraries/System.Console/src/System/ConsolePal.Windows.cs:line 519
   at System.Console.ResetColor() in /_/src/libraries/System.Console/src/System/Console.cs:line 349
   at Color.<>c.<RedirectedOutputDoesNotUseAnsiSequences>b__5_0(MemoryStream data) in /_/src/libraries/System.Console/tests/Color.cs:line 67
   at Helpers.RunInRedirectedOutput(Action`1 command) in /_/src/libraries/System.Console/tests/Helpers.cs:line 46
   at Color.RedirectedOutputDoesNotUseAnsiSequences() in /_/src/libraries/System.Console/tests/Color.cs:line 60
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Console untriaged New issue has not been triaged by the area owner labels Oct 25, 2021
@ghost
Copy link

ghost commented Oct 25, 2021

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

Issue Details

Run: runtime 20211024.12

Failed test:

net7.0-windows-Release-x64-CoreCLR_checked-Windows.10.Amd64.Open

- Color.RedirectedOutputDoesNotUseAnsiSequences

Error message:

System.IO.IOException : Unknown error (0xa5b8)


Stack trace
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded) in /_/src/libraries/System.Console/src/System/ConsolePal.Windows.cs:line 1076
   at System.ConsolePal.ResetColor() in /_/src/libraries/System.Console/src/System/ConsolePal.Windows.cs:line 519
   at System.Console.ResetColor() in /_/src/libraries/System.Console/src/System/Console.cs:line 349
   at Color.<>c.<RedirectedOutputDoesNotUseAnsiSequences>b__5_0(MemoryStream data) in /_/src/libraries/System.Console/tests/Color.cs:line 67
   at Helpers.RunInRedirectedOutput(Action`1 command) in /_/src/libraries/System.Console/tests/Helpers.cs:line 46
   at Color.RedirectedOutputDoesNotUseAnsiSequences() in /_/src/libraries/System.Console/tests/Color.cs:line 60
Author: VincentBu
Assignees: -
Labels:

area-System.Console, os-windows, arch-x64, untriaged

Milestone: -

@danmoseley
Copy link
Member

GetConsoleScreenBufferInfo returned 0xa5b8. @jkotas do you know what kind of code this is? It's not any kind of Windows error that I can find.

@jkotas
Copy link
Member

jkotas commented Oct 26, 2021

This is the special LAST_ERROR_TRASH_VALUE that is used by checked runtime to explicitly tag places where the last last error may be getting corrupted.

I do not see anything wrong with the code in System.Console. It is likely a problem introduced by switching to the DllImport source generator.

cc @elinor-fung @jkoritzinsky @AaronRobinsonMSFT

@danmoseley
Copy link
Member

danmoseley commented Oct 26, 2021

This is the special LAST_ERROR_TRASH_VALUE that is used by checked runtime to explicitly tag places where the last last error may be getting corrupted.

Ah! That explains it. I have added this to the team crib sheet.

@danmoseley
Copy link
Member

If it helps, in the last month this is may be the only test that encountered this error code - albeit 3 times.

TestResults
| join kind=inner WorkItems on WorkItemId
| join kind=inner Jobs on JobId
| where Finished >= now(-30d)
| where Result == 'Fail'
| where Message contains "0xa5b8"
| project Started, Duration, Type, Method, FriendlyName, MachineName, QueueName1, Message, StackTrace, Arguments, Branch

gives 3 hits, all on RedirectedOutputDoesNotUseAnsiSequences specifically. Something special about GetConsoleScreenBufferInfo?

@jkotas
Copy link
Member

jkotas commented Oct 26, 2021

Given that this failure is intermittent, my guess is that there is a path in tiered compilation corrupting the last error.

@jkotas jkotas added the bug label Oct 26, 2021
@jkotas jkotas added this to the 7.0.0 milestone Oct 26, 2021
jkotas added a commit to jkotas/runtime that referenced this issue Oct 26, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 26, 2021
@jkotas
Copy link
Member

jkotas commented Oct 26, 2021

Fix in #60886

github-actions bot pushed a commit that referenced this issue Oct 26, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 26, 2021
Anipik pushed a commit that referenced this issue Nov 11, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x64 area-Interop-coreclr bug os-windows untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants