Re: bug in SignalSomeChildren

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug in SignalSomeChildren
Date: 2010-12-20 20:36:37
Message-ID: 20101220203637.GB13071@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-20 20:40:27 Re: bug in SignalSomeChildren
Previous Message Kenneth Marshall 2010-12-20 20:27:31 Re: Extensions, patch v20 (bitrot fixes)