Integer undeflow in fprintf in dsa.c

Поиск
Список
Период
Сортировка
От Ильясов Ян
Тема Integer undeflow in fprintf in dsa.c
Дата
Msg-id GV1P251MB1004E0D09D117D3CECF9256ECD502@GV1P251MB1004.EURP251.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы Re: Integer undeflow in fprintf in dsa.c  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Hello hackers,

Using Svace* I think I've found a little bug in src/backend/utils/mmgr/dsa.c.
This bug is presented in REL_12_STABLE, REL_13_STABLE, REL_14_STABLE,
REL_15_STABLE, REL_16_STABLE and master. I see that it was introduced together
with dynamic shared memory areas in the commit 13df76a537cca3b8884911d8fdf7c89a457a8dd3.
I also see that at least two people have encountered this fprintf output.

​fprintf(stderr,
           "    segment bin %zu (at least %d contiguous pages free):\n",
           i, 1 << (i - 1));

In case i​ equals zero user will get "at least -2147483648 contiguous pages free".
I believe that this is a mistake, and fprintf​ should print "at least 0 contiguous pages free"
in case i​ equals zero.

The patch that has a fix of this is attached.

* ​- https://svace.pages.ispras.ru/svace-website/en/

Kind regards,
Ian Ilyasov.

Juniour Software Developer at Postgres Professional
Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Replace current implementations in crypt() and gen_salt() to OpenSSL
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: A new message seems missing a punctuation