[Bug 59893] New: ws2_32: libcurl uploads throttled to ~140 KB/s
http://bugs.winehq.org/show_bug.cgi?id=59893 Bug ID: 59893 Summary: ws2_32: libcurl uploads throttled to ~140 KB/s Product: Wine Version: 11.10 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winsock Assignee: wine-bugs@list.winehq.org Reporter: wine-bugtrack@forryan.co.uk Distribution: --- Created attachment 81216 --> http://bugs.winehq.org/attachment.cgi?id=81216 Standalone C reproducer: select() writability vs send() acceptance Overview Single-stream uploads from a libcurl-based application run far slower under Wine than on Windows; roughly 140 KB/s regardless of available bandwidth. Found with Backblaze Personal Backup (its bztransmit uploader uses libcurl), where a large backup checkpoint could not finish within the client’s 600s upload timeout. The same operation completes in ~80s with the socket behaviour corrected. Steps to reproduce (self-contained; no application or account needed) A minimal reproducer is attached (sock_writable_test.c). It: 1. Creates a connected loopback TCP pair and sets the sender non-blocking. 2. Without ever reading from the receiver, repeatedly does a zero-timeout select() for writability on the sender, then a send() of a small buffer. 3. Counts iterations where select() reported the socket NOT writable yet the following send() still succeeded. Build: x86_64-w64-mingw32-gcc -O2 -o sockw.exe sock_writable_test.c -lws2_32 Run: wine sockw.exe Actual results On unmodified Wine (built from official source, ./configure && make, clean WINEPREFIX): the sender shows many iterations where select() reports not-writable while send() still succeeds (e.g. ~230 of ~660 sends), and the program prints FAIL. A real libcurl uploader that does a select() writability pre-check before waiting on FD_WRITE therefore stalls on its poll timeout between bursts. Expected results On Windows, the same program reports zero such iterations (PASS): select() reports a connected stream socket writable whenever send() would still accept data. Wine should match this. Analysis Wine appears to derive writability from the host poll(), and on Linux POLLOUT is only set once the send queue drains below ~2/3 of SO_SNDBUF, whereas Windows reports writable while the send buffer has any room. A fix and a ws2_32:sock conformance test are being submitted via a merge request. Environment * Wine: 11.10 Unmodified, built from official source (no Staging, no third-party wrapper, no DLL overrides, clean ~/.wine). * Distribution/architecture: Ubuntu 24.04, x86_64 * WINEARCH win64/64-bit prefix. See also curl issue #6146 (“Poor upload performance in Windows”) https://github.com/curl/curl/issues/6146 and https://github.com/curl/curl/pull/5634 - the Windows FD_WRITE/select-writability semantics involved. Bug 41379 (https://bugs.winehq.org/show_bug.cgi?id=41379) is the read-side (FD_READ) analogue; this is the write side. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59893 --- Comment #1 from Martyn Forryan <wine-bugtrack@forryan.co.uk> --- Created attachment 81217 --> http://bugs.winehq.org/attachment.cgi?id=81217 Test output: Windows PASS / unmodified Wine FAIL / patched PASS -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59893 --- Comment #2 from Martyn Forryan <wine-bugtrack@forryan.co.uk> --- sock_writable_test.c: Standalone reproducer (C, build with x86_64-w64-mingw32-gcc -o sockw.exe sock_writable_test.c -lws2_32). Fills a non-blocking, never-drained loopback TCP socket and counts steps where select() reports the socket not-writable while send() still accepts data. Prints PASS (0 violations) on Windows; FAIL on unmodified Wine. ws2_32-sock-test-output.txt: Captured test output across real Windows, unmodified Wine 11.10, and patched Wine using both the standalone reproducer and the in-tree ws2_32:sock test (test_send_writability). The writability invariant holds on Windows (0 violations) but is violated on unmodified Wine (~230 of ~660 sends report not-writable while send still succeeds), and holds again once the server/sock.c fix is applied. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59893 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla