tac: fix stdin piping on Windows by skipping empty mmap results#10795
Merged
RenjiSann merged 1 commit intouutils:mainfrom Feb 7, 2026
Merged
tac: fix stdin piping on Windows by skipping empty mmap results#10795RenjiSann merged 1 commit intouutils:mainfrom
RenjiSann merged 1 commit intouutils:mainfrom
Conversation
Collaborator
Author
|
I created the branch with a bunch of changed github ci files to stress test the tac windows tests with hundreds of runs to be confident it fixes the flakiness issues: https://github.com/ChrisDryden/coreutils/tree/fix-tac-windows-stdin-wouldblock |
Collaborator
|
Thanks ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a fix for the flaky tac tests and allows us to enable all of the disabled tac tests that were previously disabled due to the flakiness issue. The cause is that when calling mmap on stdin on windows, if the data is not ready yet it will return a 0 size which mmap will succeed on reading and then return an empty output.
This adds a check that if it's an empty stdin when trying to mmap it will default to the tmpfile behavior. This is what already happens when stdin is not a file hander on windows since if the stdin is not empty and its not a file handler then mmap will fail regardless and it will go to the default tmpfile behavior
Fixes: #10782