Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calls to stat() don't release the runtime lock #4995

Closed
vicuna opened this issue Mar 8, 2010 · 7 comments
Closed

calls to stat() don't release the runtime lock #4995

vicuna opened this issue Mar 8, 2010 · 7 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Mar 8, 2010

Original bug ID: 4995
Reporter: furuse
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2015-12-11T18:27:46Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.2
Target version: 4.02.0+dev
Fixed in version: 4.02.0+beta1 / +rc1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Duplicate of: #6276
Monitored by: "Pascal Cuoq" @mmottl

Bug description

It is as same as the case #4801 (#4801), 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.

File attachments

@vicuna
Copy link
Author

vicuna commented Mar 8, 2010

Comment author: @mmottl

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.

@vicuna
Copy link
Author

vicuna commented Mar 9, 2010

Comment author: furuse

Thanks Markus. I just thought wrapping caml_{enter,leave}_blocking_section do the job but it is wrong.

@vicuna
Copy link
Author

vicuna commented Mar 9, 2010

Comment author: @mmottl

No problem, welcome to the subtleties of the OCaml runtime... ;-)

@vicuna
Copy link
Author

vicuna commented Sep 16, 2011

Comment author: @mmottl

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.

@vicuna
Copy link
Author

vicuna commented Jun 6, 2013

Comment author: @alainfrisch

Postponing and reducing severity, since nobody seems overly worried by the problem these days.

@vicuna
Copy link
Author

vicuna commented Sep 23, 2013

Comment author: furuse

I reported it behalf of Jane Street, please ask them about how really they want it now.

@vicuna
Copy link
Author

vicuna commented Feb 8, 2014

Comment author: @yallop

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants