From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: julian.schauder@gmx.de
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15703: Segfault in cancelled CALL-Statements
Date: Wed, 20 Mar 2019 12:07:47 -0400
Message-ID: <9112.1553098067@sss.pgh.pa.us> (raw)
In-Reply-To: <8678.1553097373@sss.pgh.pa.us>
References: <15703-c12c5bc0ea34ba26@postgresql.org>
<8678.1553097373@sss.pgh.pa.us>
I wrote:
> Poking around a bit, it seems like this is a thinko in HoldPinnedPortals:
> it's not considering the possibility of a failure during HoldPortal().
> In your test the failure is triggered by query cancel, but an ordinary
> execution error while finishing out a cursor's calculations would be
> a problem too.
Pursuant to which observation, here's a fully self-contained test case.
regards, tom lane
CREATE PROCEDURE crashme()
LANGUAGE plpgsql
AS $procedure$
DECLARE id_ int;
BEGIN
FOR id_ IN SELECT 1/(x-1000) from GENERATE_SERIES(1,1000) x LOOP
COMMIT;
END LOOP;
END;
$procedure$;
call crashme();
Attachments:
[text/plain] bug-15703-reproducer.sql (222B, ../9112.1553098067@sss.pgh.pa.us/2-bug-15703-reproducer.sql)
download | inline:
CREATE PROCEDURE crashme()
LANGUAGE plpgsql
AS $procedure$
DECLARE id_ int;
BEGIN
FOR id_ IN SELECT 1/(x-1000) from GENERATE_SERIES(1,1000) x LOOP
COMMIT;
END LOOP;
END;
$procedure$;
call crashme();
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: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, julian.schauder@gmx.de, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15703: Segfault in cancelled CALL-Statements
In-Reply-To: <9112.1553098067@sss.pgh.pa.us>
* 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