From owner-freebsd-hackers Wed Dec 6 11:16:44 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id LAA12107 for hackers-outgoing; Wed, 6 Dec 1995 11:16:44 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id LAA12098 for ; Wed, 6 Dec 1995 11:16:41 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id MAA01689; Wed, 6 Dec 1995 12:15:29 -0700 From: Terry Lambert Message-Id: <199512061915.MAA01689@phaeton.artisoft.com> Subject: Re: samaphore remains To: m_tanaka@pa.yokogawa.co.jp (Mihoko Tanaka) Date: Wed, 6 Dec 1995 12:15:29 -0700 (MST) Cc: freebsd-hackers@FreeBSD.org In-Reply-To: <9512061002.AA16768@cabbage.pa.yokogawa.co.jp> from "Mihoko Tanaka" at Dec 6, 95 07:02:51 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org Precedence: bulk > Currently I'm using FreeBSD-R2.1.0-RELEASE on GATEWAY 2000 P5-90. > > I found the trouble that if a program using semaphore died > anbormally, the semaphore which was created remains on kernel. > I think it should be released by kernel's exit() function. > > Although one of the UNIX implementation calls semexit() routine from > exit(), FreeBSD doesn't call semexit() from anywhere. > Is there any reason for this? > > > I tried to fix the exit() as follows and it seems working well. > > ------------- cut here --------------- > *** kern_exit.c Tue May 30 17:05:25 1995 > --- kern_exit.c.new Wed Dec 6 15:12:28 1995 > *************** > *** 130,135 **** > --- 130,139 ---- > */ > fdfree(p); > > + #ifdef SYSVSEM > + semexit(p); > + #endif > + > /* The next two chunks should probably be moved to vmspace_exit. */ > vm = p->p_vmspace; > #ifdef SYSVSHM > ------------- cut here --------------- > > > -- > Mihoko Tanaka > This looks exactly right. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.