Re: BUG #17126: Server crashes on dropping user while enumerating owned objects that are droppped concurrently

Alexander Law <exclusion@gmail.com>

From: Alexander Lakhin <exclusion@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-bugs@lists.postgresql.org
Date: 2021-09-02T04:00:01Z
Lists: pgsql-bugs
Hello Alvaro,
28.07.2021 23:01, Alvaro Herrera wrote:
> On 2021-Jul-28, PG Bug reporting form wrote:
>
>> Dropping a user that owns a number of procedures, while some of them are
>> being dropped, can cause the server crash:
>> There's many places that deal correctly with the possibility that
>> getObjectDescription() would return NULL, but I found two places that
>> don't.
I've found another one in dependency.c:

        else if (behavior == DROP_RESTRICT)
        {
            char       *otherDesc = getObjectDescription(&extra->dependee,
                                                         false);
...
            pfree(otherDesc);
I couldn't trigger a failure at this place yet, but maybe it's worth to
fix here too.

Best regards,
Alexander



Commits

  1. Avoid crash in rare case of concurrent DROP