caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Unix.Unix_error(31, "write", "") raised from format.ml!? This is not right.
Date: Wed, 09 Mar 2011 00:17:22 +0100	[thread overview]
Message-ID: <1299626242.30035.229.camel@thinkpad> (raw)
In-Reply-To: <4D769F8E.9000803@inria.fr>

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
------------------------------------------------------------


      reply	other threads:[~2011-03-08 23:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08  2:17 Arlen Cuss
2011-03-08  2:22 ` Arlen Cuss
2011-03-08 14:35 ` Gerd Stolpmann
     [not found] ` <1001695803.480327.1299594992792.JavaMail.root@zmbs4.inria.fr>
2011-03-08 21:28   ` Fabrice Le Fessant
2011-03-08 23:17     ` Gerd Stolpmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1299626242.30035.229.camel@thinkpad \
    --to=info@gerd-stolpmann.de \
    --cc=Fabrice.Le_fessant@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).