Re: Segmentation Fault

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Benson Jin <benson(dot)jin(at)troo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation Fault
Date: 2012-06-12 07:40:33
Message-ID: 4FD6F271.5030905@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/12/2012 03:15 AM, Benson Jin wrote:
> Hi All,
>
> A silly question.... how do I get install external symbols for
> postgresql, if compiled it myself previously? Do I recompile it with
> --enable-debug option?

If you didn't strip the executable then the cores produced even without
--enable-debug will be somewhat useful, but debug info is ideal. You
could try that first, since it'll give you a chance to make sure you can
at least get and analyse a core file before spending time recompiling
and reinstalling Pg.

Recompiling with --enable-debug is the easy way to get executables with
debug info embedded in them. If the installed libraries, etc haven't
changed since compiling your original copy of PostgreSQL, and if you're
compiling the EXACT same source code, you can debug the core against
these executables without replacing the ones you're actually running.
Something like a libc upgrade since the original copies were built might
mean that the new debug executables are no longer exactly compatible
with the ones your core file came from, though, so the results can't be
totally trusted.

Ideally you want to run the debug executables and get the core to debug
from them. An --enable-debug build on gcc will still be optimised and
should have no detectable performance difference. The executables are
huge, but the ELF sections containing the debug info never get mapped
in, so it doesn't actually matter.

An alternative is to build with --enable-debug, strip the debug info
into external symbols packages using "strip --only-keep-debug". There
isn't much point unless disk space consumed by executables is a big
concern, though.

I always use --enable-debug when building Pg. I rarely need the symbols,
but it's handy to have them when I do.

--
Craig Ringer

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2012-06-12 07:48:08 Re: Question about load balance
Previous Message Sachin Srivastava 2012-06-12 07:05:02 Re: Postgres 9.2 beta2 one-click installer on windows