Re: BUG #16801: Invalid memory access on WITH RECURSIVE with nested WITHs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16801: Invalid memory access on WITH RECURSIVE with nested WITHs
Date: 2021-02-25 15:19:43
Message-ID: 119550.1614266383@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Paquier <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Frost 2021-02-25 17:43:51 Re: BUG #16897: gssenc request slow connection
Previous Message Ijas MP 2021-02-25 14:09:27 postgres binares on arm device