From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA11775; Fri, 28 May 2004 12:26:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA09627 for ; Fri, 28 May 2004 12:26:20 +0200 (MET DST) Received: from waco.inria.fr (waco.inria.fr [128.93.25.2]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4SAQFEV005136; Fri, 28 May 2004 12:26:16 +0200 Received: from waco.inria.fr (localhost [127.0.0.1]) by waco.inria.fr (8.12.10/8.12.10) with ESMTP id i4SAQFPU031230; Fri, 28 May 2004 12:26:15 +0200 Received: (from verlyck@localhost) by waco.inria.fr (8.12.10/8.12.10/Submit) id i4SAQFmR031229; Fri, 28 May 2004 12:26:15 +0200 Date: Fri, 28 May 2004 12:26:15 +0200 Message-Id: <200405281026.i4SAQFmR031229@waco.inria.fr> To: jgoerzen@complete.org CC: caml-list@inria.fr In-reply-to: <20040527193823.GA12789@excelhustler.com> (jgoerzen@complete.org) Subject: Re: [Caml-list] Cash broken? From: Bruno.Verlyck@inria.fr References: <20040527193823.GA12789@excelhustler.com> Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Fri_May_28_12:26:09_2004-1" Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 40B713C7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 3.07:01 camlp:01 3.07:01 descriptor:01 descriptor:01 backtrace:01 truss:01 strace:01 pervasives:01 1.48:01 1.48:01 varies:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --Multipart_Fri_May_28_12:26:09_2004-1 Content-Type: text/plain; charset=US-ASCII Date: Thu, 27 May 2004 14:38:23 -0500 From: John Goerzen Hi John, I tried this example straight from the docs: $ cashtop Objective Caml version 3.07+2 Camlp4 Parsing version 3.07+2 # open Cash;; # run_with_strings (fun () -> exec_path "ls" []);; Exception: Sys_error "Bad file descriptor". # Exception: Sys_error "Bad file descriptor". I can't make any of the run_with_* that I've tried work, whether in my programs or with cashtop. Ideas? (Cash 0.20) Not a lot with so little info (of course it works here). Would you mind sending me more OS details ? A backtrace would be very useful, and/or the result of trace/truss/strace -f ? That said, what comes to mind is that the behavior of close_{in,out} has changed in Pervasives over the last versions of Caml. I wrote some (too many) lines of code to make Cash.close_{in,out} work anyway. I see in the CVS log that there was a change related to that, some time after 3.07 (see the attached patch). You could try it, or even try the entire CVS version of Cash. Bruno. --Multipart_Fri_May_28_12:26:09_2004-1 Content-Type: text/plain; charset=US-ASCII Index: io_3_2.ml =================================================================== RCS file: /net/pauillac/caml/repository/cash/io_3_2.ml,v retrieving revision 1.47 retrieving revision 1.48 diff -c -a -r1.47 -r1.48 *** io_3_2.ml 2002/08/05 17:07:37 1.47 --- io_3_2.ml 2002/12/05 17:37:52 1.48 *************** *** 116,126 **** Some fd -> let res = low_close_fd fd in (* low_close_fd will tell it. *) do { ! close_any any_chan; (* Never raise exception in the current implementation. *) res } ] in (fun ichan -> close (anychan_of_ichan ichan), fun ochan -> do { flush ochan; close (anychan_of_ochan ochan) }) ; --- 116,129 ---- Some fd -> let res = low_close_fd fd in (* low_close_fd will tell it. *) do { ! (* Used to raise no exception, but this varies between implementations... *) ! try close_any any_chan with [ Sys_error "Bad file descriptor" -> () ]; res } ] in (fun ichan -> close (anychan_of_ichan ichan), + (* Current religion says: flush do nothing on a closed channel. *) + (* Current implication is: if an unflushed channel's fd is closed, it's an error. *) fun ochan -> do { flush ochan; close (anychan_of_ochan ochan) }) ; --Multipart_Fri_May_28_12:26:09_2004-1-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners