Re: SIGFPE handler is naive

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: SIGFPE handler is naive
Дата
Msg-id CA+TgmoZQGsdNVHmBXLedMxX+-47Y65+Goy9TTLSzefLjAEPL+A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: SIGFPE handler is naive  (Noah Misch <noah@leadboat.com>)
Ответы Re: SIGFPE handler is naive
Список pgsql-hackers
On Mon, Aug 13, 2012 at 10:14 PM, Noah Misch <noah@leadboat.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: 9.2 Cascading replication after slave promotion
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SIGFPE handler is naive