New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inadequate exception thrown when creating IPv6 socket on win32/msvc #5398
Comments
Comment author: ripoche With this patch applied, the same snippet raises the following exception : |
Comment author: @protz So this means that OCaml is unable to open PF_INET6 sockets? How complicated would it be to make sure ipv6 sockets are supported on win32? You mention requiring Winsocks2, is that a difficult requirement to match? |
Comment author: ripoche There are 2 issues with the current implementation:
I did a quick port to WinSock2 while investigating bug #5416 to rule out issues that could stem from mixing WinSock 1 and 2. It did compile and run fine and as a nice bonus simplified a few files (socket.c and accept.c). Note that I didn't run any extensive checks and never tried to create an IPv6 socket with the patch applied (it's not installed on my XP box anyway). I also reverted the patch to complete the investigation on bug #5416. |
Comment author: @xavierleroy I agree the patch should be applied ASAP, to avoid the out-of-bound access. As concerns switching to WinSock2: it's something to be considered. What is the oldest version of Windows that supports WinSock2? |
Comment author: ripoche From what I gathered, the early bundled versions of Winsock2 were available starting with Win98. According to the MSDN, the full feature set is available starting with Win2K (http://msdn.microsoft.com/en-us/library/windows/desktop/ms742213%28v=vs.85%29.aspx). |
Comment author: @protz Applied both on trunk and on branch as r12104 and r12105 I would be happy to review and try a patch that transitions all the code to winsocks2. |
Comment author: ripoche Would a patch based on the official 3.12.1 release be ok ? |
Comment author: @protz I don't think we want such a major change to land on a release branch. 3.12.x releases are supposed to be bugfix-only releases; there is a big potential for regressions, so I do believe it's best to apply this to trunk and let it bake for a little while :) |
Comment author: @damiendoligez As far as I can tell, the bug reported above is now fixed, and we are considering switching to winsock2 and supporting IPv6. If that is correct, someone please set the target version to 4.01 (protz?). |
Comment author: @protz Ok, so I just discussed this with Damien, and supporting AF_INET6 is indeed something we want to do. However, we chose not to do it for the upcoming 4.00.0 release, since the potential for breakage seems rather high. |
git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.12@12105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Original bug ID: 5398
Reporter: ripoche
Assigned to: @protz
Status: closed (set by @xavierleroy on 2015-12-11T18:07:10Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.1
Target version: 4.01.0+dev
Fixed in version: 4.00.0+dev
Category: platform support (windows, cross-compilation, etc)
Child of: #5676
Monitored by: @protz
Bug description
Unix.socket Unix.PF_INET6 Unix.SOCK_STREAM 0
fails with the following exception on win32/msvc :
Exception: Unix.Unix_error (EUNKNOWNERR 0, "socket", "")
otherlibs/win32unix/socket.c fails does not deal with PF_INET6 and happily accesses data outside the socket_type_table array.
File attachments
The text was updated successfully, but these errors were encountered: