From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 44DE47F0AF for ; Mon, 14 Mar 2016 17:44:30 +0100 (CET) IronPort-PHdr: 9a23:+1g/Mhaow0vZ47EY1OqmtYf/LSx+4OfEezUN459isYplN5qZpcq4bnLW6fgltlLVR4KTs6sC0LqJ9fG+EjxYqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7/0qsOYM10ArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9Kos/VqNZCnw4NGZ9ztfmuRTZSQyQri8TVX4JkxwNHU3PxA73VNH9v32pmPB63Xy0J8Twwrc1QgOI6K1sVFe8hj0OMTU+8XqRgMt6i75zqx+o4RJlld2HKLqJPeZzK/uONegRQnBMC55c Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=francois.bobot@cea.fr; spf=None smtp.mailfrom=francois.bobot@cea.fr; spf=None smtp.helo=postmaster@cirse-out.extra.cea.fr Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of francois.bobot@cea.fr) identity=pra; client-ip=132.167.192.142; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="francois.bobot@cea.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of francois.bobot@cea.fr) identity=mailfrom; client-ip=132.167.192.142; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="francois.bobot@cea.fr"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@cirse-out.extra.cea.fr) identity=helo; client-ip=132.167.192.142; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="francois.bobot@cea.fr"; x-sender="postmaster@cirse-out.extra.cea.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DeAAAu6eZWk47Ap4RdwTiGDQKBLzwQAQEBAQEBAQEQAQEBAQkLCQkhL4ItghUBAQQyAQVAARALGAkWDwkDAgECAUUGDQgCiCC7WwEBAQEGAQEBARyJXH6IdAWXS5cxhVSOfTeCP4FRi0wBAQE X-IPAS-Result: A0DeAAAu6eZWk47Ap4RdwTiGDQKBLzwQAQEBAQEBAQEQAQEBAQkLCQkhL4ItghUBAQQyAQVAARALGAkWDwkDAgECAUUGDQgCiCC7WwEBAQEGAQEBARyJXH6IdAWXS5cxhVSOfTeCP4FRi0wBAQE X-IronPort-AV: E=Sophos;i="5.24,336,1454972400"; d="scan'208";a="168598633" Received: from cirse-out.extra.cea.fr ([132.167.192.142]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Mar 2016 17:44:29 +0100 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by cirse.extra.cea.fr (8.15.2/8.15.2/CEAnet-Internet-out-2.4) with ESMTP id u2EGiTkf024969; Mon, 14 Mar 2016 17:44:29 +0100 Received: from pisaure.intra.cea.fr (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 0B1242096FF; Mon, 14 Mar 2016 17:45:05 +0100 (CET) Received: from muguet2.intra.cea.fr (muguet2.intra.cea.fr [132.166.192.7]) by pisaure.intra.cea.fr (Postfix) with ESMTP id E848620304B; Mon, 14 Mar 2016 17:45:04 +0100 (CET) Received: from [10.8.32.80] (is222783.intra.cea.fr [10.8.32.80]) by muguet2.intra.cea.fr (8.15.2/8.15.2/CEAnet-Intranet-out-1.4) with ESMTP id u2EGiSYi013716; Mon, 14 Mar 2016 17:44:28 +0100 To: Goswin von Brederlow References: <20160308154948.GA5919@frosties> <20160308190415.GA10232@frosties> <56E2DEB5.8020304@cea.fr> <20160314103240.GA21595@frosties> Cc: caml-list@inria.fr From: =?UTF-8?Q?Fran=c3=a7ois_Bobot?= Message-ID: <56E6EA6C.8090605@cea.fr> Date: Mon, 14 Mar 2016 17:44:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Icedove/44.0 MIME-Version: 1.0 In-Reply-To: <20160314103240.GA21595@frosties> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] memory corruption with Weak.t in Gc.finalise On 14/03/2016 11:32, Goswin von Brederlow wrote: > > Still using 4.02. This is a new thing. > > Still Weak.t needs to interact cleanly with the Gc. Guessing at the > internal state of Weak.t is bad. Let's fix this for 4.03. I think it is already fixed for 4.03. The new GC phase named "clean", between mark and sweep, makes the behavior of weak pointers straightforward compared to previous OCaml version: - A weak pointer is unset only if the value pointed is marked dead after the mark phase (ie. no way to ever access it, the memory could be freed). - Conversely, during the clean phase, a weak pointer to a dead value is considered unset (so Weak.get return None). If you know weird behavior in 4.03+beta on weak pointers or ephemeron, I would be very interested to know them. Best, -- François