ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack
Alexander Pyhalov <a.pyhalov@postgrespro.ru>
From: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
To: Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2024-02-23T10:21:14Z
Lists: pgsql-hackers
Attachments
- 0001-Avoid-corrupting-PG_exception_stack-in-ExecAppendAsy.patch (text/x-diff) patch 0001
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
Commits
-
Fix bogus coding in ExecAppendAsyncEventWait().
- e10ca95ff7db 14.12 landed
- 3f96d113ff84 15.7 landed
- f6f61a4bd9cc 16.3 landed
-
Fix resource leak when a FDW's ForeignAsyncRequest function fails
- 555276f85940 14.11 cited
-
postgres_fdw: Fix handling of pending asynchronous requests.
- 1ec7fca85921 15.0 cited
-
Add support for asynchronous execution.
- 27e1f14563cf 14.0 cited