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

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "jian(dot)long\(at)i-soft(dot)com(dot)cn" <jian(dot)long(at)i-soft(dot)com(dot)cn>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is there a memory leak in commit 8561e48?
Date: 2018-04-27 06:44:51
Message-ID: 87lgd99owr.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> I would bet money that that "_SPI_current->internal_xact" thing is
Tom> wrong/inadequate.

In particular this looks wrong to me: after doing:

do $$
begin
execute 'declare foo cursor with hold for select 1/x as a from (values (1),(0)) v(x)';
commit; -- errors within the commit
end;
$$;
ERROR: division by zero
CONTEXT: PL/pgSQL function inline_code_block line 1 at COMMIT

the SPI stack is not cleaned up at all, and _SPI_connected is >= 0 even
when back at the main backend command loop.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yuriy Zhuravlev 2018-04-27 07:10:21 Re: Is a modern build system acceptable for older platforms
Previous Message Andrey Borodin 2018-04-27 06:38:02 Re: GSoC 2018: Sorting Algorithm and Benchmarking