pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16801: Invalid memory access on WITH RECURSIVE with nested WITHs
Date: Thu, 25 Feb 2021 10:19:43 -0500
Message-ID: <119550.1614266383@sss.pgh.pa.us> (raw)
In-Reply-To: <YDcVh8R7OArj9dtV@paquier.xyz>
References: <16801-393c7922143eaa4d@postgresql.org>
	<X/FTDocQD3D7+aIJ@paquier.xyz>
	<eb358b3f-8272-d0a9-6645-983e7ad2bec4@gmail.com>
	<YDXeLBqjDeQQPGoO@paquier.xyz>
	<4057243.1614179963@sss.pgh.pa.us>
	<31724.1614213386@sss.pgh.pa.us>
	<YDb9wdB1GUkr+NAD@paquier.xyz>
	<51877.1614219226@sss.pgh.pa.us>
	<YDcLzKuQJmKOZYq+@paquier.xyz>
	<60272.1614221283@sss.pgh.pa.us>
	<YDcVh8R7OArj9dtV@paquier.xyz>

Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Feb 24, 2021 at 09:48:03PM -0500, Tom Lane wrote:
>> 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.

> Yeah.  What I sent previously does not break in non-debug builds, but
> it does with just --enable-cassert.

> Hmm.  I'd like to think that this would be enough for this thread, and
> I cannot come up now with a test able to break the lists for non-debug
> builds.  But perhaps you have an idea?

For me, the example I gave fails in a non-debug build.  With the code as
of HEAD, I get "ERROR: stack depth limit exceeded" or a segfault.  With
your patch applied, it complains about w6 not having the correct form for
a recursive CTE.

			regards, tom lane





view thread (18+ messages)  latest in thread

Message-ID: <119550.1614266383@sss.pgh.pa.us>
Permalink:  ../119550.1614266383@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/119550.1614266383@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #16801: Invalid memory access on WITH RECURSIVE with nested WITHs
  In-Reply-To: <119550.1614266383@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox