Re: elog a stack trace - Mailing list pgsql-hackers

From MauMau
Subject Re: elog a stack trace
Date
Msg-id C13F6A104761484EB9EC35D78A56F524@maumau
Whole thread Raw
In response to elog a stack trace  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: elog a stack trace
List pgsql-hackers
From: "Jeff Janes" <jeff.janes@gmail.com>
> Does anyone have any hints on how to get a stack trace programmatically,
> rather than trying to run ps to get the pid and then attach gdb to a
> ephemeral process and hoping the situation has not been changed while you
> are doing that?  I'd like to set
>
> log_error_verbosity = stack
>
> or
>
> elog_stack(,...)
>
> But those don't exist.

On Windows, you can use Stackwalk() or Stackwalk64() Win32 API.  Several 
years ago, for some software, I implemented a feature that outputs the stack 
trace of a crashing process to its server log file.

It would be very nice if PostgreSQL outputs the stack trace of a crashing 
postgres process in the server log.  That eliminates the need for users in 
many cases to send the huge core files to the support staff or to use the 
debugger to get the stack trace.  I've recently heard that MySQL has this 
feature.

Regards
MauMau




pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Per table autovacuum vacuum cost limit behaviour strange
Next
From: Mark Kirkwood
Date:
Subject: Re: Per table autovacuum vacuum cost limit behaviour strange