https://bugs.winehq.org/show_bug.cgi?id=55232
Bug ID: 55232 Summary: Sierra Chart (All versions): Out of order overlapped network I/O receive buffers Product: Wine Version: 6.0.3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: winsock Assignee: wine-bugs@winehq.org Reporter: sc@sierrachart.com Distribution: ---
Created attachment 74837 --> https://bugs.winehq.org/attachment.cgi?id=74837 Terminal output
We have a code which is working fine for years on Windows OS, but on Linux using Wine it produces an IO error. Investigation shows that IO Completion/Overlapped of Wine provides some buffers with received data out of order. Our code relies on correct order of the received buffers.
Our code provides to OS some minimum number of buffers available to receive a data. We expect the FIFO logic of the buffer processing: the first provided available buffer will first receive the data.
Invoke `WSARecv` with a buffer to receive data. The operation is overlapped using Completion Port. In a worker thread the function `GetQueuedCompletionStatus` is used to get the completion notification about received data in the buffer. At this point we observe a buffer, received out of order. Usually it is happened at beginning of handling buffers: we provide to OS some set of buffers (in common 16), handle all of them with received data, reuse available buffers again to OS to support the minimum set of buffers for OS and most probably the first (or close to first) reused buffer will be received out of the order. Also we observe the out-of-order buffer is returned in the same time slot as it was issued to OS.
Relevant WindowsOS functions used: CreateIoCompletionPort WSARecv GetQueuedCompletionStatus
Download link: https://www.sierrachart.com/downloads/ZipFiles/SierraChart2522.zip