svn commit: r194643 - head/sys/kern

Andre Oppermann andre at freebsd.org
Tue Jun 23 08:58:22 UTC 2009


Kip Macy wrote:
>   As soon as
>> INVARIANTS are enable the KASSERT will catch the offender red handed.
> 
> The INVARIANTS check DTRT. i.e. fail-fast. If you're double-freeing a
> valid mbuf you'll get a random crash elsewhere.

There is the uncertainty whether the m_nextpkt mbuf is really referenced
from somewhere else or just hangs on by accident (bug).  Under INVARIANTS
the response is clear.  Without debug code the question is how to respond
in the most useful way.  The options are:
  1) assume m_nextpkt is a potential memory leak and potentially risk a
     subtle crash if it was referenced.
  2) NULL out m_nextpkt and risk a memory leak.
  3) panic in any case.

m_nextpkt in an m_next chain is a bug in any case and should not happen.
Option 3) seems excessive.  Which of option 1) and 2) do you prefer?

-- 
Andre



More information about the svn-src-head mailing list