pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack
Date: Fri, 22 Mar 2024 13:23:45 +0300
Message-ID: <ea1cef7a33a97ca5a3e67d3f4ffde345@postgrespro.ru> (raw)
In-Reply-To: <CAPmGK16VjbG05yBpB8bCVZBhq2pr60hZqYvMc7C+Lps7072wHg@mail.gmail.com>
References: <425fa29a429b21b0332737c42a4fdc70@postgrespro.ru>
	<ZdlBFS25eKruiQvO@paquier.xyz>
	<CAPmGK17=Asbxv5Bka3SC==yG1q+1MGV9LA6sb_DqLUG7AxbBAQ@mail.gmail.com>
	<CAPmGK16VjbG05yBpB8bCVZBhq2pr60hZqYvMc7C+Lps7072wHg@mail.gmail.com>

Etsuro Fujita писал(а) 2024-03-21 13:59:
> On Sun, Feb 25, 2024 at 6:34 PM Etsuro Fujita <etsuro.fujita@gmail.com> 
> wrote:
> 
>> > On Fri, Feb 23, 2024 at 01:21:14PM +0300, Alexander Pyhalov wrote:
>> > > 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.
>> 
>> I think this would happen when FDWs configure no events; IIRC I think
>> while the core allows them to do so, postgres_fdw does not do so, so
>> this would never happen with it.
> 
> I was wrong; as you pointed out, this would affect postgres_fdw as
> well.  See commit 1ec7fca85, which is my commit, but I forgot it
> completely.  :-(
> 
> As I said before, the patch looks good to me.  I tweaked comments in
> ExecAppendAsyncEventWait() a bit.  Attached is an updated patch.  In
> the patch I also fixed a confusing comment in a related function in
> postgres_fdw.c about handling of the in-process request that might be
> useless to process.
> 
> Sorry, it took more time than expected to get back to this thread.
> 

Hi. The updated patch still looks good to me.
-- 
Best regards,
Alexander Pyhalov,
Postgres Professional





view thread (12+ messages)  latest in thread

Message-ID: <ea1cef7a33a97ca5a3e67d3f4ffde345@postgrespro.ru>
Permalink:  ../ea1cef7a33a97ca5a3e67d3f4ffde345@postgrespro.ru/
Also on:    postgresql.org/message-id/ea1cef7a33a97ca5a3e67d3f4ffde345@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.pyhalov@postgrespro.ru, etsuro.fujita@gmail.com, michael@paquier.xyz
  Subject: Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack
  In-Reply-To: <ea1cef7a33a97ca5a3e67d3f4ffde345@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox