Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2003 11:27:59 -0800 (PST)
From:      Don Lewis <truckman@FreeBSD.org>
To:        l.ertl@univie.ac.at
Cc:        current@FreeBSD.org
Subject:   Re: named pipes memory leak?
Message-ID:  <200311111928.hABJRxeF070057@gw.catspoiler.org>
In-Reply-To: <20031111192944.K678@korben.in.tern>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 Nov, Lukas Ertl wrote:
> On Tue, 11 Nov 2003, Lukas Ertl wrote:
> 
>> Unfortunately, we are still seeing a problem here: we are running uvscan
>> (virus scanner), and while running it we are still seeing increasing unpcb
>> usage and orphaned unix domain sockets.
>>
>> We added some debug printfs to the fifo routines and found out that
>> fifo_cleanup is called from fifo_close with a vnode which has v_usecount
>> == 2 so the socket close calls aren't reached.
> 
> Sorry, I probably missed an important part: we're creating the FIFOs on
> nullfs mounts - the test script works great on plain UFS mounts, but the
> null layer seems to VREF the vnode once again, so v_usecount is 2, thus it
> is missong the check in fifo_cleanup().

Grrr ...  At least I didn't break this, our fifo implementation would
have always leaked when used this way.

Doing the cleanup in fifo_inactive() would have worked better in this
case.  I think I figured out a way to make that work properly, but I
really need to test it.

Is there any particular reason that you are nuking and re-creating the
fifo?  If you don't delete the fifo, the same sockets will get used each
time.

As a workaround could you create a little mdfs to hold the fifo?



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