errbacktrace

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема errbacktrace
Дата
Msg-id 5f48cb47-bf1e-05b6-7aae-3bf2cd01586d@2ndquadrant.com
обсуждение исходный текст
Ответы Re: errbacktrace  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: errbacktrace  (Ashwin Agrawal <aagrawal@pivotal.io>)
Re: errbacktrace  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Re: errbacktrace  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
New thread continuing from
<https://www.postgresql.org/message-id/d4903af2-e7b7-b551-71f8-3e4a6bdc2e73@2ndquadrant.com>.

Here is a extended version of Álvaro's patch that adds an errbacktrace()
function.  You can do two things with this:

- Manually attach it to an ereport() call site that you want to debug.

- Set a configuration parameter like backtrace_function = 'int8in' to
debug ereport()/elog() calls in a specific function.

There was also mention of settings that would automatically produce
backtraces for PANICs etc.  Those could surely be added if there is
enough interest.

For the implementation, I support both backtrace() provided by the OS as
well as using libunwind.  The former seems to be supported by a number
of platforms, including glibc, macOS, and FreeBSD, so maybe we don't
need the libunwind suport.  I haven't found any difference in quality in
the backtraces between the two approaches, but surely that is highly
dependent on the exact configuration.

I would welcome testing in all direction with this, to see how well it
works in different circumstances.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Amit Khandekar
Дата:
Сообщение: Re: Minimal logical decoding on standbys
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: fsync error handling in pg_receivewal, pg_recvlogical