From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 2449BBB91 for ; Sun, 2 Jan 2005 21:34:01 +0100 (CET) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j02KY0VC018116 for ; Sun, 2 Jan 2005 21:34:01 +0100 Received: from [82.67.10.72] (lalande-1-82-67-10-72.fbx.proxad.net [82.67.10.72]) by postfix4-2.free.fr (Postfix) with ESMTP id D0579298D0D; Sun, 2 Jan 2005 20:00:26 +0100 (CET) Message-ID: <41D844C1.6050100@laposte.net> Date: Sun, 02 Jan 2005 20:00:17 +0100 From: Zakath User-Agent: Mozilla Thunderbird 1.0 (X11/20041215) X-Accept-Language: en-us, en MIME-Version: 1.0 To: rich@furbychan.annexia.org Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] caml_oldify_local_roots crashes X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41D85AB8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 oldify:01 wrote:01 wrote:01 interfacing:01 ocaml:01 heap:01 ocaml:01 camlparam:01 asmrun:01 byterun:01 26,:98 int:01 caml:02 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: > On Sun, Dec 26, 2004 at 04:35:53AM +0000, Jon Harrop wrote: > > On Sat, 25 Dec 2004, haiku.issa wrote: > > > Everything worked fine until I added a subfunction that simply > > > merges two int lists. > > I am no expert on this but I believe this implies that your interfacing > > between C and OCaml was already broken. Almost certainly something to do > > with the GC. > It often helps to add lots of calls to Gc.full_major () to your code. > One of these will crash, telling you that between that call and the > previous one, you did something bad to the heap. > > Rich. I eventually found out : I was following the book "Devloppement d'applications avec Objective Caml" instead of the OCaml manual. They were advicing to register local variables and parameters (with CAMLparam* and CAMLlocal*) when using a callback. Removing them made everything work fine. To be more accurate, it was creating a corrupted entry of local_roots. from /asmrun/roots.c (or byterun), there was (lr->next == lr) in some point, which was causing the looping. May be this should be said in the Manual ? Thnaks for your help Alexandre