Re: debugging the server[ module causes server cash]

Поиск
Список
Период
Сортировка
От mike@trausch.us
Тема Re: debugging the server[ module causes server cash]
Дата
Msg-id 4F2D41A8.1020408@trausch.us
обсуждение исходный текст
Ответ на debugging the server[ module causes server cash]  (Dave Potts <dave.potts@pinan.co.uk>)
Список 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”


Вложения

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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Why this regexp matches?!
Следующее
От: David Johnston
Дата:
Сообщение: Re: Why this regexp matches?!