From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: bianpan2016@163.com, pgsql-bugs@lists.postgresql.org, Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
Subject: Re: BUG #15540: Use after release in ExecuteTruncateGuts
Date: Fri, 7 Dec 2018 14:22:46 -0300
Message-ID: <20181207172246.3bdayfkuni6cbqks@alvherre.pgsql> (raw)
In-Reply-To: <31125.1544198945@sss.pgh.pa.us>
On 2018-Dec-07, Tom Lane wrote:
> =?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.
Whoops! Thanks for fixing. You're right, we quite likely didn't
specifically test the case of there being a toast table. Amazing that
it took so long to find it.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, oleksandr.shulgin@zalando.de
Subject: Re: BUG #15540: Use after release in ExecuteTruncateGuts
In-Reply-To: <20181207172246.3bdayfkuni6cbqks@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox