From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18547 invoked by alias); 17 Apr 2014 10:07:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18537 invoked by uid 89); 17 Apr 2014 10:07:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: sasl.smtp.pobox.com Received: from a-pb-sasl-quonix.pobox.com (HELO sasl.smtp.pobox.com) (208.72.237.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Apr 2014 10:07:47 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 4F3C711EF1; Thu, 17 Apr 2014 06:07:45 -0400 (EDT) Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 4536F11EEE; Thu, 17 Apr 2014 06:07:45 -0400 (EDT) Received: from rusty (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id A3F9F11EED; Thu, 17 Apr 2014 06:07:43 -0400 (EDT) From: Andy Wingo To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 9/9] Remove a useless Guile finalizer References: <1397060028-18158-1-git-send-email-wingo@igalia.com> <1397060028-18158-10-git-send-email-wingo@igalia.com> Date: Thu, 17 Apr 2014 10:07:00 -0000 In-Reply-To: (Doug Evans's message of "Sat, 12 Apr 2014 13:18:13 -0700") Message-ID: <8738hcs1zn.fsf@igalia.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 1E1CBFCE-C618-11E3-919A-873F0E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-SW-Source: 2014-04/txt/msg00346.txt.bz2 On Sat 12 Apr 2014 22:18, Doug Evans writes: > Andy Wingo writes: > >> * gdb/guile/scm-symtab.c (stscm_free_sal_smob): Remove useless free >> function. (This was the only useless free function.) > > How useful is valgrind with Guile's GC? It seems to work fine now, and in my recollection, but I haven't used memcheck in anger recently. I usually use callgrind ;). The GC heap doesn't present any problems for it. Conservative root scanning on the stack and in the static data sections is an issue; you have to add some things to the suppressions for sanity. > And given that we have this hook, it seems a shame to just throw out > such useful protections against use-after-free (I'm pretty sure early on > I found one bug with them), especially given the subtleties with GC, > and gdb's extensive need to have references to SCM objects from outside > GC-controlled code. Thing is, you don't control very much about the environment of the finalizer. In particular it could be called from some other thread, and in general a finalizer runs concurrently with arbitrary other parts of your program; see http://wingolog.org/archives/2012/02/16/unexpected-concurrency for some discussion. Avoiding finalizers can actually improve correctness in this regard. > If we're going to have a rule that such code is disallowed, > there is more such code that needs to be removed besides the above > (grep for "catch bugs"). Sure. I think I looked for finalizers that _only_ had this kind of body, and this was the only one. It's harmless otherwise. Finalizers do impose a perf penalty on the GC, but it's much less than mark functions. Andy