Re: Async-unsafe functions in signal handlers

Поиск
Список
Период
Сортировка
От Denis Smirnov
Тема Re: Async-unsafe functions in signal handlers
Дата
Msg-id 86F918AA-AE0E-4EAB-B6C1-7000043EAB50@arenadata.io
обсуждение исходный текст
Ответ на Re: Async-unsafe functions in signal handlers  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Async-unsafe functions in signal handlers  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
> 26 авг. 2021 г., в 23:39, Tom Lane <tgl@sss.pgh.pa.us> написал(а):
>
> (BTW, I think it's pretty silly to imagine that adding backtrace()
> calls inside ereport is making things any more dangerous.  ereport
> has pretty much always carried a likelihood of calling malloc(),
> for example.)

I have taken a look through the signal handlers and found out that many of them use malloc() via ereport() and elog().
Hereis the list: 

SIGUSR1
- procsignal_sigusr1_handler(): autoprewarm, autovacuum, bgworker, bgwriter, checkpointer, pgarch, startup, walwriter,
walreciever,walsender 
- sigusr1_handler(): postmaster

SIGFPE:
- FloatExceptionHandler(): autovacuum, bgworker, postgres, plperl

SIGHUP:
- SIGHUP_handler(): postmaster

SIGCHLD:
- reaper(): postmaster

SIGQUIT:
- quickdie(): postgres

SIGTERM:
- bgworker_die(): bgworker

SIGALRM:
- handle_sig_alarm(): autovacuum, bgworker, postmaster, startup, walsender, postgres

I suspect there are lots of potential ways to lock on malloc() inside any of this handlers. An interesting question is
whythere are still no evidence of such locks? 

Best regards,
Denis Smirnov | Developer
sd@arenadata.io
Arenadata | Godovikova 9-17, Moscow 129085 Russia




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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: log_autovacuum in Postgres 14 -- ordering issue
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Async-unsafe functions in signal handlers