From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18046 invoked by alias); 12 Apr 2014 20:18:23 -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 18035 invoked by uid 89); 12 Apr 2014 20:18:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f172.google.com Received: from mail-pd0-f172.google.com (HELO mail-pd0-f172.google.com) (209.85.192.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 12 Apr 2014 20:18:20 +0000 Received: by mail-pd0-f172.google.com with SMTP id p10so6579583pdj.31 for ; Sat, 12 Apr 2014 13:18:19 -0700 (PDT) X-Received: by 10.67.1.106 with SMTP id bf10mr34874163pad.78.1397333899047; Sat, 12 Apr 2014 13:18:19 -0700 (PDT) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id qv9sm16832624pbc.71.2014.04.12.13.18.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Apr 2014 13:18:18 -0700 (PDT) From: Doug Evans To: Andy Wingo 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: Sat, 12 Apr 2014 20:18:00 -0000 In-Reply-To: <1397060028-18158-10-git-send-email-wingo@igalia.com> (Andy Wingo's message of "Wed, 9 Apr 2014 18:13:48 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00243.txt.bz2 Andy Wingo writes: > * gdb/guile/scm-symtab.c (stscm_free_sal_smob): Remove useless free > function. (This was the only useless free function.) > --- > gdb/guile/scm-symtab.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c > index 8910973..876bf64 100644 > --- a/gdb/guile/scm-symtab.c > +++ b/gdb/guile/scm-symtab.c > @@ -386,19 +386,6 @@ gdbscm_symtab_static_block (SCM self) > > /* Administrivia for sal (symtab-and-line) smobs. */ > > -/* The smob "free" function for . */ > - > -static size_t > -stscm_free_sal_smob (SCM self) > -{ > - sal_smob *s_smob = (sal_smob *) SCM_SMOB_DATA (self); > - > - /* Not necessary, done to catch bugs. */ > - s_smob->symtab_scm = SCM_UNDEFINED; > - > - return 0; > -} > - > /* The smob "print" function for . */ > > static int > @@ -692,7 +679,6 @@ gdbscm_initialize_symtabs (void) > scm_set_smob_print (symtab_smob_tag, stscm_print_symtab_smob); > > sal_smob_tag = gdbscm_make_smob_type (sal_smob_name, sizeof (sal_smob)); > - scm_set_smob_free (sal_smob_tag, stscm_free_sal_smob); > scm_set_smob_print (sal_smob_tag, stscm_print_sal_smob); > > gdbscm_define_functions (symtab_functions, 1); How useful is valgrind with Guile's GC? My experience is that the S/N ratio is just too low, but maybe there's a canonical suppression file that works well enough. 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. 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"). But is this something we want? At this stage in gdb+guile's development, I like the protection, and the cost is within epsilon of zero (to me anyway). [The debug version of the GC may have similar support, but the benefit of this is that it's "always on" for negligible cost.] I'm not opposed to removing the code at some later point after things are really stable and after there's data that they've stopped being useful.