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 1lF6hH-0005V1-CE for pgsql-bugs@arkaria.postgresql.org; Thu, 25 Feb 2021 02:48:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lF6hF-0005N3-0E for pgsql-bugs@arkaria.postgresql.org; Thu, 25 Feb 2021 02:48:09 +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 1lF6hE-0005Mw-QI for pgsql-bugs@lists.postgresql.org; Thu, 25 Feb 2021 02:48:08 +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 1lF6hC-0006cG-Qp for pgsql-bugs@lists.postgresql.org; Thu, 25 Feb 2021 02:48:08 +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 11P2m3c7060273; Wed, 24 Feb 2021 21:48:03 -0500 From: Tom Lane To: Michael Paquier cc: Alexander Lakhin , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16801: Invalid memory access on WITH RECURSIVE with nested WITHs In-reply-to: References: <16801-393c7922143eaa4d@postgresql.org> <4057243.1614179963@sss.pgh.pa.us> <31724.1614213386@sss.pgh.pa.us> <51877.1614219226@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Thu, 25 Feb 2021 11:30:36 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <60271.1614221283.1@sss.pgh.pa.us> Date: Wed, 24 Feb 2021 21:48:03 -0500 Message-ID: <60272.1614221283@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Wed, Feb 24, 2021 at 09:13:46PM -0500, Tom Lane wrote: >> Hmm, I don't see any failure from that... > Perhaps because you are not compiling with -DUSE_VALGRIND which is why > this fails with only two nested levels? Ah, right, because that enables DEBUG_LIST_MEMORY_USAGE. I did run it under valgrind but I hadn't bothered to recompile. Anyway, I think we're better off with a test that doesn't require DEBUG_LIST_MEMORY_USAGE, or preferably not even CLOBBER_FREED_MEMORY, to show the problem. The test I showed misbehaves even in non-debug builds, because it actually depends on what's in the innerwiths lists. regards, tom lane