From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 31734BC57 for ; Tue, 22 Jun 2010 17:17:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnECAE5xIEyAAtnEe2dsb2JhbACSb4woFQEBFiIFHbhziGCFGwQ X-IronPort-AV: E=Sophos;i="4.53,460,1272837600"; d="scan'208";a="65109087" Received: from smtp01.srv.cs.cmu.edu ([128.2.217.196]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jun 2010 17:17:07 +0200 Received: from stratocaster.home (pool-96-236-201-68.pitbpa.fios.verizon.net [96.236.201.68]) (authenticated bits=0) by smtp01.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id o5MFH5Nu015228 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 22 Jun 2010 11:17:05 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.72) (envelope-from ) id 1OR5Dl-0003GF-9y for caml-list@inria.fr; Tue, 22 Jun 2010 11:17:05 -0400 Date: Tue, 22 Jun 2010 11:17:05 -0400 From: Eric Cooper To: caml-list@inria.fr Subject: Re: [Caml-list] Re: exception error trace back in ocaml Message-ID: <20100622151705.GA12094@localhost> Mail-Followup-To: caml-list@inria.fr References: <55271.216.73.250.152.1277144142.squirrel@webmail.amnh.org> <12944_1277218550_o5MEtn0x008505_53601.216.73.250.47.1277218543.squirrel@webmail.amnh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12944_1277218550_o5MEtn0x008505_53601.216.73.250.47.1277218543.squirrel@webmail.amnh.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Scanned-By: mimedefang-cmuscs on 128.2.217.196 X-Spam: no; 0.00; ocaml:01 amnh:01 traceback:01 traceback:01 ocaml:01 printexc:01 backtrace:01 backtrace:01 wrote:01 exception:01 exception:01 caml-list:01 closure:01 lazy:02 lazy:02 On 21-06-2010, lin hong wrote: > I have problem getting a full traceback of some exception error. The > traceback looks like this: > > Fatal error: exception Invalid_argument("index out of bounds") > Raised at file "camlinternalLazy.ml", line 33, characters 10-11 > Called from file "list.ml", line 74, characters 24-34 > > But that's all I got, both camlinternalLazy.ml and list.ml are ocaml > source code, I still don't know which part of my code trigger it. Also, > in > camlinternalLazy.ml line 33, there is a "try .... with e -> raise e", is > this the reason I don't have a full traceback -- Maybe something else > catch the "raise e" ? Any idea? That exception was raised when forcing a lazy value (Lazy.force catches it and re-raises it). So you'll need to wrap the expression following the "lazy" keyword with a handler for Invalid_argument, and you might be able to use Printexc.print_backtrace from there. But I don't know why the standard backtrace printer can't "see" into the closure being forced. -- Eric Cooper e c c @ c m u . e d u