Bug 16122

Summary: Incorrect SysV SHM segment accounting by async I/O helper procs
Product: Base System Reporter: Havard Eidnes <he>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Havard Eidnes 2000-01-14 12:10:00 UTC
	Only the first async I/O helper process releases the SystemV
	shared memory segments inherited from the parent process.  All
	async I/O helper processes end up calling shmfork() (implicitly
	via rfork()), but exit without doing shmexit(), causing shared
	memory segment reference counts not to be updated correctly.

	This causes shared memory segments to get an ever increasing
	reference count, preventing their removal from the system even
	though the processes which caused the reference count to be
	increased are no longer present.

Fix: Not only the first async I/O helper process should get rid of its
	SystemV shared memory segments inherited from the parent process.

	Perusal of cvsweb seems to indicate that this problem
	is also present in the FreeBSD 3.4 release.
How-To-Repeat: 	Use SystemV shared memory segments and asynchronous I/O
	in the same process.  Note in "ipcs -mobp" output that
	the reference count of the segments increase over time
	as this process is run several times.

	(Sorry, no code here to reproduce the problem.)
Comment 1 Mike Barcroft freebsd_committer freebsd_triage 2001-07-21 19:37:23 UTC
State Changed
From-To: open->feedback


Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE?
Comment 2 Mike Barcroft freebsd_committer freebsd_triage 2001-07-24 01:33:47 UTC
Adding to Audit-Trail.

----- Forwarded message from Havard Eidnes <he@uninett.no> -----

X-UIDL: 3d2173d338c5c22dd6bbd858ea583252
Delivered-To: mike@freebsd.org
Date: Mon, 23 Jul 2001 22:46:00 +0200 (CEST)
To: mike@FreeBSD.org
Cc: freebsd-bugs@FreeBSD.org
Subject: Re: kern/16122: Incorrect SysV SHM segment accounting by async I/O
 helper procs
From: Havard Eidnes <he@uninett.no>
In-Reply-To: <200107211837.f6LIbZV27241@freefall.freebsd.org>
X-Mailer: Mew version 1.95b124 on Emacs 20.7 / Mule 4.0 (HANANOEN)
X-MIME-Autoconverted: from quoted-printable to 8bit by coffee.q9media.com id f6NL76n72735

> Does this problem still occur in newer versions of FreeBSD,
> such as 4.3-RELEASE?

I'm sorry, but I'm no longer in a position where I'm able to test that
in any reasonably easy way (I beleive 4.0 was just about coming out
when I reported the problem, and the code related to this problem was
changed significantly in the then-new version).

Sorry to not be able to be more helpful.

- HÃ¥vard

----- End forwarded message -----
Comment 3 Mike Barcroft freebsd_committer freebsd_triage 2001-07-24 01:35:39 UTC
State Changed
From-To: feedback->closed


The originator is no longer able to test this problem in a newer 
version of FreeBSD.  As the originator points out, there have been 
a lot of changes to the relevant code, so I believe it's likely 
this problem has been solved.  If it hasn't been solved in a newer 
version of FreeBSD, a new PR should be opened.