From owner-freebsd-bugs Thu Aug 8 2:50:16 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA31237B405 for ; Thu, 8 Aug 2002 02:50:08 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9973343E77 for ; Thu, 8 Aug 2002 02:50:08 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g789o8JU084139 for ; Thu, 8 Aug 2002 02:50:08 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g789o84E084138; Thu, 8 Aug 2002 02:50:08 -0700 (PDT) Date: Thu, 8 Aug 2002 02:50:08 -0700 (PDT) Message-Id: <200208080950.g789o84E084138@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: David Malone Subject: Re: misc/41213: top(1) blocks if NIS-related entries in passwd(5) are in a certain order Reply-To: David Malone Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/41213; it has been noted by GNATS. From: David Malone To: Stefan Schwarzer Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: misc/41213: top(1) blocks if NIS-related entries in passwd(5) are in a certain order Date: Thu, 8 Aug 2002 10:46:47 +0100 On Wed, Jul 31, 2002 at 02:52:29PM -0700, Stefan Schwarzer wrote: > I know only a workaround, see the URLs. I do not know, though, whether this workaround is feasible in any case. This might be a bug in the code for iterating through all users in libc. I think that top tries to do this to find the longest username it will have to deal with. Could you try the included simple C program and see if you can reproduce the problem? It should keep looping on the problem user. If you want to check it is this code that is looping, the last thing before top gets stuck in a loop should be the calling of sysctlbyname on either "machdep.smp_active" or "smp.smp_active". You may be able to find this in your ktrace output. David. #include #include #include int main(void) { struct passwd *pw; while ((pw = getpwent()) != NULL) { printf("Got user '%s',\n", pw->pw_name); } return 0; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message