Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()

Поиск
Список
Период
Сортировка
От Jakub Wartak
Тема Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()
Дата
Msg-id CAKZiRmzcDb0xsCiFWbQpB9AbyzjJpoHeagnoqcvip-VvszTUmQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_stat_get_activity(): integer overflow due to (int) * (int) for MemoryContextAllocHuge()  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Wed, Sep 27, 2023 at 10:08 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Sep 27, 2023 at 08:41:55AM +0200, Jakub Wartak wrote:
> > Attached patch adjusts pgstat_track_activity_query_size to be of
> > size_t from int and fixes the issue.
>
> This cannot be backpatched, and using size_t is not really needed as
> track_activity_query_size is capped at 1MB.  Why don't you just tweak
> the calculation done in pgstat_read_current_status() instead, say with
> a cast?

Thanks Michael, sure, that is probably a better alternative. I've attached v2.

BTW: CF entry is https://commitfest.postgresql.org/45/4592/

Regards,
-Jakub Wartak.

Вложения

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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: [PATCH] Add inline comments to the pg_hba_file_rules view
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning