Subject: kern/274: shmat() will always fail
To: None <gnats-admin>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 06/03/1994 12:50:03
>Number:         274
>Category:       kern
>Synopsis:       shmat(2) will always fail due to initialization
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun  3 12:50:02 1994
>Originator:     Thorsten Lockert
SigmaSoft, Th. Lockert
System: NetBSD 0.9B GANDALF#2 i386

	p->p_vmspace->vm_shm will have an area of memory allocated to it if
	none exists.  It will also be bzero'ed.  shmat() then proceeds to
	check the shmid's for -1 value to find an unused slot.  This will
	(obviously) fail since the shmid's stored in the allocated area are
	all zero.
	Try to attach a shared memory segment.  It will always fail.
	Loop through the shared memory segments in the allocated array,
	setting the shmid's to zero after allocating the area.