Re: Assert name/short_desc to prevent SHOW ALL segfault

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: Assert name/short_desc to prevent SHOW ALL segfault
Дата
Msg-id 20220526214550.GA1513741@nathanxps13
обсуждение исходный текст
Ответ на Re: Assert name/short_desc to prevent SHOW ALL segfault  (Andres Freund <andres@anarazel.de>)
Ответы Re: Assert name/short_desc to prevent SHOW ALL segfault  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Tue, May 24, 2022 at 11:17:39PM -0700, Andres Freund wrote:
> On 2022-05-24 11:41:49 -0700, Nathan Bossart wrote:
>> I would actually ERROR on this so that we aren't relying on
>> --enable-cassert builds to catch it.
> 
> How about adding pg_nonnull(...) (ending up as __attribute__((nonnull(...))?
> Then code passing NULLs would get compiler warnings? It'd be useful in quite a
> few more places.

I attached an attempt at this for the "name" and "valueAddr" arguments for
the DefineCustomXXXVariable functions.  It looked like nonnull was
supported by GCC and Clang, but I haven't looked too closely to see whether
we need version checks as well.

>> That being said, if there's no strong reason to enforce that a short
>> description be provided, then why not adjust ShowAllGUCConfig() to set that
>> column to NULL when short_desc is missing?
> 
> There's a bunch more places that'd need to be adjusted, if we go that way. I
> don't really have an opinion on it.

I looked around and didn't see anywhere else obvious that needed adjustment
besides what Michael pointed out (3ac7d024).  Am I missing something?

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Patch: Don't set LoadedSSL unless secure_initialize succeeds
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Remove support for Visual Studio 2013