Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004995OCamlOCaml generalpublic2010-03-08 04:482014-02-08 12:50
Assigned Toshinwell 
PlatformOSOS Version
Product Version3.11.2 
Target Version4.01.1+devFixed in Version 
Summary0004995: calls to stat() don't release the runtime lock
DescriptionIt is as same as the case 0004801 ( [^]), for stat, lstat and fstat.

There are calls of stat functions in the runtime and unix library which do not release the runtime lock, They may cause the runtime to block if the target files are in NFS mounts and the server is heavily loaded.

The patch wraps the calls of stats in otherlibs/unix/stat.c and byterun/sys.c so that they could release the lock.

There are some other stat calls but I did not wrap them since:

  The other calls in byterun are for startup, I guess.
  otherlibs/threads/scheduler.c has a fstat(), but it is in the heart of the scheduler.

Attached Filespatch file icon 006-stat.patch [^] (2,663 bytes) 2010-03-08 04:48 [Show Content]

- Relationships
duplicate of 0006276resolveddim BLocking stubs not releasing the runtime in stdlib and unix 

-  Notes
mottl (reporter)
2010-03-08 17:45

Please disregard the patch, it contains several memory-handling bugs. We will submit a new one soon, which will also address locking problems with other system calls.
furuse (reporter)
2010-03-09 01:41

Thanks Markus. I just thought wrapping caml_{enter,leave}_blocking_section do the job but it is wrong.
mottl (reporter)
2010-03-09 07:01

No problem, welcome to the subtleties of the OCaml runtime... ;-)
mottl (reporter)
2011-09-16 02:39

Just pinging - Mark, any chance this can be fixed in the next OCaml release? Jane Street Core handles this particular problem correctly, it seems. Though I'd recommend avoiding "stat64", etc., which seem to have become deprecated function calls on both Linux and Mac OS X.
frisch (developer)
2013-06-06 22:57

Postponing and reducing severity, since nobody seems overly worried by the problem these days.
furuse (reporter)
2013-09-23 12:49

I reported it behalf of Jane Street, please ask them about how really they want it now.
yallop (developer)
2014-02-08 12:50

This has been fixed by diml's patch for 6276.

- Issue History
Date Modified Username Field Change
2010-03-08 04:48 furuse New Issue
2010-03-08 04:48 furuse File Added: 006-stat.patch
2010-03-08 17:45 mottl Note Added: 0005261
2010-03-09 01:41 furuse Note Added: 0005267
2010-03-09 07:01 mottl Note Added: 0005268
2010-03-30 13:02 shinwell Status new => assigned
2010-03-30 13:02 shinwell Assigned To => shinwell
2011-09-16 02:39 mottl Note Added: 0006125
2012-07-04 17:14 doligez Target Version => 4.00.0+dev
2012-07-12 14:03 doligez Target Version 4.00.0+dev => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-06 19:22 frisch Target Version 4.00.1+dev => 4.00.2+dev
2013-06-06 22:57 frisch Note Added: 0009424
2013-06-06 22:57 frisch Severity major => minor
2013-06-06 22:57 frisch Target Version 4.00.2+dev => 4.02.0+dev
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev
2013-09-04 21:14 doligez Tag Attached: patch
2013-09-23 12:49 furuse Note Added: 0010397
2014-02-08 12:49 yallop Relationship added duplicate of 0006276
2014-02-08 12:50 yallop Note Added: 0010916

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker