From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA19212 for caml-redistribution; Fri, 27 Jun 1997 14:15:34 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA16767 for ; Fri, 27 Jun 1997 12:49:38 +0200 (MET DST) Received: from dwarin.oit.umass.edu (freya.cs.umass.edu [128.119.40.195]) by nez-perce.inria.fr (8.8.5/8.7.3) with ESMTP id MAA13733 for ; Fri, 27 Jun 1997 12:49:28 +0200 (MET DST) Received: (from ajenkins@localhost) by dwarin.oit.umass.edu (8.8.5/8.8.5) id GAA05146; Fri, 27 Jun 1997 06:48:42 -0400 Date: Fri, 27 Jun 1997 06:48:42 -0400 Message-Id: <199706271048.GAA05146@dwarin.oit.umass.edu> From: "Adam P. Jenkins" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: GC Bug? In-Reply-To: <199706270913.FAA04748@dwarin.oit.umass.edu> References: <199706270913.FAA04748@dwarin.oit.umass.edu> X-Mailer: VM 6.31 under Emacs 19.34.1 Sender: weis Adam P. Jenkins writes: > Hi, I've been trying to write a C extension for O'Caml version 1.05, > on Linux. I have a C object which I want to be able to pass into > caml, and manipulate it with the C functions. I'm having some > problems with allocation. Here's the smallest example I can give. > I've even provided a Makefile, which creates a custom toplevel to test > this in. > > The problem occurs in test_copy (see the C file below). For my > abstract type, I just use two integers set to some magic values, which > should never change. However, in copy, after I call alloc, sometimes > the input parameter will change. Here's a sample session: > Hi, I'm following up to my own post because I figured out what the problem was: I should have been saving the parameter in a root value over the alloc call. I guess it was getting relocated sometimes by the GC. Sorry I can't post in French too; I only speak a da english. Good day. Adam