From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p282MrSs018817 for ; Tue, 8 Mar 2011 03:22:53 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar8QAGQhdU2t/9A2/2dsb2JhbACEK5QkjXsNdKxXSJEjgSeDRXYEj3iCIQ X-IronPort-AV: E=Sophos;i="4.62,281,1297033200"; d="scan'208";a="77310143" Received: from sairyx.org ([173.255.208.54]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Mar 2011 03:22:47 +0100 Received: by sairyx.org (Postfix, from userid 5001) id CAB5C4801D; Tue, 8 Mar 2011 02:22:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sairyx.org X-Spam-Level: Received: from [192.168.200.106] (203-206-182-151.perm.iinet.net.au [203.206.182.151]) (Authenticated sender: celtic@sairyx.org) by sairyx.org (Postfix) with ESMTPSA id 7DF924801C for ; Tue, 8 Mar 2011 02:22:45 +0000 (UTC) From: Arlen Cuss To: caml-list@inria.fr In-Reply-To: <1299550636.21350.49.camel@azayaka> References: <1299550636.21350.49.camel@azayaka> Content-Type: text/plain; charset="UTF-8" Date: Tue, 08 Mar 2011 13:22:41 +1100 Message-ID: <1299550961.21350.50.camel@azayaka> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Unix.Unix_error(31, "write", "") raised from format.ml!? This is not right. I eat my words. :( I was doing the Printexc.get_backtrace () call immediately after a printf statement (printing information about the exception), so I got a stack for that instead! Sorry for the noise! Arlen On Tue, 2011-03-08 at 13:17 +1100, Arlen Cuss wrote: > Hi all, > > I'm getting bizarre errors in a program which multiplexes on 50-100 > sockets (some Unix domain, some TCP), where an error will apparently > occur in "write", but the entire backtrace is limited to 'format.ml': > > backtrace: Raised at file "format.ml", line 194, characters 15-26 > Called from file "format.ml", line 420, characters 8-33 > Called from file "format.ml", line 435, characters 6-24 > > The backtrace does describe a correct path through format.ml: > > 194 | _ -> raise Empty_queue > > 420 match peek_queue state.pp_queue with > > 435 try advance_loop state with > > It's hard to determine what's going on, because for some reason the > backtrace is limited to this file, and none of my own code. I'm a bit > lost as to how these errors are being raised: > > 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! > > 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 > >