Re: Printing backtrace of postgres processes
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, vignesh C <vignesh21@gmail.com>, torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-02-07T09:27:28Z
Lists: pgsql-hackers
On Wed, Feb 07, 2024 at 02:04:39PM +0530, Bharath Rupireddy wrote: > Well, that 'ubuntu' is the default username there, I've changed it now > and kept the output short. I would keep it just at two or three lines, with a "For example, with lines like": > I've simplified the tests, now we don't need two separate output files > for tests. Please see the attached v27 patch. + proname => 'pg_log_backtrace', provolatile => 'v', prorettype => 'bool', Hmm. Would it be better to be in line with memory contexts logging and use pg_log_backend_backtrace()? One thing I was wondering is that there may be a good point in splitting the backtrace support into two functions (backends and auxiliary processes) that could be split with two execution ACLs across different roles. + PROCSIG_LOG_BACKTRACE, /* ask backend to log the current backtrace */ Incorrect order. +-- Backtrace is not logged for auxiliary processes Not sure there's a point in keeping that in the tests for now. + * XXX: It might be worth implementing it for auxiliary processes. Same, I would remove that. +static volatile sig_atomic_t backtrace_functions_loaded = false; Hmm, so you need that because of the fact that it would be called in a signal as backtrace(3) says: "If you need certain calls to these two functions to not allocate memory (in signal handlers, for example), you need to make sure libgcc is loaded beforehand". True that it is not interesting to only log something when having a CFI, this needs to be dynamic to get a precise state of things. -- Michael
Commits
-
Perform apply of large transactions by parallel workers.
- 216a784829c2 16.0 cited
-
Enhance pg_log_backend_memory_contexts() for auxiliary processes.
- 790fbda90209 15.0 cited
-
Allow GRANT on pg_log_backend_memory_contexts().
- f0b051e322d5 15.0 cited
-
Move Perl test modules to a better namespace
- b3b4d8e68ae8 15.0 cited
-
Unify PostgresNode's new() and get_new_node() methods
- 201a76183e20 15.0 cited
-
Add backtrace support for error reporting
- 71a8a4f6e365 13.0 cited