Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oVFi1-0004Ox-Pj for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Sep 2022 17:16:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oVFhz-0005y3-Mz for pgsql-bugs@arkaria.postgresql.org; Mon, 05 Sep 2022 17:16:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oVFhz-0005xu-Ea for pgsql-bugs@lists.postgresql.org; Mon, 05 Sep 2022 17:16:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oVFhw-0006Sc-GF for pgsql-bugs@lists.postgresql.org; Mon, 05 Sep 2022 17:16:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 285HGJeL2452251; Mon, 5 Sep 2022 13:16:19 -0400 From: Tom Lane To: thomas.d.mckay@gmail.com cc: Alvaro Herrera , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17607: Server process crashes when PLpgSQL function raises error in subtransaction In-reply-to: <17607-bd8ccc81226f7f80@postgresql.org> References: <17607-bd8ccc81226f7f80@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 05 Sep 2022 11:09:27 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2452249.1662398179.1@sss.pgh.pa.us> Date: Mon, 05 Sep 2022 13:16:19 -0400 Message-ID: <2452250.1662398179@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I've encountered a bug while doing some SQL migrations on a PostgreSQL 13.8 > server. My initial use-case is a Django app running migrations, a test setup > and a test, but that code was more than 10K lines of DDL, so I've reduced > the code to a minimal reproducible example (as best I could). Thanks for the minimal reproducer! I confirm that this problem is visible in the v12 and v13 branches, but not before or after. On the master branch, it was introduced at Author: Alvaro Herrera Branch: master Release: REL_14_BR [25936fd46] 2021-02-27 18:09:15 -0300 Fix use-after-free bug with AfterTriggersTableData.storeslot and repaired, seemingly accidentally, by Author: Tom Lane Branch: master Release: REL_14_BR [c5b7ba4e6] 2021-04-06 15:57:11 -0400 Postpone some stuff out of ExecInitModifyTable. 25936fd46 was back-patched into v12 and v13, which is why they show the bug. c5b7ba4e6 was not back-patched, both because it'd be way too invasive and because we weren't aware that it was fixing anything. I'm not really sure that it *did* fix anything --- perhaps there are variants of this example that still fail? cc'ing Alvaro for comment. regards, tom lane