From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 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 E8DAABC6C for ; Thu, 7 Feb 2008 12:35:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHd7qkfRVZKykmdsb2JhbACQMgEBAQEHBAQJChaWDYVh X-IronPort-AV: E=Sophos;i="4.25,316,1199660400"; d="scan'208";a="22347087" Received: from wa-out-1112.google.com ([209.85.146.178]) by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Feb 2008 12:35:27 +0100 Received: by wa-out-1112.google.com with SMTP id k17so4107690waf.3 for ; Thu, 07 Feb 2008 03:35:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; bh=1tSMTbfCaT9MX5VGLo00lljXT0uGt3fOnyUa7FtTcPw=; b=lT292yaNX4xrYVm3GmRbitGGWHvwChsjIvE2zn0fZ6EnDXwIxZoOD9I9G5s2PHct/9KPLPDr5Xh7Ir545cLx8wAhknePJFtugL2v80Q2fyY2cBppyJ+7hR22kMX7hy8Nb8W4gKre/R7OBU8eVj36fZTBgFBa5Ixx2rzOpKCaOsc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=wsfuXEerVc9bBgJCk5YwCvlKVE2sdxnR6g5EuSmMh1alENTGiXqaCyrPhEd+UA71LXZbqaixln5mkXV6IJqSXHpvZPgqZbAWvzZFNuL1i9EtxB8AuXNJT3tGftUE3hGJMZ7KmU//QzBaWIc4sZdFYPfyk9pGii5msVfm4DJawWo= Received: by 10.115.15.1 with SMTP id s1mr24100wai.0.1202384125779; Thu, 07 Feb 2008 03:35:25 -0800 (PST) Received: from sjef.local ( [87.212.160.173]) by mx.google.com with ESMTPS id g12sm28808115nfb.27.2008.02.07.03.35.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Feb 2008 03:35:25 -0800 (PST) From: Mathijs Romans To: Damien Doligez Subject: Re: [Caml-list] What does "pc" mean in ocamldebug Date: Thu, 7 Feb 2008 12:39:35 +0100 User-Agent: KMail/1.9.7 Cc: caml-list References: <200801310045.38815.mathijs@romansland.nl> <08F4E8BB-F4BE-41E6-B437-437E6597435F@inria.fr> In-Reply-To: <08F4E8BB-F4BE-41E6-B437-437E6597435F@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802071239.35606.mathijs@romansland.nl> Sender: Mathijs Romans X-Spam: no; 0.00; ocamldebug:01 damien:01 parser:01 byte-code:01 bug:01 recursive:01 damien:01 3.08:01 recursive:01 equality:01 equality:01 doligez:01 wrote:01 wrote:01 overflows:01 On Thursday 07 February 2008 11:46:47 Damien Doligez wrote: > Hello, > > On 2008-01-31, at 00:45, Mathijs Romans wrote: > > Hi! > > > > I am trying to make a Caml-application run that I have not written > > myself. I > > know very little about the language itself. Sadly, I get this error: > > > > Fatal error: exception Out_of_memory > > > > Using ocamldebugger I am trying to figure out what happened. The > > last line > > before failure is: > > Time : 36381 - pc : 65532 - module Parser > > 157 <|b|>if !current.son = !current then > > > > What caught my attention is that the number after "pc" is almost > > 2^16, which > > is probably the cause of my problem. I cannot find anywhere in the > > documentation what "pc" means, nor how I can increase its maximum > > value. Can > > somebody help me? > > pc is the value of the program counter, i.e. the index of the current > byte-code instruction. It is absolutely not limited to 2^16, and > I am quite sure its value has nothing to do with the bug you are > looking for. > > Apparently, you're getting an Out_of_memory exception in the execution > of > the equality test. Since equality is recursive, it has to go through > both data structures and if they are cyclic it may not terminate. > If they are cyclic and have enough complexity, it will recursively > call itself until its stack overflows, which is reported as an > Out_of_memory exception. > > The workaround is to avoid comparing cyclic data structures. > > -- Damien Thanks for the information. You're right, the program counter has nothing to do with the issue. I learned that between versions 3.06 and 3.08 the rules for a recursive equality test have changed, and I now need to update my program. Mathijs