Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()
Дата
Msg-id ZPV6vblm1jmgs1VW@paquier.xyz
обсуждение исходный текст
Ответ на Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: BUG #17950: Incorrect memory access in gtsvector_picksplit()  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-bugs
On Sun, Aug 13, 2023 at 09:00:01PM +0300, Alexander Lakhin wrote:
> I've tried to make that addition as valuable as possible in the context of
> this issue, but as it is too expensive (to be honest, I was bolstered by
> the gin test duration (~10 secs too)), then let's leave it aside.

I have applied 0001 down to 11 to get the basic fix in place, but the
regression tests are really too expensive compared to the value they
bring.

Regarding the changes in gtsvectorout(), the output produced is indeed
confusing when ISALLTRUE is set.

-        int            siglen = GETSIGLEN(key);
-        int            cnttrue = (ISALLTRUE(key)) ? SIGLENBIT(siglen) : sizebitvec(GETSIGN(key), siglen);
+        if (ISALLTRUE(key))
+            sprintf(outbuf, "all true bits");
+        else
+        {
+            int            siglen = GETSIGLEN(key);
+            int            cnttrue = (ISALLTRUE(key)) ? SIGLENBIT(siglen) : sizebitvec(GETSIGN(key), siglen);

-        sprintf(outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT(siglen) - cnttrue);
+            sprintf(outbuf, SINGOUTSTR, cnttrue, (int) SIGLENBIT(siglen) - cnttrue);
+        }

In the false branch of ISALLTRUE(key), why isn't cnttrue always
calculated with sizebitvec()?  It's also not something I would
backpatch.  That's confusing, for sure, but there is also the argument
of keeping a consistent output in the stable branches.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #17928: Standby fails to decode WAL on termination of primary
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: BUG #17928: Standby fails to decode WAL on termination of primary