Subject: kern/448: shm problem
To: None <gnats-admin>
From: Douglas Thomas Crosher <dtc@scrooge.ee.swin.oz.au>
List: netbsd-bugs
Date: 08/31/1994 00:20:08
>Number:         448
>Category:       kern
>Synopsis:       Share memory problem, shmctl(shmid,IPC_RMID,0) does not decrease shm_nused
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 31 00:20:05 1994
>Originator:     Douglas Thomas Crosher
>Organization:
"	Swinburne University of technology"
>Release:        
>Environment:

	NetBSD1.0Beta 20 Aug 1994

>Description:

 	shmctl(shmid,IP_RMID,0) does not decrease the number of shared
memory identifiers in use.  The value of shm_nused just keeps
increasing until it reaches the default kernal limit of 32.

>How-To-Repeat:
Run a program that used shared memory (CLSIP) more then 32 times, or
use the following program:

-=-=-=-=-
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>

main ()
{ 
  int shmid, i;
  
  for ( i=0; i<35; i++ ) 
    {
      if ((shmid = shmget(IPC_PRIVATE,0x10000,0400)) < 0)
	{
	  perror("shmget");
	  exit(1);
	}
      
      shmctl(shmid,IPC_RMID,0);
    }
}
-=-=-=-=-

>Fix:

>Audit-Trail:
>Unformatted:



------------------------------------------------------------------------------