Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 May 2001 14:12:43 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        hackers@FreeBSD.org, "Brian F. Feldman" <green@FreeBSD.org>
Subject:   Re: RE: vmspace leak (+ tentative fix)
Message-ID:  <200105222112.f4MLCh610392@earth.backplane.com>
References:   <XFMail.010522044839.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

:
:
:On 22-May-01 Matt Dillon wrote:
:>:Ok, then why not let the current shmexit() stay in exit1() as a hack to help
:>:free memory, but add in a check in vmspace_free() as well to catch any race
:>:conditions that may fall through the cracks?  As long as we clear the shm
:>:pointer in struct vmspace when we free it then we won't be double free'ing,
:>:and
:>:will always free it eventually.  That is also a much simpler change. :) 
:>:Additionally, adding to the comment in exit1() clarifying that this is an
:>:attempt to free resources as soon as possible and that the race condition is
:>:known and that vmspace_free() is a catch-all might be nice as well.
:>:
:>:-- 
:>:
:>:John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
:>:PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
:> 
:>    It's not really good programming practice.  Someone might trip over
:>    it later on.
:
:Then the vmspace free()ing is also bad programming practice?  It's the same
:exact algorithm used for the vmspace.
:
:>                                       -Matt
:
:John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/

    Huh?  It doesn't look like the same algorithm to me.

						-Matt

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105222112.f4MLCh610392>