From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2464 invoked by alias); 26 Feb 2019 20:36:59 -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 2446 invoked by uid 89); 26 Feb 2019 20:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:client-, assigning, HContent-Transfer-Encoding:8bit X-HELO: mx2.freebsd.org Received: from mx2.freebsd.org (HELO mx2.freebsd.org) (8.8.178.116) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Feb 2019 20:36:57 +0000 Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id DB57988AD9; Tue, 26 Feb 2019 20:36:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16B62722FF; Tue, 26 Feb 2019 20:36:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7F8BE1EECD; Tue, 26 Feb 2019 20:36:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [RFC] Fix BFD leak in solib-darwin.c To: Tom Tromey Cc: Tom Tromey , gdb-patches@sourceware.org References: <20190222163645.9349-1-tromey@adacore.com> <184aefb1-38fc-cc39-0f3a-4bd350c47e11@FreeBSD.org> <8736oae21e.fsf@tromey.com> From: John Baldwin Openpgp: preference=signencrypt Message-ID: Date: Tue, 26 Feb 2019 20:36:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <8736oae21e.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16B62722FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00457.txt.bz2 On 2/26/19 12:18 PM, Tom Tromey wrote: >>>>>> "John" == John Baldwin writes: > > Re-replying... > > John> Simon has noticed several instances of this bug where release() > John> was used instead of reset(). > > I wonder whether we ought to mark the release method as > "warn_unused_result" to try to avoid future bugs like this. Another > idea is to try to reduce the number of calls to release generally, by > changing more things to take rvalue references or the like. I think the warning would be useful if it doesn't trigger a lot of false positives. I feel like it wouldn't today. When I was grep'ing for 'release ()' I only focused on the calls that weren't assigning a value to a result and I feel like there weren't many of those (and some were assigning, just not obvious in the one line of grep context). -- John Baldwin                                                                            Â