Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id D822C1997F5A for ; Tue, 12 Jun 2012 04:40:54 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SeLie-0005IL-Mi for pgsql-general@postgresql.org; Tue, 12 Jun 2012 07:40:54 +0000 Received: by dady13 with SMTP id y13so6502565dad.19 for ; Tue, 12 Jun 2012 00:40:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=cYIh5SbytdpA8byPye3uiJ4gUYpth2rKcG7PwZ6Oms0=; b=MDyeYTUuL5RN/GFHuvRXHXDWBslDhs06gSzGoMjQaeQla1lRHELWmFYdqhtXwA2465 gaE+7uO1s6e28lqh+0lvtUKUQr0kGhKmKJQkNXzliDaxlqKX2PdW5VhBMmPTLVsi1Y3Y f/qfH3EJ+XK0ZKWAzjoRkFvYiTz+w7P9UiHbsirRH1T9NpTRc2pnmX1iDvTO6NI9JENE T1Rk3I7iD/4XSRsOwdBHWjJQkfzlBzp0dTdlY34hED+G9oyPF3F/dq2HbZr7ddiFbyhP JlyOyVYeIs2/XUaenK0I+xR10qgDutF5aCTs7Go0jUizBRruGuds1KDUsUqwPmTyd2Iz Q9KA== Received: by 10.68.237.202 with SMTP id ve10mr35514833pbc.54.1339486839830; Tue, 12 Jun 2012 00:40:39 -0700 (PDT) Received: from ayaki.localdomain ([124.150.37.180]) by mx.google.com with ESMTPS id in5sm888691pbc.36.2012.06.12.00.40.36 (version=SSLv3 cipher=OTHER); Tue, 12 Jun 2012 00:40:39 -0700 (PDT) Message-ID: <4FD6F271.5030905@ringerc.id.au> Date: Tue, 12 Jun 2012 15:40:33 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Benson Jin CC: pgsql-general@postgresql.org Subject: Re: Segmentation Fault References: <299885816.271173.1339442120437.JavaMail.root@troo.com> In-Reply-To: <299885816.271173.1339442120437.JavaMail.root@troo.com> Content-Type: multipart/alternative; boundary="------------030504040309010400010603" X-Gm-Message-State: ALoCoQk4fII3L1ISp+4dK+MotMGzPMbb02VSGLjKdF+66KDWHUBNyTm7pZj/xCzj2SV0ztFa4fX+ X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/235 X-Sequence-Number: 188015 This is a multi-part message in MIME format. --------------030504040309010400010603 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030504040309010400010603 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
--------------030504040309010400010603--