pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yury Zhuravlev <u.zhuravlev@postgrespro.ru>
To: pgsql-hackers@postgresql.org
Subject: Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]
Date: Thu, 04 Aug 2016 15:08:13 +0300
Message-ID: <8629a08e-f3e0-4caa-9478-d85a454f656c@postgrespro.ru> (raw)
In-Reply-To: <1996641.25QjV5kv6m@abook>
References: <1637882.WfYN5gPf1A@abook>
	<1996641.25QjV5kv6m@abook>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Dmitry Ivanov wrote:
>> Recently I've encountered a strange crash while calling elog(ERROR, "...")
>> after the WaitForBackgroundWorkerShutdown() function. It turns out that
>> _returns_ inside the PG_TRY()..PG_CATCH() block are *highly* undesirable,
>> since they leave PG_exception_stack pointing to a local struct in a dead
>> frame, which is an obvious UB. I've attached a patch which fixes this
>> behavior in the aforementioned function, but there might be more errors
>> like that elsewhere.
>
> Forgot some curly braces, my bad. v2 attached.
>

Good catch. But in 9.6 it has been fixed by 
db0f6cad4884bd4c835156d3a720d9a79dbd63a9 commit. 


-- 
Yury Zhuravlev
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (4+ messages)  latest in thread

Message-ID: <8629a08e-f3e0-4caa-9478-d85a454f656c@postgrespro.ru>
Permalink:  ../8629a08e-f3e0-4caa-9478-d85a454f656c@postgrespro.ru/
Also on:    postgresql.org/message-id/8629a08e-f3e0-4caa-9478-d85a454f656c@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: u.zhuravlev@postgrespro.ru
  Subject: Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]
  In-Reply-To: <8629a08e-f3e0-4caa-9478-d85a454f656c@postgrespro.ru>
  References: <1637882.WfYN5gPf1A@abook> <1996641.25QjV5kv6m@abook> <8629a08e-f3e0-4caa-9478-d85a454f656c@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