Re: BUG #15703: Segfault in cancelled CALL-Statements - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15703: Segfault in cancelled CALL-Statements
Date
Msg-id 9112.1553098067@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15703: Segfault in cancelled CALL-Statements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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();

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15703: Segfault in cancelled CALL-Statements
Next
From: PG Bug reporting form
Date:
Subject: BUG #15707: Incorrect timing information in EXPLAIN ANALYZE output