https://bugs.winehq.org/show_bug.cgi?id=56459
Bug ID: 56459 Summary: Inconsistent and Unexpected I/O flush behavior Product: Wine Version: 9.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: renatopereyra@google.com Distribution: ---
While recently debugging a Proton issue [1], I discovered odd I/O flushing behavior. Redirecting stderr/stdout to a file would cause most of intel-steam-stdout-255710.log in [1] to be empty. The contents of that file were critical to root-cause the issue and not having them made it much more difficult to debug. There were prints to stderr that directly explained what was going wrong and I had inadvertently hidden these by redirecting I/O "to preserve it" across multiple debugging runs.
To debug this I/O issue, I wrote a trivial Windows app that logs out to stderr and is configurable to cover multiple corner cases. I was able to reproduce the exact game behavior and a lot more other weirdness. I tested unmodified Wine 8.0, 9.0, and 9.4, as well as Proton 8.0 and Experimental (I will reach out to Proton devs independently). I found a total of 7 possible flushing outcomes and only 2 of those expected/good IMHO. In a lot of cases prints would just flat out completely be missing. There were also other cases where only partial data would ever flush out.
I've uploaded all my test results and test app to [2]. I'm unable to make the drive fully public per my organization's policies so please request access.
Notes regarding the data sheet: - While the test app supports multiple options (see README in [2]), the data sheet only includes a subset. Options omitted in the spreadsheet appeared to have no impact on the flush behavior. - The minimum set of states required to reach each specific possible flushing outcome is color-coded.
[1] https://github.com/ValveSoftware/Proton/issues/7529 [2] https://drive.google.com/drive/folders/14pWGcywUMtoc9z3QmHXNGbLq5Sdg3ICG?res...