Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6dl0-0004oa-7A for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Mar 2019 16:07:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6dky-0005j4-CA for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Mar 2019 16:07:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6dky-0005ix-5S for pgsql-bugs@lists.postgresql.org; Wed, 20 Mar 2019 16:07:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6dkw-0002Oz-1o for pgsql-bugs@lists.postgresql.org; Wed, 20 Mar 2019 16:07:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2KG7lLM009113; Wed, 20 Mar 2019 12:07:47 -0400 From: Tom Lane To: Peter Eisentraut cc: julian.schauder@gmx.de, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15703: Segfault in cancelled CALL-Statements In-reply-to: <8678.1553097373@sss.pgh.pa.us> References: <15703-c12c5bc0ea34ba26@postgresql.org> <8678.1553097373@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 20 Mar 2019 11:56:13 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <9088.1553098021.0@sss.pgh.pa.us> Date: Wed, 20 Mar 2019 12:07:47 -0400 Message-ID: <9112.1553098067@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9088.1553098021.1@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 ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="bug-15703-reproducer.sql"; charset="us-ascii" Content-ID: <9088.1553098021.2@sss.pgh.pa.us> Content-Description: bug-15703-reproducer.sql 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(); ------- =_aaaaaaaaaa0--