This is an archive of the discontinued LLVM Phabricator instance.

Don't disable stdin and stdout buffering on Windows
ClosedPublic

Authored by amccarth on Apr 14 2016, 4:11 PM.

Details

Reviewers
zturner
Summary

Disabling buffering exposes a bug in the MS VS 2015 CRT implementation of fgets, where you sometimes have to hit Enter twice, depending on if the input had an odd or even number of characters.

This was hidden until a few days ago by the Python initialization which was re-enabling buffering on the streams. A few days ago, Enrico make the Python initialization on-demand, which exposed this problem.

Diff Detail

Event Timeline

amccarth updated this revision to Diff 53800.Apr 14 2016, 4:11 PM
amccarth retitled this revision from to Don't disable stdin and stdout buffering on Windows.
amccarth updated this object.
amccarth added a reviewer: zturner.
amccarth added a subscriber: lldb-commits.
zturner accepted this revision.Apr 14 2016, 4:19 PM
zturner edited edge metadata.

I think you can probably leave buffering turned off for stdout and only do this change for stdin unless we find some other bug. AFAIK the problem is confined to stdin. I'd probably leave a comment in Driver::MainLoop() about why you're not disabling buffering on Windows though.

This revision is now accepted and ready to land.Apr 14 2016, 4:19 PM

I think you can probably leave buffering turned off for stdout and only do this change for stdin unless we find some other bug. AFAIK the problem is confined to stdin. I'd probably leave a comment in Driver::MainLoop() about why you're not disabling buffering on Windows though.

Done. Re-running tests on Windows and will submit when they're done.