You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4844 Reporter: Christoph Bauer Assigned to: gildor Status: closed (set by @xavierleroy on 2012-03-24T14:01:02Z) Resolution: fixed Priority: normal Severity: minor Version: 3.11.0 Fixed in version: 3.12.0+dev Category: ~DO NOT USE (was: OCaml general) Monitored by:@ygrek gildor
Bug description
The attached program fails, if compiled with
ocamlopt -thread -o selectbug.exe unix.cmxa threads.cmxa selectbug.ml
and runs, if compiled with
ocamlopt -thread -o selectbug.exe unix.cmxa selectbug.ml
If you run it, please type some input, because it makes a Unix.select on stdin.
Additional information
There was a discussion on the mailing (8-July-2009) list about the problem.
I use "lpOrig = (void *)fd;" where fd is an OCaml value (in select.c). Without thread and during the enter/leave_blocking_section(), there is less chance to trigger the GC and to modify "fd" value. This is the reason why it seems correct without thread and fall into a bug with thread.
The obvious solution is to replace "lpOrig = (void *)fd" by a non-OCaml value (e.g. EMode + nth in ocaml list).
The hinted solution seems to work. I'll attach a modified version of otherlibs/win32unix/select.c,
which solved the problems in selectbug.ml and my original program. But beware, I haven't it tested very well.
Original bug ID: 4844
Reporter: Christoph Bauer
Assigned to: gildor
Status: closed (set by @xavierleroy on 2012-03-24T14:01:02Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @ygrek gildor
Bug description
The attached program fails, if compiled with
ocamlopt -thread -o selectbug.exe unix.cmxa threads.cmxa selectbug.ml
and runs, if compiled with
ocamlopt -thread -o selectbug.exe unix.cmxa selectbug.ml
If you run it, please type some input, because it makes a Unix.select on stdin.
Additional information
There was a discussion on the mailing (8-July-2009) list about the problem.
File attachments
The text was updated successfully, but these errors were encountered: