Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 1996 20:02:47 -0400
From:      "Gary Palmer" <gpalmer@freebsd.org>
To:        Brett Glass <brett@lariat.org>
Cc:        dwhite@resnet.uoregon.edu, questions@freebsd.org
Subject:   Re: systat/netstat utilities buggy? 
Message-ID:  <22921.843436967@orion.webspan.net>
In-Reply-To: Your message of "Sun, 22 Sep 1996 09:38:25 MDT." <199609221538.JAA09370@lariat.lariat.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Brett Glass wrote in message ID
<199609221538.JAA09370@lariat.lariat.org>:
> I would be VERY surprised, though, if a programmer were careless enough to
> traverse a linked list whose links could potentially change without locking
> resources -- or deferring insertions and deletions until after a traversal.
> Doing nameserver lookups in the MIDDLE of the traversal is EXTREMELY poor
> practice, since it maximizes the danger of inconsistencies even if the list
> is traversed safely. Do you have the code to FreeBSD's netstat? (I don't
> have room for the source tree here.) Is it really coded this badly?

Yes, it is coded like this. However, I would not class it as `bad'
practise, since you are READING from a linked list during this
traversal, *NOT* doing modifications. Hence, running off the end of
the list, or into a modified area of the list, should NOT produce
anything more than a failed kvm_read. I've certainly seen this
behavious HUNDREDS of times without any ill effects in the running
kernel.

> > As for `odd system behaviour', more details would be needed.

> We're talking core dumps, occasional crashes (when systat -netstat is
> running), and hung processes. As if kernel memory were being corrupted.

I take it that these don't occur when systat -netstat isn't running?
Strange. What release / revision are you running?

Gary
--
Gary Palmer                                          FreeBSD Core Team Member
FreeBSD: Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info



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