Re: Problem with uipc_mbuf.c



John-Mark:

Ok, I confirmed it...

Changing it to be

atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1)

Fixes the problem.. no more leaks :-D

R

John-Mark Gurney wrote:
Randall Stewart wrote this message on Mon, Aug 28, 2006 at 17:04 -0400:

atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 0) {

^

This should be 1 not 0.. as apparently fetchadd_int returns the old value
(at least that's what atomic(9) says), which means that if we ever race
on this comparision, we won't free though we should of...

if we look at refcount.h, it does:
return (atomic_fetchadd_int(count, -1) == 1);

which release a reference and apparently returns true if it needs to
be free'd...

Though the wierd part is that andre, "fixed" it to be 0 in 1.157:
Fix a logic error introduced with mandatory mbuf cluster refcounting and
freeing of mbufs+clusters back to the packet zone.


I am thinking about restoring the old code.. since
it appears to work...

Any comments or help would be appreciated..


Lets see what andre has to say about this.



--
Randall Stewart
NSSTG - Cisco Systems Inc.
803-345-0369 <or> 815-342-5222 (cell)
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Outlook Express encountered an error.....
    ... I have tried most of the fixes but to no avail. ... Andre ... >> different user name, outlook works fine. ... >> Like I said, this is a brand new Dell desktop, and we have downloaded ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • nfsroot oops 2.6.7-current
    ... The patch below fixes this problem ... diff -u -r1.19 rpc_pipe.c ... Andre Noll, http://www.mathematik.tu-darmstadt.de/~noll ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)