Re: BUG #17879: ERROR: unrecognized node type: 2139062143

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #17879: ERROR: unrecognized node type: 2139062143
Дата
Msg-id CAApHDvrFOjY9-6=mqx4r9YO7HoXdZ_5jsuiS0FFGfWC8YrJ7yA@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #17879: ERROR: unrecognized node type: 2139062143  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17879: ERROR: unrecognized node type: 2139062143  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
On Thu, 30 Mar 2023 at 22:21, PG Bug reporting form
<noreply@postgresql.org> wrote:
> CREATE TABLE mytable1(id INT GENERATED ALWAYS AS IDENTITY (SEQUENCE NAME
> test_seq));

> We have identified the root cause as follows:
> In the generateSerialExtraStmts function, the memory space for the seqoption
> list has been freed, but the options member of the Constraint still points
> to that memory address, which caused an error during the copyObject
> operation in the EventTriggerCollectSimpleCommand function.

Thank you for the detailed report and reproducer.

The problem seems to be down to generateSerialExtraStmts() deleting a
cell out of the given seqoptions resulting in that becoming an empty
list, but the calling function does not have its list pointer set to
NIL.

I see a few ways to fix; 1) always make a list_copy() of the list
before calling generateSerialExtraStmts(), or; 2) make a copy of the
list inside generateSerialExtraStmts() unconditionally, or 3) at the
very least, just make a copy before calling list_delete_nth_cell().

#1 and #2 might be a bit more effort than is really required, so the
attached does #3.

David

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16329: Valgrind detects an invalid read when building a gist index with buffering