Re: BUG #17607: Server process crashes when PLpgSQL function raises error in subtransaction

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: thomas(dot)d(dot)mckay(at)gmail(dot)com
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17607: Server process crashes when PLpgSQL function raises error in subtransaction
Date: 2022-09-05 17:16:19
Message-ID: 2452250.1662398179@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> 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 <alvherre(at)alvh(dot)no-ip(dot)org>
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 <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-09-05 17:19:53 Re: BUG #17606: There is still some glitch in 3f7323cbb fixing failure of MULTIEXPR_SUBLINK
Previous Message Andre Lin 2022-09-05 16:50:19 Re: BUG #17606: There is still some glitch in 3f7323cbb fixing failure of MULTIEXPR_SUBLINK