Re: BUG #15540: Use after release in ExecuteTruncateGuts

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15540: Use after release in ExecuteTruncateGuts
Дата
Msg-id 31125.1544198945@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15540: Use after release in ExecuteTruncateGuts  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #15540: Use after release in ExecuteTruncateGuts  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: BUG #15540: Use after release in ExecuteTruncateGuts  (PanBian <bianpan2016@163.com>)
Список pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> The function ExecuteTruncateGuts drops the reference to rel via
> relation_close when toast_relid is valid. However, after that, rel is passed
> to pgstat_count_truncate. This may result in a use-after-release bug.

... and, even more to the point, the truncation stats count is incorrectly
applied to the toast table not its parent.

> Maybe,
> rel should be re-declared on the branch that toast_relid is valid.

Yeah, seems like the right way.  Will fix.

Are you using a static analyzer to find these?  I'm curious how
you noticed them.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15539: Deadcode in OpenTableList
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #15540: Use after release in ExecuteTruncateGuts