Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: exclusion(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17098: Assert failed on composing an error message when adding a type to an extension being dropped
Date: 2021-07-11 15:28:58
Message-ID: 2468663.1626017338@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> When trying to add to an extension a type that is already exists in the
> extension while the extension is being dropped I get a failed assertion with
> the following stack:

I think that the root issue here is that ExecAlterExtensionContentsStmt
fails to acquire any sort of lock on the extension. Considering that
it *does* lock the object to be added/dropped, that's a rather glaring
oversight. Fortunately it seems easily fixable ... though I wonder
how many other similar oversights we have.

However, that root issue is converted from a relatively minor bug into
a server crash because snprintf.c treats a NULL pointer passed to %s
as a crash-worthy error. I have advocated for that behavior in the
past, but I'm starting to wonder if it wouldn't be wiser to change
over to the glibc-ish behavior of printing "(null)" or the like.
It seems like we've long since found all the interesting bugs that
the assert-or-crash behavior could reveal, and now we're down to
weird corner cases where its main effect is to weaken our robustness.

Thoughts?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2021-07-11 16:14:21 Re: BUG #16792: silent corruption of GIN index resulting in SELECTs returning non-matching rows
Previous Message Евгений Илюшин 2021-07-11 13:48:08 Re: BUG #17099: Problem with EXECUTE and JSON

Browse pgsql-hackers by date

  From Date Subject
Next Message Soumyadeep Chakraborty 2021-07-11 18:54:23 Re: pg_stats and range statistics
Previous Message Justin Pryzby 2021-07-11 15:22:54 Re: enable_resultcache confusion