Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-22 Thread Michael Paquier
On Mon, Oct 21, 2019 at 12:53:27AM -0400, Tom Lane wrote: > Oh --- looking closer, proc_exit itself will clear error_context_stack > before doing much. So a problem would only occur if we suffered an error > during EmitErrorReport, which seems somewhat unlikely. Still, it's bad > that this code i

Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-20 Thread Tom Lane
Michael Paquier writes: > On Mon, Oct 21, 2019 at 12:47:40AM -0400, Tom Lane wrote: >> This seems like a real and possibly serious bug to me. Backend sigsetjmp >> callers *must* clear error_context_stack (or restore it to a previous >> value), because if it isn't NULL it's surely pointing at garb

Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-20 Thread Michael Paquier
On Mon, Oct 21, 2019 at 12:47:40AM -0400, Tom Lane wrote: > This seems like a real and possibly serious bug to me. Backend sigsetjmp > callers *must* clear error_context_stack (or restore it to a previous > value), because if it isn't NULL it's surely pointing at garbage, ie a > local variable tha

Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-20 Thread Tom Lane
I wrote: > The issue might be argued to be insignificant because the autovacuum > worker is just going to do proc_exit anyway. But if it encountered > another error during proc_exit, elog.c might try to invoke error > callbacks using garbage callback data. Oh --- looking closer, proc_exit itself

Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-20 Thread Tom Lane
Michael Paquier writes: > On Fri, Oct 18, 2019 at 05:55:32PM -0700, Ashwin Agrawal wrote: >> I am not sure if this causes any potential problems or not, but for >> consistency of code seems we are missing below. All other places in code >> where sigsetjmp() exists for top level handling has error_

Re: Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-20 Thread Michael Paquier
On Fri, Oct 18, 2019 at 05:55:32PM -0700, Ashwin Agrawal wrote: > I am not sure if this causes any potential problems or not, but for > consistency of code seems we are missing below. All other places in code > where sigsetjmp() exists for top level handling has error_context_stack set > to NULL.

Missing error_context_stack = NULL in AutoVacWorkerMain()

2019-10-18 Thread Ashwin Agrawal
I am not sure if this causes any potential problems or not, but for consistency of code seems we are missing below. All other places in code where sigsetjmp() exists for top level handling has error_context_stack set to NULL. diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaste