You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 425 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello, this is a bug report of
Objective Caml version 3.01+4 (2001-06-18).
(Am I encouraged to post reports of +n versions ?)
The following simple "folk-exec-cat" with thread does not work
correctly in this version of O'Caml. The program receives EOF
before cat finishes printing all the content.
I verified that with the official version of ocaml 3.01,
the program works correctly.
Hello, this is a bug report of
Objective Caml version 3.01+4 (2001-06-18).
(Am I encouraged to post reports of +n versions ?)
Yes! Very much encouraged! It's better to catch bugs before the releases...
The following simple "folk-exec-cat" with thread does not work
correctly in this version of O'Caml. The program receives EOF
before cat finishes printing all the content.
I verified that with the official version of ocaml 3.01,
the program works correctly.
Interesting. The new thread-safe reimplementation of the Unix module
(provided by the bytecode threads library) is indeed buggy, because
the process forked by open_process_* has its standard descriptors
still in non-blocking mode, which causes problems with most programs.
Actually, this exposes another bug that has been here for a long time:
when a threaded program calls Unix.exec*, the standard descriptors are
left in non-blocking mode, with equally bad consequences.
I have fixed both issues by simply resetting the standard descriptors
to blocking mode in the exec* functions, which are also called by
open_process_*.
Original bug ID: 425
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hello, this is a bug report of
Objective Caml version 3.01+4 (2001-06-18).
(Am I encouraged to post reports of +n versions ?)
The following simple "folk-exec-cat" with thread does not work
correctly in this version of O'Caml. The program receives EOF
before cat finishes printing all the content.
I verified that with the official version of ocaml 3.01,
the program works correctly.
(* compile:
ocamlc -thread -custom -o threadtest unix.cma threads.cma threadtest.ml *)
open ThreadUnix
let cat_some_long_file = (* Works for cristal machines *)
"cat /net/pauillac/infosystems/www/caml/users_comments-eng.html"
let ic = open_process_in cat_some_long_file
let _ =
try
while true do
prerr_endline (input_line ic)
done
with _ ->
close_in ic
--
JPF
The text was updated successfully, but these errors were encountered: