Re: atexit_callback can be a net negative

From: Florian Weimer <fweimer(at)redhat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: atexit_callback can be a net negative
Date: 2014-03-07 15:02:17
Message-ID: 5319DF79.5080203@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/07/2014 03:57 PM, Tom Lane wrote:

> I think Florian's right that there's a risk there, but it seems pretty
> remote, and I don't see any reliable way to detect the case anyhow.
> (Process start time? Where would you get that from portably?)

I don't think there's a portable source for that. On Linux, you'd have
to use /proc.

> It's not a reason not to do something about the much larger chance of
> this happening in a direct child process, which certainly won't have a
> matching PID.

Indeed. Checking getppid() in addition might narrow things down further.

On Linux, linking against pthread_atfork currently requires linking
against pthread (although this is about to change), and it might incur
the pthread-induced overhead on some configurations.

--
Florian Weimer / Red Hat Product Security Team

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-03-07 15:04:47 on_exit_reset fails to clear DSM-related exit actions
Previous Message Tom Lane 2014-03-07 14:57:14 Re: atexit_callback can be a net negative