From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: pgsql-bugs@lists.postgresql.org, Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: BUG #15378: SP-GIST memory context screwup?
Date: Tue, 11 Sep 2018 16:47:37 +0100
Message-ID: <87y3c8oy1g.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAPpHfdvbVMjB7ORQeXRxMX65u7P-TfG66bZh5U7+3j2QTAov-A@mail.gmail.com>
References: <153663176628.23136.11901365223750051490@wrigleys.postgresql.org>
<87bm94rba5.fsf@news-spur.riddles.org.uk>
<CAPpHfdvbVMjB7ORQeXRxMX65u7P-TfG66bZh5U7+3j2QTAov-A@mail.gmail.com>
>>>>> "Alexander" == Alexander Korotkov <a.korotkov@postgrespro.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)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: andrew@tao11.riddles.org.uk, a.korotkov@postgrespro.ru, teodor@sigaev.ru
Subject: Re: BUG #15378: SP-GIST memory context screwup?
In-Reply-To: <87y3c8oy1g.fsf@news-spur.riddles.org.uk>
References: <153663176628.23136.11901365223750051490@wrigleys.postgresql.org> <87bm94rba5.fsf@news-spur.riddles.org.uk> <CAPpHfdvbVMjB7ORQeXRxMX65u7P-TfG66bZh5U7+3j2QTAov-A@mail.gmail.com> <87y3c8oy1g.fsf@news-spur.riddles.org.uk>
* 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