Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1A74D429E25 for ; Sun, 28 Aug 2011 21:04:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xxwxwXrmxxXZ for ; Sun, 28 Aug 2011 21:04:12 -0700 (PDT) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id AEFEB431FB6 for ; Sun, 28 Aug 2011 21:04:12 -0700 (PDT) Received: by qyk34 with SMTP id 34so3867042qyk.5 for ; Sun, 28 Aug 2011 21:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=MDp8oNnuCrSD8+yYwEVY/K0fKZwx50jgr+xBgjj5wrE=; b=fMxQij//sf1ugjO1XnIB3q5Y2E6FBaSSacaovAh6DJ7aI+7Mpxp7gLo2Lf8qmSI9gv y+agagFjYRUaI76bWkgvSf6sYYSlVPjzE4Kl9CuF0CBpA4zYr8XEbVbiockZRd0MNjOj NaOwJgDVWQnQMj2mDfCe9qA22Mc3E/8wveYeo= Received: by 10.229.40.137 with SMTP id k9mr5172752qce.100.1314590652094; Sun, 28 Aug 2011 21:04:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.45.195 with HTTP; Sun, 28 Aug 2011 21:03:52 -0700 (PDT) In-Reply-To: <87ty907ub0.fsf@gmail.com> References: <8739h1pbaq.fsf@gmail.com> <87pqjprzu2.fsf@gmail.com> <87ty907ub0.fsf@gmail.com> From: Antoine Latter Date: Sun, 28 Aug 2011 23:03:52 -0500 Message-ID: Subject: Re: Bug in GC's ordering of ForeignPtr finalization? To: Ben Gamari Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Thu, 08 Sep 2011 14:21:55 -0700 Cc: Bart Massey , glasgow-haskell-users@haskell.org, notmuch@notmuchmail.org, haskell-cafe@haskell.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 04:04:14 -0000 On Sun, Aug 28, 2011 at 10:47 PM, Ben Gamari wrote: > On Sun, 28 Aug 2011 22:26:05 -0500, Antoine Latter wrote: >> One problem you might be running in to is that the optimization passes >> can notice that a function isn't using all of its arguments, and then >> it won't pass them. These even applies if the arguments are bound >> together in a record type. >> > In this case I wouldn't be able to reproduce the problem with > optimization disabled, no? Unfortunately, this is not the case; the > problem persists even with -O0. > Perhaps? I don't know the details about how the GC decides when something is reachable. The scenario I described (which sounds similar to yours?) is only safe in Haskell when using functions like touchForeignPtr. Antoine