Re: Debug crash

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Alif Isophoqote <isophoqote(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Debug crash
Date: 2008-12-11 08:49:41
Message-ID: 20081211084941.GA22961@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

  • Debug crash at 2008-12-11 08:29:56 from Alif Isophoqote

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2008-12-11 08:53:58 Re: Debug crash
Previous Message Alif Isophoqote 2008-12-11 08:29:56 Debug crash