pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid crash in rare case of concurrent DROP
Date: Fri, 05 Nov 2021 15:33:21 +0000
Message-ID: <E1mj1DV-0008VR-Qq@gemulon.postgresql.org> (raw)

Avoid crash in rare case of concurrent DROP

When a role being dropped contains is referenced by catalog objects that
are concurrently also being dropped, a crash can result while trying to
construct the string that describes the objects.  Suppress that by
ignoring objects whose descriptions are returned as NULL.

The majority of relevant codesites were already cautious about this
already; we had just missed a couple.

This is an old bug, so backpatch all the way back.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/17126-21887f04508cb5c8@postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e0eaeafd66462b1a584831f35f10ec1e017c3845

Modified Files
--------------
src/backend/catalog/dependency.c  | 31 ++++++++++++++++++++-----------
src/backend/catalog/pg_shdepend.c |  6 ++++++
2 files changed, 26 insertions(+), 11 deletions(-)



view thread (7+ messages)

Message-ID: <E1mj1DV-0008VR-Qq@gemulon.postgresql.org>
Permalink:  ../E1mj1DV-0008VR-Qq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mj1DV-0008VR-Qq@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Avoid crash in rare case of concurrent DROP
  In-Reply-To: <E1mj1DV-0008VR-Qq@gemulon.postgresql.org>
  References: <E1mj1DV-0008VR-Qq@gemulon.postgresql.org>

* 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