http://bugs.winehq.org/show_bug.cgi?id=26914
Summary: setvbuf() breaks iostream input (msvcrt/msvcp) Product: Wine Version: 1.3.17 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: UncombedCoconut@gmail.com
This bug affects Stockfish, a chess engine. I've made a simplified test case.
This C++ program copies a line from stdin to stdout, or complains on EOF. It works on WinXP, but under Wine 1.2.2 or 1.3.17 it says "No input". (You do have to type a line before it will terminate.)
Here's the code and build command. The exe is attached. $ cat setvbuf-test.cpp #include <iostream> #include <cstdio> #include <string>
int main() { std::string input; setvbuf(stdin,NULL,_IONBF,0); setvbuf(stdout,NULL,_IONBF,0); if (std::getline(std::cin, input)) std::cout << "Input was: " << input << "\n"; else std::cout << "No input\n";
return 0; }
$ i686-w64-mingw32-g++ -o setvbuf-test.exe -static-libgcc setvbuf-test.cpp
http://bugs.winehq.org/show_bug.cgi?id=26914
--- Comment #1 from Justin Blanchard UncombedCoconut@gmail.com 2011-04-23 19:02:56 CDT --- Created an attachment (id=34317) --> (http://bugs.winehq.org/attachment.cgi?id=34317) Compiled test case
http://bugs.winehq.org/show_bug.cgi?id=26914
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase Component|-unknown |msvcrt
http://bugs.winehq.org/show_bug.cgi?id=26914
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |infyquest@gmail.com Resolution| |FIXED
--- Comment #2 from Vijay Kamuju infyquest@gmail.com 2012-06-30 10:01:33 CDT --- This works in wine-1.5.7-252-g1f01355 Marking it as fixed
http://bugs.winehq.org/show_bug.cgi?id=26914
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2012-07-03 14:15:20 CDT --- Closing bugs fixed in 1.5.8.