Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005783OCamlOCaml windowspublic2012-10-10 15:572014-07-30 23:02
Reportervouillon 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.00.1 
Target Versionafter-4.02.0Fixed in Version 
Summary0005783: Unix.select returns immediately when waiting for the completion of a non-blocking socket connection
DescriptionThe C function [select_data_dispatch] checks whether the socket is connected, and systematically consider that the socket is ready when it is not connected.

Thus, when this function is involved, there is no way to wait for the completion of a non-blocking socket connection.

Since OCaml 4, there is a fast path when all file descriptors are sockets. Hence, the bug only occurs when we are also selecting file descriptors of a different kind.

The attached piece of code reproduces the bug.
Tagspatch
Attached Files? file icon bug.ml [^] (761 bytes) 2012-10-10 15:57 [Show Content]

- Relationships

-  Notes
(0008241)
vouillon (reporter)
2012-10-10 17:14

Maybe the check in [select_data_dispatch] can just be removed? The consequence would be that a non-connected socket will never be reported as ready by [Unix.select] (contrary to what happens under Unix). But this is already the case with the Winsock implementation of [select], which is used when [Unix.select] is called only with sockets...

- Issue History
Date Modified Username Field Change
2012-10-10 15:57 vouillon New Issue
2012-10-10 15:57 vouillon File Added: bug.ml
2012-10-10 17:14 vouillon Note Added: 0008241
2013-01-03 16:37 doligez Status new => acknowledged
2013-01-03 16:37 doligez Target Version => 4.00.2+dev
2013-07-11 17:59 doligez Target Version 4.00.2+dev => 4.01.0+dev
2013-08-19 15:41 doligez Target Version 4.01.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-30 23:02 doligez Tag Attached: patch
2014-07-30 23:02 doligez Target Version 4.02.0+dev => after-4.02.0


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker