pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Benson Jin <benson.jin@troo.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Segmentation Fault
Date: Tue, 12 Jun 2012 15:40:33 +0800
Message-ID: <4FD6F271.5030905@ringerc.id.au> (raw)
In-Reply-To: <299885816.271173.1339442120437.JavaMail.root@troo.com>
References: <299885816.271173.1339442120437.JavaMail.root@troo.com>

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

view thread (32+ messages)  latest in thread

Message-ID: <4FD6F271.5030905@ringerc.id.au>
Permalink:  ../4FD6F271.5030905@ringerc.id.au/
Also on:    postgresql.org/message-id/4FD6F271.5030905@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: ringerc@ringerc.id.au, benson.jin@troo.com
  Subject: Re: Segmentation Fault
  In-Reply-To: <4FD6F271.5030905@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox