Re: SIGFPE handler is naive - Mailing list pgsql-hackers

From Noah Misch
Subject Re: SIGFPE handler is naive
Date
Msg-id 20120814200233.GA19401@tornado.leadboat.com
Whole thread Raw
In response to Re: SIGFPE handler is naive  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: SIGFPE handler is naive
List 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@mit.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.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: TRUE/FALSE vs true/false
Next
From: "Kevin Grittner"
Date:
Subject: Re: default_isolation_level='serializable' crashes on Windows