From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p28NHWm3010865 for ; Wed, 9 Mar 2011 00:17:32 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApQFAD1Idk3U4xEKkGdsb2JhbACELKIuDRUBAQEBCQkMBxEDIrAUkSsCgSWDRnYEiAeHcoIj X-IronPort-AV: E=Sophos;i="4.62,286,1297033200"; d="scan'208";a="101649108" Received: from moutng.kundenserver.de ([212.227.17.10]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Mar 2011 00:17:26 +0100 Received: from office1.lan.sumadev.de (dslb-188-107-222-170.pools.arcor-ip.net [188.107.222.170]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MXTpy-1PQfsQ3gG6-00W3Ud; Wed, 09 Mar 2011 00:17:25 +0100 Received: from [192.168.0.29] (dslb-084-058-007-174.pools.arcor-ip.net [84.58.7.174]) by office1.lan.sumadev.de (Postfix) with ESMTPA id 7036A5F701; Wed, 9 Mar 2011 00:17:24 +0100 (CET) From: Gerd Stolpmann To: Fabrice Le Fessant Cc: caml-list@inria.fr In-Reply-To: <4D769F8E.9000803@inria.fr> References: <1299550636.21350.49.camel@azayaka> <1001695803.480327.1299594992792.JavaMail.root@zmbs4.inria.fr> <4D769F8E.9000803@inria.fr> Content-Type: text/plain; charset="UTF-8" Date: Wed, 09 Mar 2011 00:17:22 +0100 Message-ID: <1299626242.30035.229.camel@thinkpad> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:v/P1cPPepj20Zl/OeX3TQE0o9PuJJB8KnOI7nJ0C45G F/LTglLbNMKd7aCyLcQSja09rgY3PwY9DUslHiDaLABzFCKcHy PZZSuUqBt2q3qVE6MOkCcoBHW4RPlDRVfELpY4awjDnUBILJmf CNe9XAY47mwXPf2Y1i4Bt8Ds3zw3GJnEdaHy/ezYYZsPB1FnsT v2c4peJ6kxW5hSmYctEfw== Subject: Re: [Caml-list] Unix.Unix_error(31, "write", "") raised from format.ml!? This is not right. Am Dienstag, den 08.03.2011, 22:28 +0100 schrieb Fabrice Le Fessant: > You can also define a printer for the exception Unix_error, once and for > all. > > let _ = > Printexc.register_printer (fun exn -> > match exn with > Unix.Unix_error (error, s1, s2) -> > Some (Printf.sprintf "Unix_error(%s, %s, %s)" > (Unix.error_message error) s1 s2) > | _ -> None) > ;; > > It would probably be a good idea to include this code directly in the > Unix module of the distribution, no ? If it was not Unix.error_message but just the code (I rather like to read "EPIPE" in log files and not a - possibly localized - error message). Btw, such code is included in Ocamlnet. Well, requirements differ. Gerd > --Fabrice > > On 03/08/2011 03:36 PM, Gerd Stolpmann wrote: > > Am Dienstag, den 08.03.2011, 13:17 +1100 schrieb Arlen Cuss: > > > >> Exception Unix.Unix_error(31, "write", "") occurred > >> Exception Unix.Unix_error(56, "write", "") occurred > >> > >> Both are occurring with the same reported backtrace; the former is Unix > >> error EMLINK (too many links), the latter EISCONN (socket is connected); > >> the strange thing is that *neither* of these errors should be throwable > >> on a write() call! > > > > That's not quite correct. > > > > Error 31 is EPIPE. Error 56 is ECONNRESET. You can easily find out by > > typing in the toploop: > > > > # (Obj.magic 31: Unix.error);; > > - : Unix.error = Unix.EPIPE > > # (Obj.magic 56: Unix.error);; > > - : Unix.error = Unix.ECONNRESET > > > > The error numbers are not the official Unix ones, but something that > > ocaml uses internally. > > > > Gerd > > > > > >> > >> I've ensured I'm correctly compiling with debug info, so I'm a bit lost. > >> I can only assume a sprintf or similar call somewhere is going haywire. > >> > >> Anyone seen anything like this before? > >> > >> Best, > >> Arlen > >> > >> > > > > > -- ------------------------------------------------------------ Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------