> 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