Re: Optionally using a better backtrace library? - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Optionally using a better backtrace library?
Date
Msg-id 20230905033605.GB3367495@rfd.leadboat.com
Whole thread Raw
In response to Re: Optionally using a better backtrace library?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Optionally using a better backtrace library?
List pgsql-hackers
On Mon, Jul 03, 2023 at 11:58:25AM +0200, Alvaro Herrera wrote:
> On 2023-Jul-02, Andres Freund wrote:
> > I like that we now have a builtin backtrace ability. Unfortunately I think the
> > backtraces are often not very useful, because only externally visible
> > functions are symbolized.
> 
> Agreed, these backtraces are pretty close to useless.  Not completely,
> but I haven't found a practical way to use them for actual debugging
> of production problems.

For what it's worth, I use the attached script to convert the current
errbacktrace output to a fully-symbolized backtrace.  Nonetheless, ...

> > I hacked it up for ereport() to debug something, and the backtraces are
> > considerably better:
> > 
> > 2023-07-02 10:52:54.863 PDT [1398207][client backend][:0][[unknown]] LOG:  will crash
> > 2023-07-02 10:52:54.863 PDT [1398207][client backend][:0][[unknown]] BACKTRACE:
> >     [0x55fcd03e6143] PostgresMain: ../../../../home/andres/src/postgresql/src/backend/tcop/postgres.c:4126
> >     [0x55fcd031154c] BackendRun: ../../../../home/andres/src/postgresql/src/backend/postmaster/postmaster.c:4461
> >     [0x55fcd0310dd8] BackendStartup:
../../../../home/andres/src/postgresql/src/backend/postmaster/postmaster.c:4189
> >     [0x55fcd030ce75] ServerLoop: ../../../../home/andres/src/postgresql/src/backend/postmaster/postmaster.c:1779
> 
> Yeah, this looks much more usable.

... +1 for offering this.

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: persist logical slots to disk during shutdown checkpoint
Next
From: Dilip Kumar
Date:
Subject: Re: persist logical slots to disk during shutdown checkpoint