Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE] - Mailing list pgsql-hackers

From Dmitry Ivanov
Subject Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]
Date
Msg-id 1996641.25QjV5kv6m@abook
Whole thread Raw
In response to Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]  (Dmitry Ivanov <d.ivanov@postgrespro.ru>)
Responses Re: Bug in WaitForBackgroundWorkerShutdown()[REL9_5_STABLE]  (Yury Zhuravlev <u.zhuravlev@postgrespro.ru>)
List pgsql-hackers
> 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.

--
Dmitry Ivanov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
Attachment

pgsql-hackers by date:

Previous
From: Dmitry Ivanov
Date:
Subject: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]
Next
From: Yury Zhuravlev
Date:
Subject: Re: Bug in WaitForBackgroundWorkerShutdown()[REL9_5_STABLE]