Re: Printing backtrace of postgres processes - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Printing backtrace of postgres processes
Date
Msg-id 20210506195520.vqd4nss5j64upv5t@alap3.anarazel.de
Whole thread Raw
In response to Re: Printing backtrace of postgres processes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [Patch] ALTER SYSTEM READ ONLY
Next
From: Andres Freund
Date:
Subject: Re: .ready and .done files considered harmful