Skip to content

tac: fix stdin piping on Windows by skipping empty mmap results#10795

Merged
RenjiSann merged 1 commit intouutils:mainfrom
ChrisDryden:tac-fix-windows-stdin
Feb 7, 2026
Merged

tac: fix stdin piping on Windows by skipping empty mmap results#10795
RenjiSann merged 1 commit intouutils:mainfrom
ChrisDryden:tac-fix-windows-stdin

Conversation

@ChrisDryden
Copy link
Collaborator

@ChrisDryden ChrisDryden commented Feb 7, 2026

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

@ChrisDryden
Copy link
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

@RenjiSann RenjiSann merged commit f828549 into uutils:main Feb 7, 2026
155 checks passed
@RenjiSann
Copy link
Collaborator

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected tac tests failure on Windows

2 participants