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=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id AC82DBC6C for ; Thu, 7 Feb 2008 11:46:46 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.25,316,1199660400"; d="scan'208";a="7760880" Received: from macabane.inria.fr ([128.93.8.160]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 07 Feb 2008 11:46:46 +0100 Cc: Mathijs Romans Message-Id: <08F4E8BB-F4BE-41E6-B437-437E6597435F@inria.fr> From: Damien Doligez To: caml-list In-Reply-To: <200801310045.38815.mathijs@romansland.nl> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: [Caml-list] What does "pc" mean in ocamldebug Date: Thu, 7 Feb 2008 11:46:47 +0100 References: <200801310045.38815.mathijs@romansland.nl> X-Mailer: Apple Mail (2.915) X-Spam: no; 0.00; damien:01 damien:01 ocamldebug:01 parser:01 byte-code:01 bug:01 recursive:01 equality:01 equality:01 doligez:01 doligez:01 wrote:01 overflows:01 stack:01 recursively:01 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