Re: bug in SignalSomeChildren - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: bug in SignalSomeChildren
Date
Msg-id 20101220203637.GB13071@svana.org
Whole thread Raw
In response to Re: bug in SignalSomeChildren  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: bug in SignalSomeChildren  (Robert Haas <robertmhaas@gmail.com>)
Re: bug in SignalSomeChildren  (Eric Ridge <eebbrr@gmail.com>)
List pgsql-hackers
On Mon, Dec 20, 2010 at 03:08:02PM -0500, Robert Haas wrote:
> The attached patch appears to work correctly on MacOS X.  I did check,
> BTW: getppid() in the attached process returns gdb's pid.  Poor!

This appears to be a BSDism at least. On Linux and BSD derivatives the
man pages specifically mention the reparenting (needed for catching
signals) but on Linux getppid() is specifically documented to return
the correct value anyway.

Frankly it's a wart, for example strace/truss/whatever could (since
it's tracing anyway) just fudge the correct value in the getppid() call
so the userspace process doesn't notice. This has been a bug since
forever though, so I wouldn't hold my breath.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first.
>                                       - Charles de Gaulle

pgsql-hackers by date:

Previous
From: Kenneth Marshall
Date:
Subject: Re: Extensions, patch v20 (bitrot fixes)
Next
From: Robert Haas
Date:
Subject: Re: bug in SignalSomeChildren