Re: Debug crash

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Debug crash
Дата
Msg-id 20081211084941.GA22961@svana.org
обсуждение исходный текст
Ответ на Debug crash  ("Alif Isophoqote" <isophoqote@gmail.com>)
Список pgsql-hackers
On Thu, Dec 11, 2008 at 04:29:56PM +0800, Alif Isophoqote wrote:
> Hi,
>
> I am developing a backend module for postgresql. For some queries,
> postgresql crashes: segmentation fault (most probably due to my own code).
> How to get the function name & line number where it crashes?

Arrange for a core dump to be dropped and use gdb.

Alternativly, if you know the dump is in a specific backend, use GDB to
attach to the backend in question before it crashes. Then GDB will stop
your program at the point of a segfault and you can examine all the
state, fix things on the fly, etc.

Oh, you'll need debug symbols in both the backend server and your
module, otherwise you're setting youself up for a lot of pain.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

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

Предыдущее
От: "Alif Isophoqote"
Дата:
Сообщение: Debug crash
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: Debug crash