| From: | Yury Zhuravlev <u(dot)zhuravlev(at)postgrespro(dot)ru> | 
|---|---|
| To: | <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE] | 
| Date: | 2016-08-04 12:08:13 | 
| Message-ID: | 8629a08e-f3e0-4caa-9478-d85a454f656c@postgrespro.ru | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Aleksander Alekseev | 2016-08-04 12:14:51 | Re: [Patch] Temporary tables that do not bloat pg_catalog (a.k.a fast temp tables) | 
| Previous Message | Dmitry Ivanov | 2016-08-04 11:47:59 | Re: Bug in WaitForBackgroundWorkerShutdown() [REL9_5_STABLE] |