Re: [PATCH] Fix memory corruption in pg_shdepend.c - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Fix memory corruption in pg_shdepend.c
Date
Msg-id YXDTl+PfSnqmbbkE@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Fix memory corruption in pg_shdepend.c  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: [PATCH] Fix memory corruption in pg_shdepend.c  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: [PATCH] Fix memory corruption in pg_shdepend.c  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Wed, Oct 20, 2021 at 09:19:51AM -0300, Alvaro Herrera wrote:
> Ouch ... this means that pg_shdepends contents are broken for databases
> created with 14.0?  hmm ... yes.

Yes, it means so :(

I have fixed the issue for now, and monitored the rest of the tree.

Another issue is that we have zero coverage for this area of the code
when creating a database from a template and copying over shared
dependencies:
https://coverage.postgresql.org/src/backend/catalog/pg_shdepend.c.gcov.html

It is easy enough to get an error on the new database with
pg_describe_object().  Your part about adding a shared dependency with
a table on a given role is simple enough, as well.  While looking for
a place where to put such a test, 020_createdb.pl felt like a natural
place and we don't have any coverage for the case of TEMPLATE with
createdb.  So I would like to suggest something like the attached for
HEAD.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Failed transaction statistics to measure the logical replication progress
Next
From: Peter Geoghegan
Date:
Subject: Re: [PATCH] Fix memory corruption in pg_shdepend.c