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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexander Lakhin <exclusion@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2021-02-25T03:12:07Z
Lists: pgsql-bugs
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?
--
Michael

Commits

  1. Fix list-manipulation bug in WITH RECURSIVE processing.