By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,512 Members | 3,790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,512 IT Pros & Developers. It's quick & easy.

psql leaking?

P: n/a
Hello,

Today I tried connecting to my database locally via psql. I got the usual
welcome & basic help messages, but it never got to the prompt: it just
hung. So I checked top and the psql process was increasing in size at
quite a rate (up to a gig in under 30 seconds).

I'd been using psql with no problems only a couple of hours ago, and I
haven't installed anything for at least a couple of days that I can think
of.

The first thing I did was to pg_dumpall a backup and try recompiling the
server. That didn't work, so I tried doing initdb again. No joy. So I
upgraded to 7.4.5 (was 7.4.3 before), and again no joy. Note that it
happens just after I've run initdb, so even when my database has gone
nowhere near it: this is effectively a clean compile and install that is
failing at this point.

I've turned logging up full and got this (starting from when I run the
psql command):

2004-09-04 16:43:29 DEBUG: forked new backend, pid=23315 socket=8
2004-09-04 16:43:29 DEBUG: /usr/bin/postmaster child[23315]: starting
with (
2004-09-04 16:43:29 DEBUG: postgres
2004-09-04 16:43:29 DEBUG: -v196608
2004-09-04 16:43:29 DEBUG: -p
2004-09-04 16:43:29 DEBUG: template1
2004-09-04 16:43:29 DEBUG: )
2004-09-04 16:43:29 DEBUG: InitPostgres
2004-09-04 16:44:53 LOG: unexpected EOF on client connection
2004-09-04 16:44:53 DEBUG: proc_exit(0)
2004-09-04 16:44:53 DEBUG: shmem_exit(0)
2004-09-04 16:44:53 DEBUG: exit(0)
2004-09-04 16:44:53 DEBUG: reaping dead processes
2004-09-04 16:44:53 DEBUG: child process (PID 23315) exited with exit
code 0

The LOG is the point at which I CTRL+C the client.

I'm suspecting that there's a problem with one of the libraries that psql
uses: I really can't see this being a psql bug as I'd have noticed it
before: there must be something else going on. Trouble is, I don't know
what libraries it uses other than glibc (which I'm currently recompiling
just in case).

I'm at a loss, and can't think of anything else. This has just happened
totally unprompted and without any real clues that I can see.

Anyone else have any ideas?

Thanks.

--

Russell Brown

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
A little more information that I've realised I didn't supply. The server
(well, it's a desktop machine really) is running on Gentoo Linux, 2.6.7
kernel. There are no problems with PHP accessing the database (from the
same machine), and psql doesn't have a problem with either having SQL
files directed at it or running individual commands via the -c option. It
seems to be just when trying to get an interactive prompt. I've tried
recompiling readline but that didn't fix it (my recompile of glic appears
to have not succeeded too). Each of those recompiles was followed by a
recompile of PostgreSQL. I've run ldconfig and also revdep-rebuild, with
no effect.

I'm convinced that there's a library that I've missed that I need to
recompile but I can't for the life of me think of what it is...

On Sat, 04 Sep 2004 17:05:32 +0100, Russ Brown <po******@dot4dot.plus.com>
wrote:
Hello,

Today I tried connecting to my database locally via psql. I got the
usual welcome & basic help messages, but it never got to the prompt: it
just hung. So I checked top and the psql process was increasing in size
at quite a rate (up to a gig in under 30 seconds).

I'd been using psql with no problems only a couple of hours ago, and I
haven't installed anything for at least a couple of days that I can
think of.

The first thing I did was to pg_dumpall a backup and try recompiling the
server. That didn't work, so I tried doing initdb again. No joy. So I
upgraded to 7.4.5 (was 7.4.3 before), and again no joy. Note that it
happens just after I've run initdb, so even when my database has gone
nowhere near it: this is effectively a clean compile and install that is
failing at this point.

I've turned logging up full and got this (starting from when I run the
psql command):

2004-09-04 16:43:29 DEBUG: forked new backend, pid=23315 socket=8
2004-09-04 16:43:29 DEBUG: /usr/bin/postmaster child[23315]: starting
with (
2004-09-04 16:43:29 DEBUG: postgres
2004-09-04 16:43:29 DEBUG: -v196608
2004-09-04 16:43:29 DEBUG: -p
2004-09-04 16:43:29 DEBUG: template1
2004-09-04 16:43:29 DEBUG: )
2004-09-04 16:43:29 DEBUG: InitPostgres
2004-09-04 16:44:53 LOG: unexpected EOF on client connection
2004-09-04 16:44:53 DEBUG: proc_exit(0)
2004-09-04 16:44:53 DEBUG: shmem_exit(0)
2004-09-04 16:44:53 DEBUG: exit(0)
2004-09-04 16:44:53 DEBUG: reaping dead processes
2004-09-04 16:44:53 DEBUG: child process (PID 23315) exited with exit
code 0

The LOG is the point at which I CTRL+C the client.

I'm suspecting that there's a problem with one of the libraries that
psql uses: I really can't see this being a psql bug as I'd have noticed
it before: there must be something else going on. Trouble is, I don't
know what libraries it uses other than glibc (which I'm currently
recompiling just in case).

I'm at a loss, and can't think of anything else. This has just happened
totally unprompted and without any real clues that I can see.

Anyone else have any ideas?

Thanks.


--

Russell Brown

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2

P: n/a
"Russ Brown" <po******@dot4dot.plus.com> writes:
A little more information that I've realised I didn't supply. The server
(well, it's a desktop machine really) is running on Gentoo Linux, 2.6.7
kernel. There are no problems with PHP accessing the database (from the
same machine), and psql doesn't have a problem with either having SQL
files directed at it or running individual commands via the -c option. It
seems to be just when trying to get an interactive prompt. I've tried
recompiling readline but that didn't fix it (my recompile of glic appears
to have not succeeded too). Each of those recompiles was followed by a
recompile of PostgreSQL. I've run ldconfig and also revdep-rebuild, with
no effect.


Gentoo? Have you perhaps updated any library sources recently? If it's
an actual recently-introduced bug then no amount of recompiling is going
to make it go away.

The interactive-only aspect does seem to point the finger at readline,
but I wouldn't swear to that. You might try recompiling --without-readline
just to see.

Another approach is to make a debug build and then use gdb to get an
idea of where it's looping.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.