Re: SIGFPE handler is naive

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Greg Stark <stark(at)mit(dot)edu>, Nils Goroll <slink(at)schokola(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SIGFPE handler is naive
Date: 2012-08-14 20:02:33
Message-ID: 20120814200233.GA19401@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 14, 2012 at 08:40:06AM -0400, Robert Haas wrote:
> On Tue, Aug 14, 2012 at 6:50 AM, Greg Stark <stark(at)mit(dot)edu> wrote:
> > It is possible to check if the signal was synchronous or was sent from
> > an external process. You can check siginfo->si_pid to see who sent you
> > the signal. I'm not sure checking that and handling it at
> > check_for_interrupts if it's asynchronous is the best solution or not
> > though.
>
> If that's portable it might be an option, but I doubt that it is.

I suspect it is portable. Nonetheless, kill() is not the only SIGFPE source
that ought to produce a PANIC. Library code might trigger the signal, at
which point we cannot assume that elog(ERROR) will leave an acceptable system
state. To call this fixed, we need a whitelist of safe sources, not a
blacklist of bogus sources.

That said, I agree that the effort and risk may be out of proportion.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-08-14 20:26:19 pgsql: Revert "commit_delay" change; just add comment that we don't hav
Previous Message Bruce Momjian 2012-08-14 19:24:53 Re: TRUE/FALSE vs true/false