Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004844OCaml~DO NOT USE (was: OCaml general)public2009-08-07 12:512012-03-24 15:01
ReporterChristoph Bauer 
Assigned Togildor 
PlatformOSOS Version
Product Version3.11.0 
Target VersionFixed in Version3.12.0+dev 
Summary0004844: bug (triggered if linked against threads)
DescriptionThe attached program fails, if compiled with
     ocamlopt -thread -o selectbug.exe unix.cmxa threads.cmxa
and runs, if compiled with
     ocamlopt -thread -o selectbug.exe unix.cmxa

If you run it, please type some input, because it makes a on stdin.
Additional InformationThere was a discussion on the mailing (8-July-2009) list about the problem.
TagsNo tags attached.
Attached Files? file icon [^] (522 bytes) 2009-08-07 12:51 [Show Content]
c file icon select.c [^] (29,650 bytes) 2009-08-10 10:18 [Show Content]

- Relationships

-  Notes
gildor (developer)
2009-08-07 13:28

Discussion is here [^]

Possible problem/solution:

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).
Christoph Bauer (reporter)
2009-08-10 10:17

The hinted solution seems to work. I'll attach a modified version of otherlibs/win32unix/select.c,
which solved the problems in and my original program. But beware, I haven't it tested very well.
Christoph Bauer (reporter)
2010-01-07 10:16

I use this patch (select.c) every day - and it works. So now I could say, it's well tested.
gildor (developer)
2010-05-25 15:21

Apply patch by C. Bauer, replace lpOrig by lpOrigIdx which can survive a GC collection

- Issue History
Date Modified Username Field Change
2009-08-07 12:51 Christoph Bauer New Issue
2009-08-07 12:51 Christoph Bauer File Added:
2009-08-07 13:28 gildor Note Added: 0005041
2009-08-10 10:17 Christoph Bauer Note Added: 0005042
2009-08-10 10:18 Christoph Bauer File Added: select.c
2010-01-07 10:16 Christoph Bauer Note Added: 0005219
2010-01-07 15:17 doligez Status new => acknowledged
2010-04-18 20:35 xleroy Status acknowledged => assigned
2010-04-18 20:35 xleroy Assigned To => gildor
2010-05-20 10:47 gildor Status assigned => confirmed
2010-05-25 15:21 gildor Note Added: 0005506
2010-05-25 15:21 gildor Status confirmed => resolved
2010-05-25 15:21 gildor Fixed in Version => 3.12.0+dev
2010-05-25 15:21 gildor Resolution open => fixed
2012-03-24 15:01 xleroy Status resolved => closed
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker