|Anonymous | Login | Signup for a new account||2017-10-19 07:19 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000150||OCaml||~DO NOT USE (was: OCaml general)||public||2000-06-27 21:20||2000-07-25 17:36|
|Status||closed||Resolution||no change required|
|Target Version||Fixed in Version|
|Summary||0000150: Unix.write loops forever|
|Description||Full_Name: Georges Brun-Cottan|
Version: 2.99 and 3.00
OS: SunOS 5.6
Submission from: los0150.lss.emc.com (220.127.116.11)
On Solaris, writing on a raw device beyond its capacity hangs the process.
Choose a unused raw device. Issue write above its capacity.
Process will hang.
1) Writing on a raw device beyond its capacity returns 0 (with no error) on
2) Caml wraps the Unix write in a loop that terminate either on error or when
requested bytes have been written (write.c:unix_write).
The easiest fix would be to suppress the loop, although it might possibly break
some existing code relying on the "atomicity" of the write (Is such a code
this is not provided by Unix...).
|Tags||No tags attached.|
> On Solaris, writing on a raw device beyond its capacity hangs the process.
> Internal Reason:
> 1) Writing on a raw device beyond its capacity returns 0 (with no error) on
This is unfortunate, because it doesn't conform with the Single Unix
Specification (Unix98): write() should either return a number > 0
if some bytes were written, or the ENOSPC error otherwise. This said,
raw disk partitions aren't explicitly covered by the spec, so...
> The easiest fix would be to suppress the loop, although it might
> possibly break some existing code relying on the "atomicity" of the
> write (Is such a code exist? this is not provided by Unix...).
The main problem is that Unix.write is declared as returning "unit"
rather than "int", so the application wouldn't be informed of a short
write. The reason for this and for the loop was to simplify the
application, which doesn't have to check for short writes. On the
other hand, it's questionable, since when the application
gets an ENOSPC error, it doesn't know whether some bytes have been
written or not.
Thanks for the bug report. I don't promise to fix it immediately, but
I'll keep it in mind.
- Xavier Leroy
Solaris bug (at least w.r.t. the Single Unix Specification). Still, the type of
Unix.write is questionable.
|2005-11-18 10:13||administrator||New Issue|
|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|