ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

From: Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack
Date: 2024-02-23 10:21:14
Message-ID: 425fa29a429b21b0332737c42a4fdc70@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

Recent commit 555276f8594087ba15e0d58e38cd2186b9f39f6d introduced final
cleanup of node->as_eventset in ExecAppendAsyncEventWait().
Unfortunately, now this function can return in the middle of TRY/FINALLY
block, without restoring PG_exception_stack.

We found this while working on our FDW. Unfortunately, I couldn't
reproduce the issue with postgres_fdw, but it seems it is also affected.

The following patch heals the issue.

-- l
Best regards,
Alexander Pyhalov,
Postgres Professional

Attachment Content-Type Size
0001-Avoid-corrupting-PG_exception_stack-in-ExecAppendAsy.patch text/x-diff 1.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-02-23 10:30:19 Refactor SASL exchange in preparation for OAuth Bearer
Previous Message vignesh C 2024-02-23 10:20:21 Re: A failure in t/001_rep_changes.pl