NetBSD Problem Report #274

From gnats  Fri Jun  3 12:38:15 1994
Received: from gandalf.bbb.no (root@gandalf.bbb.no [192.124.156.194]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id MAA21108 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Fri, 3 Jun 1994 12:37:55 -0700
Message-Id: <199406031937.VAA16572@gandalf.bbb.no>
Date: Fri, 3 Jun 1994 21:37:49 +0200
From: Thorsten Lockert <tholo@SigmaSoft.COM>
Reply-To: tholo@SigmaSoft.COM
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: shmat() will always fail
X-Send-Pr-Version: 3.2

>Number:         274
>Category:       kern
>Synopsis:       shmat(2) will always fail due to initialization
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 03 12:50:02 +0000 1994
>Closed-Date:    Fri Jun 03 20:53:44 +0000 1994
>Last-Modified:  
>Originator:     Thorsten Lockert
>Release:        
>Organization:
SigmaSoft, Th. Lockert
>Environment:

System: NetBSD gandalf.bbb.no 0.9B GANDALF#2 i386


>Description:
	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.
>How-To-Repeat:
	Try to attach a shared memory segment.  It will always fail.
>Fix:
	Loop through the shared memory segments in the allocated array,
	setting the shmid's to zero after allocating the area.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: cgd 
State-Changed-When: Fri Jun 3 13:53:44 PDT 1994 
State-Changed-Why:  
fixed it. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.