Re: server auto-restarts and ipcs

From: "Ed L(dot)" <pgsql(at)bluepolka(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: server auto-restarts and ipcs
Date: 2004-11-09 02:24:31
Message-ID: 200411081924.31101.pgsql@bluepolka.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Monday November 8 2004 6:16, Tom Lane wrote:
> "Ed L." <pgsql(at)bluepolka(dot)net> writes:
> > A power failure led to failed postmaster restart using 7.4.6 (see
> > output below). The short-term fix is usually to delete the pid file
> > and restart.
> >
> > I often wonder why ipcs never seems to show the shared memory
> > block in question?
>
> The shared memory block would certainly not still exist after a system
> reboot, so what we have here is a misleading error message. Looking at
> the code, the most plausible explanation appears to be that
> shmctl(IPC_STAT) is failing (which it ought to) and returning some errno
> code different from EINVAL (which is the case we are expecting to see).
> What platform are you on, and what does its shmctl(2) man page document
> as error conditions?

Platform is Linux 2.4.20-30.9 on i686 (Pentium 4, I think).

From man 2 schctl:

ERRORS
On error, errno will be set to one of the following:

EACCES is returned if IPC_STAT is requested and
shm_perm.modes does not allow read access for shmid.

EFAULT The argument cmd has value IPC_SET or IPC_STAT but
the address pointed to by buf isn’t accessible.

EINVAL is returned if shmid is not a valid identifier, or cmd
is not a valid command.

EIDRM is returned if shmid points to a removed identifier.

EPERM is returned if IPC_SET or IPC_RMID is attempted, and
the effective user ID of the calling process is not the creator (as found
in shm_perm.cuid), the owner (as found in shm_perm.uid), or the
super-user.

EOVERFLOW is returned if IPC_STAT is attempted, and the gid or
uid value is too large to be stored in the structure pointed to by buf.

CONFORMING TO
SVr4, SVID. SVr4 documents additional error conditions EINVAL,
ENOENT, ENOSPC, ENOMEM, EEXIST. Neither SVr4 nor SVID documents an EIDRM
error condition.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2004-11-09 02:28:57 Re: server auto-restarts and ipcs
Previous Message Bruno Wolff III 2004-11-09 02:18:15 Re: Can this be indexed?

Browse pgsql-hackers by date

  From Date Subject
Next Message Ed L. 2004-11-09 02:28:57 Re: server auto-restarts and ipcs
Previous Message Gavin Sherry 2004-11-09 02:18:21 Re: unnest