cvs commit: src/sys/net if_ethersubr.c

Robert Watson rwatson at
Sat Aug 30 07:41:36 PDT 2003

On Sat, 30 Aug 2003, Mike Silbersack wrote:

> On Fri, 29 Aug 2003, Robert Watson wrote:
> >   Introduce error checking for calls to M_PREPEND():
> >
> >     ether_output() when prepending netatalk AFA_PHASE2 llc headers (TRYWAIT).
> >     ether_output() when prepending ethernet header to a frame (DONTWAIT).
> I may have mentioned this before, but it would really useful to have
> code which we could easily paste where needed that would do a "fail once
> per caller". 
> This would be much more useful than random failures in detecting callers
> that don't check return values because it would ensure that each case
> was hit, whereas random failures only offer a statistical chance that it
> will happen after a sufficiently long period of time. 
> I'm envisioning something which keeps a linked list of caller
> addresses...  horribly inefficient, but useable enough to be hidden
> being a FAILURE_STRESS_TEST option. 

I think that sounds very useful; the current patches are coming out of a
grep of the source tree for instances of M_PREPEND(), which seems to have
been a victim of copy-and-paste previousy.  I have several more such fixes
locally, especially in the NFS code, but my crash boxes have been down
since the recent thunderstorm which (a) knocked out the power, and (b)
revealed a leak in the roof of the lab I'm using at work.  I'll commit
those fixes once I've had a chance to exercise them some. 

Happily (?), almost all of our memory allocation is done using wrapper
macros, which means we could fairly easily implement what you have in
mind.  The other thing we should encourage developers to do more is use
code coverage tools -- phk recently pointed me at kernbb(8) as a way to
feed gcov(1).

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at      Network Associates Laboratories

More information about the cvs-src mailing list