https://bugs.winehq.org/show_bug.cgi?id=37115
Bug ID: 37115 Summary: Calling ReadFile from WINBASEAPI (WinBase.h) with zero read length causes hang Product: Wine Version: unspecified Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: robw@sagatech.ca
Our software connects to a serial device using USB-serial adapters. In the process of attempting to create a wrapper for use on OSx, I discovered a hang when I attempted to connect to the device under Wine that does not occur under Windows.
I have tracked it down to the WINBASEAPI ReadFile. Under Windows, if a zero value is passed as the length to read, it handles and returns zero. Under Wine, it causes a "black box" (meaning I can't trace it) hang.
I have worked around this in my code by including a return on zero value for the length, however believe it may be responsible for other serial issues I have seen in researching this problem.
https://bugs.winehq.org/show_bug.cgi?id=37115
Rob Willard robw@sagatech.ca changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |robw@sagatech.ca
https://bugs.winehq.org/show_bug.cgi?id=37115
Rob Willard robw@sagatech.ca changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ronp@sagatech.ca
https://bugs.winehq.org/show_bug.cgi?id=37115
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |hardware
--- Comment #1 from Ken Sharp imwellcushtymelike@gmail.com --- What version of Wine? http://wiki.winehq.org/Bugs
https://bugs.winehq.org/show_bug.cgi?id=37115
--- Comment #2 from Rob Willard robw@sagatech.ca --- (In reply to Ken Sharp from comment #1)
What version of Wine? http://wiki.winehq.org/Bugs
1.7.24
https://bugs.winehq.org/show_bug.cgi?id=37115
Rob Willard robw@sagatech.ca changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.7.24
https://bugs.winehq.org/show_bug.cgi?id=37115
--- Comment #3 from Rob Willard robw@sagatech.ca --- (In reply to Rob Willard from comment #2)
(I have updated the ticket)
https://bugs.winehq.org/show_bug.cgi?id=37115
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexhenrie24@gmail.com
--- Comment #4 from Alex Henrie alexhenrie24@gmail.com --- Created attachment 53650 --> https://bugs.winehq.org/attachment.cgi?id=53650 Test program
I can confirm this bug, and I'm attaching a test program that demonstrates the problem.
https://bugs.winehq.org/show_bug.cgi?id=37115
--- Comment #5 from Alex Henrie alexhenrie24@gmail.com --- Created attachment 53669 --> https://bugs.winehq.org/attachment.cgi?id=53669 Proposed patch
Here's the patch I sent to wine-patches for this issue. Alexandre's comment on it can be read at https://www.winehq.org/pipermail/wine-devel/2016-February/111714.html
https://bugs.winehq.org/show_bug.cgi?id=37115
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, patch, source Status|UNCONFIRMED |NEW CC| |dmitry@baikal.ru Component|-unknown |ntdll Ever confirmed|0 |1
--- Comment #6 from Alex Henrie alexhenrie24@gmail.com --- Changing status from UNCONFIRMED to NEW.
https://bugs.winehq.org/show_bug.cgi?id=37115
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |f35c1b2dc123a834d365e0ddb44 | |1370b22b97cbc Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #7 from Alex Henrie alexhenrie24@gmail.com --- Fixed by https://source.winehq.org/git/wine.git/commitdiff/f35c1b2dc123a834d365e0ddb4...
For the record, I tested this patch with `socat PTY,link=$HOME/.wine/dosdevices/com1,raw,echo=0 PTY,link=$HOME/.wine/dosdevices/com2,raw,echo=0` and `./wine dlls/kernel32/tests/kernel32_test.exe.so comm`
https://bugs.winehq.org/show_bug.cgi?id=37115
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@redhat.com Target Milestone|--- |1.8.x
https://bugs.winehq.org/show_bug.cgi?id=37115
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.5.
https://bugs.winehq.org/show_bug.cgi?id=37115
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.8.x |---
--- Comment #9 from Michael Stefaniuc mstefani@redhat.com --- Removing 1.8.x milestone from bugs included in 1.8.2.