generating postgres core files on debian

Поиск
Список
Период
Сортировка
Искать

generating postgres core files on debian

От:
Louis-David Mitterrand <vindex@apartia.org>
Дата:

Hello,

I am trying to debug a problem involving DBD::PgSPI that crashes the
backend. It used to work fine util we installed perl-5.8. How can I get
a core file of a crashed backend on a debian-linux (unstable) machine?

My /etc/security/limits.conf is empty. When I login as root "ulimit -c"
shows a limit of 0. If I set the limit to "unlimited" and logout/login
the limit is back to 0.

Is it sufficient to set the proper limit and then restart postgres in
the same shell to obtain core files in case the backend crashes?

Thanks in advance, cheers,

-- 
ldm@apartia.org 

Re: generating postgres core files on debian

От:
Oliver Elphick <olly@lfix.co.uk>
Дата:
On Thu, 2002-09-19 at 11:18, Louis-David Mitterrand wrote:
> 
> Hello,
> 
> I am trying to debug a problem involving DBD::PgSPI that crashes the
> backend. It used to work fine util we installed perl-5.8. How can I get
> a core file of a crashed backend on a debian-linux (unstable) machine?
> 
> My /etc/security/limits.conf is empty. When I login as root "ulimit -c"
> shows a limit of 0. If I set the limit to "unlimited" and logout/login
> the limit is back to 0.

I think /etc/security/limits.conf is used to limit what you can set with
ulimit rather than dictate the settings.  You probably need to put
"ulimit -c unlimited" in ~postgres/.bash_profile.

> Is it sufficient to set the proper limit and then restart postgres in
> the same shell to obtain core files in case the backend crashes?

Yes.

The core file produced by postmaster from the binary package will not be
very useful to you, because the binary is stripped.  You need to build
the package from source and use the binary from the source tree
(.../src/backend/postmaster/postmaster), not the one copied into the
package tree (.../debian/usr/lib/postgresql/bin/postmaster) since the
stripping is done on the package tree after the binaries are installed
there.

To build the package:
   cd /usr/local/src   apt-get source postgresql             # installs in postgresql-7.2.2   apt-get build-dep postgresql          # build dependencies   apt-get install devscripts fakeroot   # needed for building anything   cd postgresql-7.2.2   debuild

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                            
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C                ========================================    "Bring ye all the tithes into the storehouse, that      there may be meat in mine house, and prove me now      herewith, saith the LORD of hosts, if I will not open      you the windows of heaven, and pour you out a       blessing, that there shall not be room enough to       receive it."           Malachi 3:10 


Re: generating postgres core files on debian

От:
Louis-David Mitterrand <vindex@apartia.org>
Дата:
On Thu, Sep 19, 2002 at 12:17:15PM +0100, Oliver Elphick wrote:
> On Thu, 2002-09-19 at 11:18, Louis-David Mitterrand wrote:
> > 
> > I am trying to debug a problem involving DBD::PgSPI that crashes the
> > backend. It used to work fine util we installed perl-5.8. How can I get
> > a core file of a crashed backend on a debian-linux (unstable) machine?
> > 
> > My /etc/security/limits.conf is empty. When I login as root "ulimit -c"
> > shows a limit of 0. If I set the limit to "unlimited" and logout/login
> > the limit is back to 0.
> 
> I think /etc/security/limits.conf is used to limit what you can set with
> ulimit rather than dictate the settings.  

Aha, that makes sense.

> You probably need to put "ulimit -c unlimited" in
> ~postgres/.bash_profile.

Hmm, I hadn't thought of that 

> > Is it sufficient to set the proper limit and then restart postgres in
> > the same shell to obtain core files in case the backend crashes?
> 
> Yes.
> 
> The core file produced by postmaster from the binary package will not be
> very useful to you, because the binary is stripped.  You need to build
> the package from source and use the binary from the source tree
> (.../src/backend/postmaster/postmaster), not the one copied into the
> package tree (.../debian/usr/lib/postgresql/bin/postmaster) since the
> stripping is done on the package tree after the binaries are installed
> there.

I also suspected that a stripped binary would not help much. Your
indications will save me much time. 

> To build the package:
> 
>     cd /usr/local/src
>     apt-get source postgresql             # installs in postgresql-7.2.2
>     apt-get build-dep postgresql          # build dependencies
>     apt-get install devscripts fakeroot   # needed for building anything
>     cd postgresql-7.2.2
>     debuild

Hey, debuild is nice, didn't know about it until now. Cleaner
"dpkg-buidpackage -us -uc" or "fakeroot debian/rules binary" ;)

Thanks a lot for your help,

-- 
ldm@apartia.org 

FAQ