Re: debugging the server[ module causes server cash] - Mailing list pgsql-general

From mike@trausch.us
Subject Re: debugging the server[ module causes server cash]
Date
Msg-id 4F2D41A8.1020408@trausch.us
Whole thread Raw
In response to debugging the server[ module causes server cash]  (Dave Potts <dave.potts@pinan.co.uk>)
List pgsql-general
On 02/04/2012 02:37 AM, Dave Potts wrote:
> I have just inherited a private C module that lives in the context of
> the server with little or no documentation.
>
> It crashes taking the database down,  is there any advice on how to
> debug this type of beast ?
>
> This is not a problem with the postgres server but user module.

While I cannot offer advice specific to PostgreSQL (and someone here
might be better equipped to do that if there is anything that must be
done special for PostgreSQL), I can say that what you need to do is try
to use the debugger to catch the crash.

If you can do that, then you can get a backtrace and start working from
there.

If you are not comfortable with the debugger, you can instead put
debugging statements in your custom module.  This way, you can trace
where it is crashing.  If you are running on a system that has glibc, it
provides some helpful functions where you can display backtraces at
arbitrary points in your code:

  http://www.linuxjournal.com/article/6391
  http://www.gnu.org/software/libc/manual/html_node/Backtraces.html

In any case, good luck!

    --- Mike

--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
                                   --- Carveth Read, “Logic”


Attachment

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Why this regexp matches?!
Next
From: David Johnston
Date:
Subject: Re: Why this regexp matches?!