Re: postmaster dies (was Re: Very disappointing performance) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postmaster dies (was Re: Very disappointing performance)
Date
Msg-id 28136.921465337@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
secret <secret@kearneydev.com> writes:
>>>> PostgreSQL is also crashing 1-2 times a day on me, although I have a
>>>> handy perl script to keep it alive now <grin>...

> basically the server randomly dies with a:
> ERROR:  postmaster: StreamConnection: accept: Invalid argument
> pmdie 3
> (then signals all children to drop dead)

Hmm.  That shouldn't happen, especially not randomly; if the accept
works the first time then it should work forever after, since the
arguments being passed in never change.

The error is coming from StreamConnection() in
pgsql/src/backend/libpq/pqcomm.c.  Could you maybe add some debugging
code to the routine to see what the server_fd and port arguments are
when accept() fails?  I think just changing the first elog() to

elog(ERROR,    "postmaster: StreamConnection: accept: %m\nserver_fd = %d, port = %p",    server_fd, port);

would do for starters.  This would let us eliminate the possibility that
the routine is getting passed bad arguments.

An alternative possibility is to run the postmaster under truss so you
can see what arguments are passed to the kernel on every kernel call,
but that'd generate a pretty verbose logfile.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] INT64_FORMAT missing
Next
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Autoconf versions