http://bugs.winehq.org/show_bug.cgi?id=25401
Summary: The Wine implementation of Winsock API (WSAStringToAddress) has a bug. Product: Wine Version: unspecified Platform: All OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winsock AssignedTo: wine-bugs@winehq.org ReportedBy: alfaar_alhazin@hotmail.com
According to MSDN description:
INT WSAStringToAddress( __in LPTSTR AddressString, __in INT AddressFamily, __in LPWSAPROTOCOL_INFO lpProtocolInfo, __out LPSOCKADDR lpAddress, __in_out LPINT lpAddressLength ); lpAddressLength Length of the Address buffer, in bytes. Returns the size of the resultant sockaddr structure. If the specified buffer is not large enough, the function fails with a specific error of WSAEFAULT and this parameter is updated with the required size in bytes.
when function call returns successfully, the parameter lpAddressLength should have already been updated to the correct size of the address (for example: 16 for IPv4 address, 28 for IPv6 address). During our tests, the Wine implementation doesn't update the parameter before its return. The parameter remains unchanged (the input value of the parameter is usually larger than 16, usually 128).
As reported at: http://www.bitspirit.cc/en/index.php?q=node/153 By BitSpirit Team
http://bugs.winehq.org/show_bug.cgi?id=25401
--- Comment #1 from Juan Lang juan_lang@yahoo.com 2010-12-02 16:46:20 CST --- Looks like an easy one to test, so I wrote a test case: https://testbot.winehq.org/JobDetails.pl?Key=7414
http://bugs.winehq.org/show_bug.cgi?id=25401
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #2 from Juan Lang juan_lang@yahoo.com 2010-12-02 17:26:28 CST --- The testbot results confirm the bug, although it isn't true on Win2k/NT4. The developers of BitSpirit might want to reconfirm that it runs on Win2k like they claim.
I'll send in a patch in a sec.
http://bugs.winehq.org/show_bug.cgi?id=25401
--- Comment #3 from Juan Lang juan_lang@yahoo.com 2010-12-02 17:34:38 CST --- Patch sent: http://www.winehq.org/pipermail/wine-patches/2010-December/096442.html
http://bugs.winehq.org/show_bug.cgi?id=25401
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.3.8 Summary|The Wine implementation of |WSAStringToAddress doesn't |Winsock API |update lpAddressLength on |(WSAStringToAddress) has a |success |bug. |
http://bugs.winehq.org/show_bug.cgi?id=25401
--- Comment #4 from alfaar_alhazin@hotmail.com 2010-12-02 23:34:00 CST --- (In reply to comment #3)
Patch sent: http://www.winehq.org/pipermail/wine-patches/2010-December/096442.html
Hello, Juan! Thank you for the quickest reply! :)
I've tried your patch. No luck for my problem.
I've compiled individual ws2_32.dll. Surprisingly, it md5sum against it and same of 1.3.7 do look alike. Test drive, with BitSpirit, shows the problem persists, thought I cannot confirm it at this time (that this is what causing improper behavior). Perhaps, if you have time, you could test-drive it yourself?
Also, I've noted that your proposed modifications are made at WSAStringToAddressA, while testing (not sure what it is for) is made at test_WSAStringToAddressW. Maybe I'm mistaken, but I believe there is a mistake. Perhaps similar modifications need to be applied to *W (unicode version), and testing performed by *A?
http://bugs.winehq.org/show_bug.cgi?id=25401
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Platform|All |Other
http://bugs.winehq.org/show_bug.cgi?id=25401
Juan Lang juan_lang@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2010-12-03 10:02:04 CST --- (In reply to comment #4)
I've tried your patch. No luck for my problem.
Oh? Try with today's git, the patch was committed (commit a273ce077e6eaee3313a36bfb22a89fdcbc073aa), just in case you didn't apply it correctly. But you didn't describe what your problem is, other than the problem with this function. That should be the subject of a new bug, if it persists.
Also, I've noted that your proposed modifications are made at WSAStringToAddressA, while testing (not sure what it is for) is made at test_WSAStringToAddressW. Maybe I'm mistaken, but I believe there is a mistake. Perhaps similar modifications need to be applied to *W (unicode version), and testing performed by *A?
The W version calls the A version in this case. (In general, calls in Wine go the other direction, but Unicode characters aren't allowed in IP addresses, so in this case it's fine.)
In any case, I'm marking this fixed. Please open a new bug for your problem, and describe what it is ;)
http://bugs.winehq.org/show_bug.cgi?id=25401
--- Comment #6 from Juan Lang juan_lang@yahoo.com 2010-12-03 10:02:37 CST --- (In reply to comment #5) Wrong commit id, it's fixed by commit 7f5583aee9f8ac782376f73c05049febec6f8049.
http://bugs.winehq.org/show_bug.cgi?id=25401
--- Comment #7 from alfaar_alhazin@hotmail.com 2010-12-03 11:06:27 CST --- http://www.bitspirit.cc/en/index.php?q=node/153#comment-4090
Proposed fix by BitSpirit team seams to be more accurate (as fixing the problem for both IPv4 and IPv6 versions). Please update your patch, if you can.
Also, I should say that you were right and I made a mistake. I built ws2_32 with make ws2_32.dll, but I copied *.fake file naively thinking it is changed something. Well, now I've rebuilt it according to BitSpirit's proposition, copied ws2_32.dll.so to /usr/lib32/wine, replacing the old one, and it works perfectly!
Thank you very much for your assistance! :)
http://bugs.winehq.org/show_bug.cgi?id=25401
--- Comment #8 from Juan Lang juan_lang@yahoo.com 2010-12-03 11:25:16 CST ---
Proposed fix by BitSpirit team seams to be more accurate (as fixing the problem for both IPv4 and IPv6 versions). Please update your patch, if you can.
Their change is logically identical in the success case. Again, I believe this is fixed in current git. Please retry with that.
http://bugs.winehq.org/show_bug.cgi?id=25401
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2010-12-10 13:46:41 CST --- Closing bugs fixed in 1.3.9.
http://bugs.winehq.org/show_bug.cgi?id=25401
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.2.x
http://bugs.winehq.org/show_bug.cgi?id=25401
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.2.x |---
https://bugs.winehq.org/show_bug.cgi?id=25401
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |7f5583aee9f8ac782376f73c050 | |49febec6f8049 CC| |focht@gmx.net Hardware|Other |x86