Re: PATCH: backtraces for error messages - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: PATCH: backtraces for error messages
Date
Msg-id CAMsr+YGBw9tgKRGxyihVeMzmjQx_2t8D17tE7t5-0gMdW7S6UA@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: backtraces for error messages  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: PATCH: backtraces for error messages
List pgsql-hackers
On 21 June 2018 at 19:09, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote:

I think this for assertion failure is no problem but I'm not sure
for other cases.

I think it's pretty strongly desirable for PANIC.
 
We could set proper context description or other
additional information in error messages before just dumping a
trace for known cases.

Yeah. The trouble there is that there are a _lot_ of places to touch for such things, and inevitably the one you really want to see will be something that didn't get suitably annotated.
 
Since PG9.5 RPMs are complied with --enable-dtrace so we could
use system tap to insert the stack-trace stuff. Additional
built-in probe in error reporting system or assertions would make
this pluggable.

I don't bother with SystemTAP anymore; perf does the job for most purposes.

You can use --enable-dtrace SDTs with Perf fine. I wrote it up for Pg at https://wiki.postgresql.org/wiki/Profiling_with_perf#PostgreSQL_pre-defined_tracepoint_events .

Dynamic tracepoints are also very useful.

Both require debuginfo, but so does outputting of symbolic stacks per my patch.

(That reminds me, I need to chat with Devrim about creating a longer lived debuginfo + old versions rpms repo for Pg its self, if not the accessory bits and pieces. I'm so constantly frustrated by not being able to get needed debuginfo packages to investigate some core or running system problem because they've been purged from the PGDG yum repo as soon as a new version comes out.)

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: WIP: BRIN multi-range indexes
Next
From: Michael Paquier
Date:
Subject: Re: Incorrect errno used with %m for backend code