Re: BUG #15378: SP-GIST memory context screwup?

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: BUG #15378: SP-GIST memory context screwup?
Date: 2018-09-11 15:47:37
Message-ID: 87y3c8oy1g.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "Alexander" == Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru> writes:

>> So this logic was added in ccd6eb49a and was wrong from the start.
>> Testing suggests that removing the offending pfree does indeed fix
>> the issue; any objections?

Alexander> No objections from me.

But it turns out that removing the pfree will cause transient leakage
within the scan, since ScanStackEntry objects are also freed retail
during a walk. ugh.

So the simplest fix would be to move the memory context reset to just
after the freeScanStack in resetSpGistScanOpaque. And with retail
freeing going on during the scan, it makes less sense to try and avoid
it during rescan, double ugh.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2018-09-11 16:18:42 Re: BUG #15376: Postgres sql 9.4.19 pg_upgrade stops with error The source cluster was not shut down cleanly.
Previous Message kalyani kaniganti 2018-09-11 15:27:26 Re: BUG #15376: Postgres sql 9.4.19 pg_upgrade stops with error The source cluster was not shut down cleanly.