Re: atexit_callback can be a net negative

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: atexit_callback can be a net negative
Дата
Msg-id 5319D669.6010405@redhat.com
обсуждение исходный текст
Ответ на atexit_callback can be a net negative  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: atexit_callback can be a net negative  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
On 03/07/2014 06:03 AM, Tom Lane wrote:

> In the bug thread I proposed making atexit_callback check whether getpid()
> still matches MyProcPid.  If it doesn't, then presumably we inherited the
> atexit callback list, along with the value of MyProcPid, from some parent
> backend process whose elbow we should not joggle.  Can anyone see a flaw
> in that?

There's the PID reuse problem.  Forking twice (with a delay) could end 
up with the same PID as MyProcPid.  Comparing the process start time 
would protect against that.  Checking getppid() would have the same 
theoretical problem.

-- 
Florian Weimer / Red Hat Product Security Team



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: extension_control_path
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_ctl status with nonexistent data directory