Hi,
On 2021-05-06 15:22:02 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > we allow generating backtraces in all kind of places, including
> > e.g. some inside critical sections via backtrace_functions.
>
> If there's an elog call inside a critical section, that seems
> like a problem already. Are you sure that there are any such?
There's several, yes. In xlog.c there's quite a few that are gated by
wal_debug being enabled. But also a few without that,
e.g. XLogFileInit() logging
elog(DEBUG1, "creating and filling new WAL file");
and XLogFileInit() can be called within a critical section.
Greetings,
Andres Freund