Re: Segmentation Fault - Mailing list pgsql-general

From Craig Ringer
Subject Re: Segmentation Fault
Date
Msg-id 4FD6F271.5030905@ringerc.id.au
Whole thread Raw
In response to Re: Segmentation Fault  (Benson Jin <benson.jin@troo.com>)
List 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

pgsql-general by date:

Previous
From: Sachin Srivastava
Date:
Subject: Re: Postgres 9.2 beta2 one-click installer on windows
Next
From: John R Pierce
Date:
Subject: Re: Question about load balance