https://bugs.winehq.org/show_bug.cgi?id=56697
Bug ID: 56697 Summary: _kbhit ignores the last event in the queue Product: Wine Version: 9.8 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@winehq.org Reporter: qsniyg@protonmail.com Distribution: ---
Created attachment 76482 --> https://bugs.winehq.org/attachment.cgi?id=76482 kbhit_test.c
Discovered this bug while writing an implementation for timeout.exe.
Run the attached kbhit_test program under wineconsole to replicate the error.
https://bugs.winehq.org/show_bug.cgi?id=56697
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
https://bugs.winehq.org/show_bug.cgi?id=56697
Hales nailer592899230@halestrom.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nailer592899230@halestrom.n | |et
--- Comment #1 from Hales nailer592899230@halestrom.net --- I can reproduce this result. Wine 9.9.
Today I found a similar-but-different scenario where kbhit() is broken. Please see my attached kbhit_test2.c.
Test results across 3 different console environments:
(1) Run directly from my shell in urxvt ("wine xxx.exe") kbhit_test.exe: Works correctly kbhit_test2.exe: Fails to detect any keypresses (bug!)
(2) Run inside of "wine cmd" in urxvt: kbhit_test.exe: Works correctly kbhit_test2.exe: Works correctly
(3) Run inside "wineconsole": kbhit_test.exe: Fails to detect any keypresses (bug!) kbhit_test2.exe: Works correctly
My compiler is i686-w64-mingw32-gcc 12.2.0, a cross compiler run from Linux. I compiled the files using "i686-w64-mingw32-gcc -Wall xxx.c -o xxx.exe
https://bugs.winehq.org/show_bug.cgi?id=56697
--- Comment #2 from Hales nailer592899230@halestrom.net --- Created attachment 76528 --> https://bugs.winehq.org/attachment.cgi?id=76528 Source for C program invoking kbhit() in a different way, exhibiting slightly different results.
https://bugs.winehq.org/show_bug.cgi?id=56697
Hales nailer592899230@halestrom.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #76528|Source for C program |kbhit_test2.c - slightly description|invoking kbhit() in a |different results, still |different way, exhibiting |buggy |slightly different results. |
https://bugs.winehq.org/show_bug.cgi?id=56697
--- Comment #3 from qsniyg qsniyg@protonmail.com --- Does https://gitlab.winehq.org/wine/wine/-/commit/9731b96a6d04ffdaaa0c13a19ad8ead... fix the issue with kbhit_test2?
https://bugs.winehq.org/show_bug.cgi?id=56697
--- Comment #4 from Hales nailer592899230@halestrom.net --- 9731b96a6d04ffdaaa0c13a19ad8eadd840ff37c fixes kbhit_test but not kbhit_test2.
https://bugs.winehq.org/show_bug.cgi?id=56697
Julian RĂ¼ger jr98@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jr98@gmx.net
https://bugs.winehq.org/show_bug.cgi?id=56697
Piotr Caban piotr.caban@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |piotr.caban@gmail.com
--- Comment #5 from Piotr Caban piotr.caban@gmail.com --- The remaining kbhit tests should be fixed by 141acfb62281b21b84cb457b680eedad08d31d0c. Please retest.