Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004801OCamlOCaml generalpublic2009-05-21 13:332014-01-03 01:36
Reportershinwell 
Assigned Toshinwell 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.11.0 
Target VersionFixed in Version 
Summary0004801: calls to lseek() don't release the runtime lock
DescriptionThere are various calls to lseek() in the runtime, and none of these currently release the runtime lock. I have witnessed this causing the runtime to block for unacceptable periods when the seek is occurring on an NFS mount whose server is heavily loaded.

I'm currently testing the attached patch. I'm guessing this might be too late for 3.11.1, but it would be great if the issue could be fixed there.

This patch has two consequences which affect the runtime's behaviour: first, it is of course now possible for a Caml thread context switch to occur in the middle of the affected channel functions. I don't think this is going to affect anything except code that is potentially broken anyway. Secondly, along the same lines, it is now necessary to take care with the Bigarray memory-mapping function to ensure that the fd being mmapped isn't disrupted in some way by a Caml function in another thread during [caml_ba_map_file]. This seems a reasonable restriction -- after all, you could as it is just truncate the file from some other C thread which would have a similar effect even without this patch.
TagsNo tags attached.
Attached Filesdiff file icon lseek.diff [^] (6,510 bytes) 2009-05-21 13:33 [Show Content]

- Relationships
related to 0006276resolveddim BLocking stubs not releasing the runtime in stdlib and unix 

-  Notes
(0005236)
yminsky (reporter)
2010-01-29 13:37

This patch has been here a long time. Is it going to make its way into a release? We're currently maintaining our own patch, and would prefer to get it merged.
(0005285)
shinwell (developer)
2010-04-01 09:38

I have merged this to Caml trunk; it should be in the next release.

- Issue History
Date Modified Username Field Change
2009-05-21 13:33 shinwell New Issue
2009-05-21 13:33 shinwell File Added: lseek.diff
2009-05-26 17:32 doligez Status new => acknowledged
2010-01-29 13:37 yminsky Note Added: 0005236
2010-03-30 13:03 shinwell Status acknowledged => assigned
2010-03-30 13:03 shinwell Assigned To => shinwell
2010-04-01 09:38 shinwell Note Added: 0005285
2010-04-01 09:38 shinwell Status assigned => resolved
2010-04-01 09:38 shinwell Resolution open => fixed
2011-05-29 12:19 xleroy Status resolved => closed
2014-01-03 01:36 yallop Relationship added related to 0006276


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker