From owner-freebsd-ia64@FreeBSD.ORG Thu Mar 18 15:57:11 2010 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E17661065670 for ; Thu, 18 Mar 2010 15:57:11 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-qy0-f178.google.com (mail-qy0-f178.google.com [209.85.221.178]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6468FC23 for ; Thu, 18 Mar 2010 15:57:11 +0000 (UTC) Received: by qyk8 with SMTP id 8so1058171qyk.4 for ; Thu, 18 Mar 2010 08:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=47uwmfe1W0MJ9cSmYiJUWLEny533PQzu441N6JORPEI=; b=w6TUl43t4KGfUjqsFRT/H0dZavYUAeypTuNe0MEN5kmOs/d9g+qryc2zAyAE6aK/2f g9lQtYNTbX8qzkU2VFMkUKr3vs649vvHCu4H56d488EQPZ8fRdF+C3yqhROQ3JzK7e/u Xm4c/1vjQXPl21yZ67qjDAwzL12fE1vFK0UBg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=sNFmVlr4j0AFjtTyEhF2fYRGtG8fFrjtXxHLXkV4HzfbT21efZ3jiBUXx21UBuefaX Fdu7EkH4jy2sKLE8BhRy70pnB1IIHgR1qV6ll7xeYt7rNwNWtD4sZ5ALVY+il/Ef26mm boYvIsQt4F3SusztGLtLIjx5e0zOHLiE4z/Yk= Received: by 10.229.230.208 with SMTP id jn16mr2406267qcb.106.1268926980127; Thu, 18 Mar 2010 08:43:00 -0700 (PDT) Received: from centel.dataix.local (ppp-22.172.dialinfree.com [209.172.22.172]) by mx.google.com with ESMTPS id 35sm25146yxh.33.2010.03.18.08.42.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Mar 2010 08:42:58 -0700 (PDT) Sender: "J. Hellenthal" Date: Thu, 18 Mar 2010 11:29:36 -0400 From: jhell To: Anton Shterenlikht In-Reply-To: <20100317163230.GJ87732@mech-cluster241.men.bris.ac.uk> Message-ID: References: <20100317163230.GJ87732@mech-cluster241.men.bris.ac.uk> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD Current , freebsd-ia64@freebsd.org Subject: Re: ldd leaves the machine unresponsive X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2010 15:57:12 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 17 Mar 2010 12:32, Anton Shterenlikht wrote: In Message-Id: <20100317163230.GJ87732@mech-cluster241.men.bris.ac.uk> > Just updated to ia64 r205248 > > If my problem is due to my mis-configuration, > I apologise in advance. > > I run this shell script after each upgrade > and 'make delete-old-libs' to check > if any shared objects need to be rebuilt: > > > > #!/bin/sh > > for file in `find /bin /sbin /usr/bin /usr/sbin /usr/lib /usr/libexec /usr/local -name "*"` > do > echo $file > ldd $file >> /root/ldd_results 2> /dev/zero > done > > > This will probably do closer to what you actually would want to look for. Writing to /dev/zero ... I don't know never tried it since /dev/null is usually the standard place to throw trash. #!/bin/sh for file in `find /*bin /usr/*bin /usr/lib* /usr/local/*bin -type f` do echo $file ldd $file >>/root/ldd_results 2>/dev/null done The problem with your script is that it finds most files that it can not or is not useful to run ldd on and leaves you junk in return. It might be more useful if you searched for dynamically linked ELF binaries to run ldd against like the following. === Script starts here === #!/bin/sh SEARCHPATH="/*bin /usr/*bin /usr/lib* /usr/local/*bin" trap 'exit 1' 2 check_libs() { for spath in $SEARCHPATH; do for ifelf in `find $spath -type f`; do ldd `file $ifelf | grep dynamically | cut -f1 -d:` done done } check_libs 2>/dev/null === Script ends here === The above will find all type ELF * that are dynamically linked within the SEARCHPATH variable and run ldd on them and print the results to stdout. Obviously since you are going to have thousands of files being questioned, stdout is not going to be useful. So with the about stated: save the script to: checklibs.sh run with: "sh checklibs.sh >/root/checklibs_output" or: "script /root/checklibs_output checklibs.sh" > After the upgrade to r205248, the script > freezes at seemingly random points. > Unneeded disk usage & execution. > I can still ssh to the machine (using keys), i.e. > I see the welcome message, but cannot get to the console prompt. Of course... to many open files or processes in wait. SSH already has the information it needs loaded into memory, that's why you can get sort-of-in ZFS file-system perhaps ? > > On the serial console I cannot get the prompt > after entering the root password. > See above. > I have top(1) running interactively in another window. > The sh process is in "getblk" state, and ignores kill -9. > But there's no ldd process. > > And shutdown requests are also ignored: > > # shutdown -r now > Shutdown NOW! > shutdown: [pid 8019] > # > and nothing happens after that > > So I have to do a cold reset via MP. > > On ia64 r204322, this script causes no problems. > > Please advise > The above edited script should help to limit disk usage and too many open processes that causes your machine to bog down like that. This script does have its limitations and there is one bug in it... Ill let you figure out how to get rid of that bug but it really does not effect the intended output so I left it alone and sent error output to fd/2. The limitations you'll find is how many files that ldd(1) or file(1) can handle at one time. But if you specify specific paths like already in SEARCHPATH then you will most likely never see this unless the files in /*bin grow to be over max number of files that file(1) or ldd(1) can handle at one time. Shortly said... use direct paths or short globs like above. > many thanks > anton > A final note you might want to just install sysutils/libchk and run that. Standard Disclaimer: NONE OF THIS CONTAINED HEREIN "THIS MESSAGE" EXCUSES ANY OF THE UNEXPLAINED DISK LOCKING THAT IS GOING ON AND THE INFORMATION FOR WHICH IT MAY CONTAIN BECOMING UNAVAILABLE AT ANY POINT IN TIME DURING THE ORIGINAL RUN OF THE FIRST SCRIPT OR THE SECOND SCRIPT THAT WAS POSTED EITHER AS A ATTACHMENT OR IN-LINE. ;) JK! Good Luck. - -- jhell -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJLokboAAoJEJBXh4mJ2FR+njQH/12zvjvwkBCEuWCzSg0O6mXA kFR9XeF7TeFyAgBWTNWblmU6e1QRURI5V6qvR3oG+58jngbvSmAyZRbw3tz+mf2U TJGhhnFYMph8PLDVmtVfYGf2V3UQXxcmDNtnJLsQT3i2RyRurIDFmtNf5GvBOw3b 6jpTF1xpZfJIfQMSxgQ0NhGFPQcYZCNRZy5Yh+5q7JeKSBx73btgnFSJ9IGSQfZj xFCxELWDQOc20/M2pIRQ5z9+OyeSP0J7XrX6g0TlofJ5IxcCqNiQ8pruvKUm8/S7 AkYIgh8kqOSGhxOkXN4RqyHN537u6QLATJwMed2jgy8TBj/L+51Y+Ni1ceWdVaU= =+oRv -----END PGP SIGNATURE-----