Re: SIGFPE handler is naive

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: SIGFPE handler is naive
Date: 2012-08-14 12:56:54
Message-ID: 20120814125654.GA16144@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 14, 2012 at 08:38:44AM -0400, Robert Haas wrote:
> On Mon, Aug 13, 2012 at 11:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > That would depend on how many places there are where SIGFPE is expected.
> > Are we sure there are any? Maybe we should just remove the handler and
> > let SIGFPE be treated as a core dump.
>
> No clue. According to Wikipedia, it is commonly caused by dividing by
> zero, or by dividing by INT_MIN by -1, resulting in a quotient out of
> range for the type. I'd be willing to bet that we have got all the
> division-by-zero cases patched up just because we try pretty hard to
> emit the right error message for such cases, but I'm a lot less
> certain that things like INT_MIN/-1 can't happen anywhere.

[local] test=# select -9223372036854775808/-1;
ERROR: floating-point exception

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-08-14 13:02:54 Re: SIGFPE handler is naive
Previous Message Kevin Grittner 2012-08-14 12:56:43 Re: default_isolation_level='serializable' crashes on Windows