From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7G9rmRB011104 for ; Tue, 16 Aug 2011 11:53:49 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjgEADU9Sk7RVdg2kGdsb2JhbABBmSKPAggUAQEBAQkJDQcUBCGBQAEBAQEDDAYCLAEbHQEDDAYFCw0uIgERAQUBHBkipCYKjDeCVYU3O4htAgMGhkEEh1mLOYxZPINl X-IronPort-AV: E=Sophos;i="4.67,379,1309730400"; d="scan'208";a="105572403" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 16 Aug 2011 11:53:43 +0200 Received: by mail-qw0-f54.google.com with SMTP id 9so5061685qwc.27 for ; Tue, 16 Aug 2011 02:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=2v8cfauTbZpTQGdEHP05yH7+gVp1BTuLL34S2w8oSVc=; b=oCKN5iSxRklEeF5KK02mDK1DrWm7ZekZzv5qCPz7gcd0X1ANJoEW/IZhQWa2ukvDi2 wcXC/lbi37lq/cjAsBuyqtzZ/F12p5gqhiq7hqg3kMLsUMXSmkuVE2Uwr67VgdS+JJbP r+X4iitamHVfpiI1LL1Tk2eC5rnkQEM7+ppaE= MIME-Version: 1.0 Received: by 10.224.9.206 with SMTP id m14mr3372097qam.364.1313488423175; Tue, 16 Aug 2011 02:53:43 -0700 (PDT) Received: by 10.229.76.229 with HTTP; Tue, 16 Aug 2011 02:53:43 -0700 (PDT) In-Reply-To: <20110816094636.GA6227@ccellier.rd.securactive.lan> References: <4E4A2488.4050706@gmail.com> <4E4A2DAC.5010207@gmail.com> <20110816094636.GA6227@ccellier.rd.securactive.lan> Date: Tue, 16 Aug 2011 13:53:43 +0400 Message-ID: From: Dmitry Bely To: rixed@happyleptic.org Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p7G9rmRB011104 Subject: Re: [Caml-list] Interfacing with C: bad practice On Tue, Aug 16, 2011 at 1:46 PM, wrote: > -[ Tue, Aug 16, 2011 at 11:43:24AM +0300, Török Edwin ]---- >> 'list' should be reachable via caml_local_roots, so if it really gets an invalid value >> it sounds like a bug to me. > > list may not be garbage collected (since it is indeed registered as the > root), but it may be moved arround (ie promoted to major heap). > The address of list would be fixed in the local variable (the root) but > not the transiant copy on the stack. > Maybe that's the actual problem ? Exactly. List is moved but its stack copy (wrp_ml_cons 2nd parameter) is not updated and holds an old address. - Dmitry Bely