From owner-freebsd-bugs Wed Jul 19 11:27:12 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id LAA05319 for bugs-outgoing; Wed, 19 Jul 1995 11:27:12 -0700 Received: from chez.CS.Berkeley.EDU (chez.CS.Berkeley.EDU [128.32.211.112]) by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id LAA05310 for ; Wed, 19 Jul 1995 11:27:11 -0700 Received: from chez.CS.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by chez.CS.Berkeley.EDU (8.7.Beta.2/8.6.9) with ESMTP id LAA14283; Wed, 19 Jul 1995 11:24:55 -0700 (PDT) Message-Id: <199507191824.LAA14283@chez.CS.Berkeley.EDU> To: Matt Dillon Subject: Re: possible ffs_vget() race condition cc: davidg@root.com, bugs@freebsd.org In-reply-to: Your message of "Wed, 19 Jul 1995 11:09:16 PDT." <199507191809.LAA07002@blob.best.net> Date: Wed, 19 Jul 1995 11:24:51 -0700 From: Kirk McKusick Sender: bugs-owner@freebsd.org Precedence: bulk Date: Wed, 19 Jul 1995 11:09:16 -0700 From: Matt Dillon To: Kirk McKusick Cc: davidg@root.com, bugs@freebsd.org Subject: Re: possible ffs_vget() race condition I've got some kernel printf()'s in the two critical code areas along with my fix so by this time tomorrow I should know whether the hole is getting hit. Oh, there are also some pretty serious problems with the sysctl() stuff... mainly with all the list traversals the sysctl()'s do without locking and the copyout's inside the loops (which can block, causing the list being traverse and most specifically the 'current' item to be ripped out from under sysctl())... I had to stop using pstat -T because of the problem (it would crash the machine every couple of hours). Since I absolutely need ps, I wound up patched the proc stuff sysctl's adding a lock count to the process structure which the exit/zombie code blocks on, but haven't posted the patches because the whole sysctl thing really needs a good going over to solve the problems. -Matt I do not believe that sysctl is the source of your problem. For all data structures except the vnode table, it does a vslock on the copyout buffer before starting the list traversal. Thus the copyout cannot block. More likely your problems are arising because the information that pstat is trying to report is coming from /dev/kmem rather than through sysctl. Switching it to be accessible from sysctl should solve your problem. ~Kirk