[Bug 58122] New: WSAENOTSOCK error when calling winsock.Send() on duplicated socket
http://bugs.winehq.org/show_bug.cgi?id=58122 Bug ID: 58122 Summary: WSAENOTSOCK error when calling winsock.Send() on duplicated socket Product: Wine-staging Version: 10.4 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: digitman63(a)gmail.com CC: leslie_alistair(a)hotmail.com, z.figura12(a)gmail.com Distribution: --- Process A creates a listening socket, accepts an incoming connection, and obtains a socket handle hSock. Process A spawns Process B with the InheritHandles flag, passing its own ProcessID and the socket handle hSock as command-line arguments. Process B calls OpenProcess() to get a handle hSrcProcess for the given ProcessID, then duplicates hSock into hDupSock using DuplicateHandle(hSrcProcess, hSock, GetCurrentProcess(), &hDupSock, ...); Process B successfully receives data from the duplicated socket using winsock.recv(hDupSock, ...). Process B attempts to send data via winsock.send(hDupSock, ...), but the call fails with WSAENOTSOCK (10038) ("Socket operation on non-socket"). Process B then tries sending the same data using kernel32.WriteFile(hDupSock, ...), and this operation succeeds. Why does send() fail while WriteFile() works on the same duplicated handle? -- 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=58122 --- Comment #1 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- Created attachment 78383 --> http://bugs.winehq.org/attachment.cgi?id=78383 patch Does the attached patch help? -- 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=58122 --- Comment #2 from digitman <digitman63(a)gmail.com> --- The attached patch refers to a UDP socket, in my case it is a TCP socket -- 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=58122 --- Comment #3 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- (In reply to digitman from comment #2)
The attached patch refers to a UDP socket, in my case it is a TCP socket
Attached patch is not specific to any socket type. Did you test it? -- 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=58122 --- Comment #4 from digitman <digitman63(a)gmail.com> --- No, i didn't.. Yes, it looks like this patch really does fix the problem, which makes it even more unclear why it hasn't been applied to Staging yet. -- 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=58122 --- Comment #5 from digitman <digitman63(a)gmail.com> --- My scenario is typical for the work of the Embarcadero Rad Studio PAServer remote debugger - in a remote debugging session of a Win32 application, it launches two RmtDbgXXX.exe processes sequentially, the first process creates a listening socket, accepts an incoming TCP connection and passes the TCP socket to the second process to implement exchange with PAClient as part of the client part of the distributed debugger. Due to this issue, remote debugging sessions are fundamentally impossible in any version of Wine. -- 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=58122 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Keywords| |patch --- Comment #6 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- I sent a patch https://gitlab.winehq.org/wine/wine/-/merge_requests/7845 however it was rejected. -- 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=58122 --- Comment #7 from digitman <digitman63(a)gmail.com> --- (In reply to Dmitry Timoshkov from comment #6)
I sent a patch https://gitlab.winehq.org/wine/wine/-/merge_requests/7845 however it was rejected.
imho the refusal was logical - the patch looks like a crutch -- 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=58122 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |a08d6d8be08b9408bd61d5a5c0f | |38b4c65c20ac0 Status|NEW |RESOLVED Keywords|patch | --- Comment #8 from Dmitry Timoshkov <dmitry(a)baikal.ru> --- This should be fixed by a08d6d8be08b9408bd61d5a5c0f38b4c65c20ac0. -- 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=58122 Ken Sharp <imwellcushtymelike(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |winsock Product|Wine-staging |Wine -- 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=58122 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #9 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 10.13. -- 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