From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id AE8117EEB2 for ; Thu, 24 Jan 2013 13:30:59 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of francois.pessaux@ensta-paristech.fr) identity=pra; client-ip=147.250.10.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="francois.pessaux@ensta-paristech.fr"; x-sender="francois.pessaux@ensta-paristech.fr"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of francois.pessaux@ensta-paristech.fr) identity=mailfrom; client-ip=147.250.10.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="francois.pessaux@ensta-paristech.fr"; x-sender="francois.pessaux@ensta-paristech.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@ns4.ensta.fr designates 147.250.10.4 as permitted sender) identity=helo; client-ip=147.250.10.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="francois.pessaux@ensta-paristech.fr"; x-sender="postmaster@ns4.ensta.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjICAK4oAVGT+goEgWdsb2JhbABEvkcWDgEBFiYngh4BAQQBfhaBHYgtBpw1oT6NUoMpA5YMk0GCIw X-IPAS-Result: AjICAK4oAVGT+goEgWdsb2JhbABEvkcWDgEBFiYngh4BAQQBfhaBHYgtBpw1oT6NUoMpA5YMk0GCIw X-IronPort-AV: E=Sophos;i="4.84,529,1355094000"; d="scan'208";a="92887" Received: from ns4.ensta.fr ([147.250.10.4]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jan 2013 13:30:59 +0100 Received: from ns4.ensta.fr (localhost [127.0.0.1]) by ns4.ensta.fr (Postfix) with ESMTP id 4BBCFDE0B9 for ; Thu, 24 Jan 2013 13:30:59 +0100 (CET) X-Virus-Scanned: amavisd-new at ns4.ensta.fr Received: from ns4.ensta.fr ([127.0.0.1]) by ns4.ensta.fr (ns4.ensta.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dmQqE0c5xjth for ; Thu, 24 Jan 2013 13:30:55 +0100 (CET) Received: from zemail.ensta.fr (zemail.ensta.fr [147.250.1.16]) by ns4.ensta.fr (Postfix) with ESMTP id D2E5DDE0B8 for ; Thu, 24 Jan 2013 13:30:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zemail.ensta.fr (Postfix) with ESMTP id CEE082405CC9 for ; Thu, 24 Jan 2013 13:30:55 +0100 (CET) X-Virus-Scanned: amavisd-new at zemail.ensta.fr Received: from zemail.ensta.fr ([127.0.0.1]) by localhost (zemail.ensta.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7InPIclhY7iX for ; Thu, 24 Jan 2013 13:30:55 +0100 (CET) Received: from zemail.ensta.fr (localhost [127.0.0.1]) by zemail.ensta.fr (Postfix) with ESMTP id A011B2405CC4 for ; Thu, 24 Jan 2013 13:30:55 +0100 (CET) Date: Thu, 24 Jan 2013 13:30:55 +0100 (CET) From: =?iso-8859-15?Q?Fran=E7ois?= Pessaux To: caml-list@inria.fr Message-ID: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Originating-IP: [147.250.1.2] X-Mailer: Zimbra 7.1.1_GA_3196 (ZimbraWebClient - SAF3 (Mac)/7.1.1_GA_3196) Subject: Re: [Caml-list] :: how to locate the source of exception Hello, >> My program written in ocaml terminate with the following output: >> Fatal error: exception Invalid_argument("index out of bounds") >> So how should I find out the lcoation in source code that raise this exc= eption? > you can run your program in bytecode setting the OCAMLRUNPARAM correctly = and you'll see the whole backtrace, like in > OCAMLRUNPARAM=3Db ./myprogram Just remember to compile with the -g option to really get the backtrace oth= erwise you'll get something like Fatal error: exception XXX (Program not linked with -g, cannot print stack backtrace). Regards, -- Fran=E7ois