Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]

From: Dmitry Ivanov <d(dot)ivanov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]
Date: 2016-08-04 11:47:59
Message-ID: 1996641.25QjV5kv6m@abook
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fix_WaitForBackgroundWorkerShutdown_v2.patch text/x-patch 662 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yury Zhuravlev 2016-08-04 12:08:13 Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]
Previous Message Dmitry Ivanov 2016-08-04 11:44:08 Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE]