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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 503A87EEAF for ; Thu, 24 Jan 2013 14:29:21 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of edwin+ml-ocaml@etorok.net) identity=pra; client-ip=176.9.138.55; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="edwin+ml-ocaml@etorok.net"; x-sender="edwin+ml-ocaml@etorok.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of edwin+ml-ocaml@etorok.net designates 176.9.138.55 as permitted sender) identity=mailfrom; client-ip=176.9.138.55; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="edwin+ml-ocaml@etorok.net"; x-sender="edwin+ml-ocaml@etorok.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of postmaster@mail.etorok.net designates 176.9.138.55 as permitted sender) identity=helo; client-ip=176.9.138.55; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="edwin+ml-ocaml@etorok.net"; x-sender="postmaster@mail.etorok.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgIFAPszAVGwCYo3/2dsb2JhbABEgmuDWrgCFnOCHgEBBSMPAQ0BATYCDwkCGAICBRYLAgIJAwIBAgFFEwYCAogXAwiQDJoOcINKAQWPEQaBI4wvghaBE5YPgRyPLIJ6 X-IronPort-AV: E=Sophos;i="4.84,529,1355094000"; d="scan'208";a="169519498" Received: from mail.etorok.net ([176.9.138.55]) by mail4-smtp-sop.national.inria.fr with ESMTP; 24 Jan 2013 14:29:20 +0100 Received: from [IPv6:2a02:2f02:1022:e131:1e6f:65ff:fe23:db0d] (unknown [IPv6:2a02:2f02:1022:e131:1e6f:65ff:fe23:db0d]) by mail.etorok.net (Postfix) with ESMTPSA id 8BC1346B4 for ; Thu, 24 Jan 2013 14:29:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=etorok.net; s=MAILOUT; t=1359034159; bh=Syk23aB473NlUH7EIVGxr4p8JEpzYatsAt6TndHnPaQ=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ga8RKPvNHEXNgoJkr7e7M7rYyv8v8TcmjX3TalwIQgPqHFJaGW3SjhCNu3Lk0cVrT iRGp1fOCx2wQvXaT9eK+xQYt1tZrs6B2IHgUQ96XhTAbp0csv5B5JLONXbp+yr4ow9 0Clvaqf6aXBnI0CflFrOh3oUsHYJ8NGVljetvoYQ= Message-ID: <5101372E.8030900@etorok.net> Date: Thu, 24 Jan 2013 15:29:18 +0200 From: =?UTF-8?B?VMO2csO2ayBFZHdpbg==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: caml-list@inria.fr References: <24b397e9.3d7.13c6c7b5296.Coremail.syshen@nudt.edu.cn> <87boce7md8.fsf@li195-236.members.linode.com> In-Reply-To: <87boce7md8.fsf@li195-236.members.linode.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.97.6 at mail X-Virus-Status: Clean Subject: Re: [Caml-list] :: how to locate the source of exception On 01/24/2013 03:15 PM, Malcolm Matalka wrote: > Run with backtraces on. I think this requires bytecode but I can't > remember: > > http://stackoverflow.com/questions/145880/how-do-i-get-a-stack-trace-in-ocaml It works with native code too if you set Printexc.record_backtrace as written above, but bytecode backtraces are usually more reliable (the native backtrace gets cut off sometimes, perhaps due to some 3rdparty libraries not being compiled with -g). --Edwin > > 沈胜宇 writes: > >> Dear all: >> >> >> 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 exception? >> >> >> Shen >