Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMWyi-0007XL-9G for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Mar 2021 14:16:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMWyh-0002If-6K for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Mar 2021 14:16:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMWyg-0002IY-W5 for pgsql-hackers@lists.postgresql.org; Wed, 17 Mar 2021 14:16:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMWyf-00051W-0x for pgsql-hackers@lists.postgresql.org; Wed, 17 Mar 2021 14:16:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12HEGixT3508521; Wed, 17 Mar 2021 10:16:45 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Getting better results from valgrind leak tracking In-reply-to: <20210317055718.v6qs3ltzrformqoa@alap3.anarazel.de> References: <3471359.1615937770@sss.pgh.pa.us> <20210317023101.anvejcfotwka6gaa@alap3.anarazel.de> <3479700.1615950107@sss.pgh.pa.us> <20210317055718.v6qs3ltzrformqoa@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 16 Mar 2021 22:57:18 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3508519.1615990604.1@sss.pgh.pa.us> Date: Wed, 17 Mar 2021 10:16:44 -0400 Message-ID: <3508520.1615990604@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2021-03-16 20:50:17 -0700, Andres Freund wrote: >> What I meant was that I didn't understand how there's not a leak >> danger when compilation fails halfway through, given that the context >> in question is below TopMemoryContext and that I didn't see a relevant >> TRY block. But that probably there is something cleaning it up that I >> didn't see. > Looks like it's an actual leak: Yeah, I believe that. On the other hand, I'm not sure that such cases represent any real problem for production usage. I'm inclined to focus on non-error scenarios first. (Having said that, we probably have the ability to fix such things relatively painlessly now, by reparenting an initially-temporary context once we're done parsing.) Meanwhile, I'm still trying to understand why valgrind is whining about the rd_indexcxt identifier strings. AFAICS it shouldn't. regards, tom lane