Re: Re: Is there a memory leak in commit 8561e48?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "jian(dot)long(at)i-soft(dot)com(dot)cn" <jian(dot)long(at)i-soft(dot)com(dot)cn>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: Re: Is there a memory leak in commit 8561e48?
Date: 2018-04-20 03:37:08
Message-ID: 20180420033708.GA7613@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 20, 2018 at 10:00:38AM +0800, jian(dot)long(at)i-soft(dot)com(dot)cn wrote:
> what about just free _SPI_stack in AtEOXact_SPI? if the transaction
> end was initiated by SPI , AtEOXact_SPI will do nothing. For example:
> @@ -283,6 +295,8 @@ AtEOXact_SPI(bool isCommit)
> errmsg("transaction left non-empty SPI stack"),
> errhint("Check for missing \"SPI_finish\" calls.")));
>
> + if (_SPI_stack)
> + pfree(_SPI_stack);

Sure, but that is rather inconsistent with the handling which exists
using TopTransactionContext where the API stack is deleted at the same
time as the transaction context, which causes this approach to be
inconsistent for atomic and non-atomic calls of SPI_connect_ext. Let's
see what is Peter's take here first.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-04-20 04:42:41 Re: [sqlsmith] Unpinning error in parallel worker
Previous Message David Rowley 2018-04-20 02:41:13 Re: Should we add GUCs to allow partition pruning to be disabled?