IpcSemaphoreKill: ...) failed: Invalid argument

IpcSemaphoreKill: ...) failed: Invalid argument

Post by Christoph Hall » Tue, 18 Feb 2003 23:45:25



Hi,

I've seen this (see below) in the postmaster's log-file.
I doubt this is normal behaviour.
I'm using PostgreSQL 7.2.3 on hppa-hp-hpux10.20, compiled by GCC 2.95.2
Does anybody know what may cause  calls to semctl resp. shmctl
(semaphore control resp. shared memory control) to fail?
The application program ( C code using the libpq - C Library )
crashed because of a segmentation violation.
I've searched the archive for
ZeroProcSemaphore
IpcSemaphoreKill
IpcMemoryDelete
with no results.
Any hints welcome. Thanks in advance.

Regards, Christoph

DEBUG:  database system is ready
NOTICE:  COMMIT: no transaction in progress
<cut>
NOTICE:  COMMIT: no transaction in progress
DEBUG:  pq_recvbuf: unexpected EOF on client connection
DEBUG:  pq_recvbuf: unexpected EOF on client connection
ZeroProcSemaphore: semctl(id=2450,SETVAL) failed: Invalid argument
DEBUG:  server process (pid 10237) exited with exit code 255
DEBUG:  terminating any other active server processes
DEBUG:  all server processes terminated; reinitializing shared memory
and semaphores
IpcSemaphoreKill: semctl(707088, 0, IPC_RMID, ...) failed: Invalid
argument
IpcSemaphoreKill: semctl(2449, 0, IPC_RMID, ...) failed: Invalid
argument
IpcSemaphoreKill: semctl(2450, 0, IPC_RMID, ...) failed: Invalid
argument
IpcMemoryDelete: shmctl(312410, 0, 0) failed: Invalid argument
DEBUG:  database system was interrupted at 2003-02-17 11:22:36 MET
DEBUG:  checkpoint record is at 0/47EA788
DEBUG:  redo record is at 0/47EA788; undo record is at 0/0; shutdown
TRUE
DEBUG:  next transaction id: 16242; next oid: 368814
DEBUG:  database system was not properly shut down; automatic recovery
in progress
DEBUG:  redo starts at 0/47EA7C8
DEBUG:  ReadRecord: record with zero length at 0/48864B8
DEBUG:  redo done at 0/4886490
DEBUG:  database system is ready

---------------------------(end of broadcast)---------------------------

 
 
 

IpcSemaphoreKill: ...) failed: Invalid argument

Post by Tom La » Wed, 19 Feb 2003 00:22:06



> I've seen this (see below) in the postmaster's log-file.
> I doubt this is normal behaviour.
> I'm using PostgreSQL 7.2.3 on hppa-hp-hpux10.20, compiled by GCC 2.95.2
> Does anybody know what may cause  calls to semctl resp. shmctl
> (semaphore control resp. shared memory control) to fail?

FWIW, I do all my Postgres development on HPUX 10.20 with gcc, and I've
never seen anything like this.

Quote:> ZeroProcSemaphore: semctl(id=2450,SETVAL) failed: Invalid argument
> DEBUG:  server process (pid 10237) exited with exit code 255
> DEBUG:  terminating any other active server processes
> DEBUG:  all server processes terminated; reinitializing shared memory
> and semaphores
> IpcSemaphoreKill: semctl(707088, 0, IPC_RMID, ...) failed: Invalid
> argument
> IpcSemaphoreKill: semctl(2449, 0, IPC_RMID, ...) failed: Invalid
> argument
> IpcSemaphoreKill: semctl(2450, 0, IPC_RMID, ...) failed: Invalid
> argument
> IpcMemoryDelete: shmctl(312410, 0, 0) failed: Invalid argument

This is a fairly spectacular failure :-(.  As far as I can see from the
semctl and shmctl man pages, the only plausible reason for EINVAL is
that something had deleted the semaphores and shared memory out from
under Postgres.  I do not believe that Postgres itself could have done
that --- it had to be some external agency.  Unless the kernel is
broken, whatever requested those deletions had to be running as root or
as postgres in order to have the necessary permissions.  You sure you
didn't have some loose-cannon script running around issuing ipcrm
commands?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command


 
 
 

IpcSemaphoreKill: ...) failed: Invalid argument

