Re: SIGFPE handler is naive

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SIGFPE handler is naive
Date: 2012-08-14 02:33:58
Message-ID: CA+TgmoZQGsdNVHmBXLedMxX+-47Y65+Goy9TTLSzefLjAEPL+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 13, 2012 at 10:14 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> If this use of SIGFPE is handy, we should expose it under a better name. What
> hazards make it unsafe?

Well, the most obvious problem is that a backend might receive it
while holding a spinlock.

> Overall, though, I think it best to plug this. We could set a flag before
> each operation, like evaluation of SQL arithmetic, for which SIGFPE is normal.
> If the signal handler sees the flag set, raise ERROR. Otherwise, PANIC. Code
> running with the flag set would, of course, need to be ready for a spontaneous
> elog(ERROR) at any instruction.

Yeah, that's what I thought of, too. It seems like it'd be a lot of
work to get there, though.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-08-14 03:52:06 Re: SIGFPE handler is naive
Previous Message Stephen Frost 2012-08-14 02:24:48 Re: 9.2 Cascading replication after slave promotion