From owner-freebsd-questions Sun Sep 22 17:03:11 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA09550 for questions-outgoing; Sun, 22 Sep 1996 17:03:11 -0700 (PDT) Received: from orion.webspan.net (root@orion.webspan.net [206.154.70.41]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA09523 for ; Sun, 22 Sep 1996 17:03:08 -0700 (PDT) Received: from localhost (gpalmer@localhost [127.0.0.1]) by orion.webspan.net (8.7.5/8.6.12) with SMTP id UAA22924; Sun, 22 Sep 1996 20:02:47 -0400 (EDT) X-Authentication-Warning: orion.webspan.net: Host gpalmer@localhost [127.0.0.1] didn't use HELO protocol To: Brett Glass cc: dwhite@resnet.uoregon.edu, questions@freebsd.org From: "Gary Palmer" Subject: Re: systat/netstat utilities buggy? In-reply-to: Your message of "Sun, 22 Sep 1996 09:38:25 MDT." <199609221538.JAA09370@lariat.lariat.org> Date: Sun, 22 Sep 1996 20:02:47 -0400 Message-ID: <22921.843436967@orion.webspan.net> Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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