Post by Christoph Hall » Wed, 19 Feb 2003 00:36:58


Quote:

> This is a fairly spectacular failure :-(.  As far as I can see from
the
> semctl and shmctl man pages, the only plausible reason for EINVAL is
> that something had deleted the semaphores and shared memory out from
> under Postgres.  I do not believe that Postgres itself could have done
> that --- it had to be some external agency.  Unless the kernel is
> broken, whatever requested those deletions had to be running as root
or
> as postgres in order to have the necessary permissions.  You sure you
> didn't have some loose-cannon script running around issuing ipcrm
> commands?

No, I'm not sure at all about a loose-cannon script running around
issuing ipcrm commands.
I have to ask the other staff members what scripts are running.
I already had a suspicion that something like an ipcrm command is
causing this,
but it was denied. Now, with your support they probably will believe me.

Thanks for the quick reply.

Regards, Christoph

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate

message can get through to the mailing list cleanly

 
 
 

IpcSemaphoreKill: ...) failed: Invalid argument

Post by Kevin Bro » Wed, 19 Feb 2003 04:20:20



> No, I'm not sure at all about a loose-cannon script running around
> issuing ipcrm commands.
> I have to ask the other staff members what scripts are running.
> I already had a suspicion that something like an ipcrm command is
> causing this,
> but it was denied. Now, with your support they probably will believe me.

If you want to track it down and the people on your staff don't
already know what's going on, you can move the ipcrm binary out of the
way (to, say, ipcrm.bin) and replace it with a shell script that looks
something like this:

    #!/bin/sh

    (echo "ipcrm called with the following arguments:"
    echo

    echo
    echo "Current programs running:"
    echo
    ps -elf) >/tmp/ipcrm.out.$$


Then just look for /tmp/ipcrm.out.* files and examine their contents.
(I think I got the arguments to ps right.  It's been so long since
I've had to mess with a SysVr4 style system that I'm not sure
anymore.  If it's a BSD-style ps then the arguments should be -auxww).

--

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

http://www.postgresql.org/users-lounge/docs/faq.html

 
 
 

IpcSemaphoreKill: ...) failed: Invalid argument

Post by Christopher Kings-Lynn » Wed, 19 Feb 2003 10:34:04


Quote:> This is a fairly spectacular failure :-(.  As far as I can see from the
> semctl and shmctl man pages, the only plausible reason for EINVAL is
> that something had deleted the semaphores and shared memory out from
> under Postgres.  I do not believe that Postgres itself could have done
> that --- it had to be some external agency.  Unless the kernel is
> broken, whatever requested those deletions had to be running as root or
> as postgres in order to have the necessary permissions.  You sure you
> didn't have some loose-cannon script running around issuing ipcrm
> commands?

Or ipcclean?

Chris

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

 
 
 

1. IpcMemoryCreate: shmget failed (Invalid argument)

I get this error when trying to start postgres with a block size > the
default of 64...


/usr/local/pgsql/data
IpcMemoryCreate: shmget failed (Invalid argument) key=5432001,
size=33652736, permission=600
This type of error is usually caused by an improper
shared memory or System V IPC semaphore configuration.
For more information, see the FAQ and platform-specific
FAQ's in the source directory pgsql/doc or on our
web site at http://www.postgresql.org.
FATAL 1:  ShmemCreate: cannot create region

I am running PG 7.03, and I assume that you'll want to need to know my
OS...


Linux roam 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown

(RedHat 6.2)

Thanks.

- JT
________________________________________
James Thornton, http://jamesthornton.com

2. What is sqlserver doing with my internet connection?

3. PostgreSQL 7.4devel - LOG: PGSTAT: socket() failed: Invalid argument

4. SP causing machine to "hang"

5. IpcMemoryCreate: shmget failed (Invalid argument)

6. Start Delphi exe

7. invalid argument value

8. mvBASE wkst. service stops

9. Invalid Procedure Call or Argument

10. Invalid procedure call or argument MS Access on Win95

11. Newbie needs help with invalid argument

12. Error 3001: Invalid argument

13. Invalid Argument with recordset