The manpage for ldd(1) gives a nice example of finding binaries, which link against a given library, see http://www.freebsd.org/cgi/man.cgi?query=ldd&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html The example looks as follows: find . -type f | xargs -n1 file -F | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A %o\n' | grep libc.so.6 Unfortunately this example does not work for me. Is seems that the part with xargs does not output anything and so is the showstopper (?) It would be nice if someone could give me some advice what is wrong here. Thanks in advance, Rainer Hurling
On Mon, Apr 5, 2010 at 11:35 AM, Rainer Hurling <rhurlin@gwdg.de> wrote:> The manpage for ldd(1) gives a nice example of finding binaries, which link > against a given library, see > > http://www.freebsd.org/cgi/man.cgi?query=ldd&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html > > > The example looks as follows: > > find . -type f | xargs -n1 file -F | grep ELF | cut -f1 -d' ' | xargs ldd -f > '%A %o\n' | grep libc.so.6 > > > Unfortunately this example does not work for me. Is seems that the part with > xargs does not output anything and so is the showstopper (?) > > It would be nice if someone could give me some advice what is wrong here.1. The file(1) usage looks incorrect (I get a lot of messages like the following): Usage: file [-bcikLhnNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file... file -C -m magicfiles Try `file --help' for more information. 2. It's no longer libc.so.6 for many versions of FreeBSD; it can potentially be libc.so.7... HTH, -Garrett
Am 05.04.2010 23:05 (UTC+1) schrieb Dominic Fandrey:> On 05/04/2010 22:09, Rainer Hurling wrote: >>> I want to create a list of binaries, which are linked against the old >>> libz.so.5 and must be upgraded ... > > Install sysutils/bsdadminscripts and rung pkg_libchk. :) >Thanks Dominic, I was not aware of this tool for this purpose :-) With textproc/opensp installed the script hangs after some time with the following message: [..snip..] ImageMagick-6.5.8.10_1: /usr/local/lib/libMagickWand.so.2 misses libz.so.5 arith: syntax error: ""0" + 1"-1.5.2_1 This behaviour (the last line) is on at least three machines. Do you have any idea what is going on? Rainer Hurling
On 06/04/2010 08:36, Rainer Hurling wrote:> Am 05.04.2010 23:05 (UTC+1) schrieb Dominic Fandrey: >> On 05/04/2010 22:09, Rainer Hurling wrote: >>>> I want to create a list of binaries, which are linked against the old >>>> libz.so.5 and must be upgraded ... >> >> Install sysutils/bsdadminscripts and rung pkg_libchk. :) >> > > I was not aware of this tool for this purpose :-)I originally wrote it for the update from 6.x to 7.x, so that I could find all packages being linked against the compat-ports and avoid unnecessary builds.> With textproc/opensp installed the script hangs after some time with the > following message:I doubt there is a connection. OpenSP is installed on my system and it works fine.> [..snip..] > ImageMagick-6.5.8.10_1: /usr/local/lib/libMagickWand.so.2 misses libz.so.5 > arith: syntax error: ""0" + 1"-1.5.2_1The arithmetics happen mostly during locking. I suppose the -1.5.2_1 is a remainder of a status message and not connected to the error. Does this always occur in the same place? Maybe run the command with -j1 to gain more predictable output. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
Am 06.04.2010 11:11 (UTC+1) schrieb Dominic Fandrey:> On 06/04/2010 08:36, Rainer Hurling wrote: >> Am 05.04.2010 23:05 (UTC+1) schrieb Dominic Fandrey: >>> On 05/04/2010 22:09, Rainer Hurling wrote: >>>>> I want to create a list of binaries, which are linked against the old >>>>> libz.so.5 and must be upgraded ... >>> >>> Install sysutils/bsdadminscripts and rung pkg_libchk. :) >>> >> >> I was not aware of this tool for this purpose :-) > > I originally wrote it for the update from 6.x to 7.x, so that I could > find all packages being linked against the compat-ports and avoid > unnecessary builds. > >> With textproc/opensp installed the script hangs after some time with the >> following message: > > I doubt there is a connection. OpenSP is installed on my system > and it works fine.I think you are right ;-)>> [..snip..] >> ImageMagick-6.5.8.10_1: /usr/local/lib/libMagickWand.so.2 misses libz.so.5 >> arith: syntax error: ""0" + 1"-1.5.2_1 > > The arithmetics happen mostly during locking. I suppose the -1.5.2_1 > is a remainder of a status message and not connected to the error. > > Does this always occur in the same place? Maybe run the command with > -j1 to gain more predictable output.The next try with -j1: #pkg_libchk -j1 arith: syntax error: ""0" + 1"-2.14.17 No other output for the last 30 minutes. The only package installed with this version number is ORBit2. My systems are running under recent 9.0-CURRENT (amd64).
On 06/04/2010 11:53, Rainer Hurling wrote:> Am 06.04.2010 11:46 (UTC+1) schrieb Dominic Fandrey: >> On 06/04/2010 11:32, Rainer Hurling wrote: >>> Am 06.04.2010 11:11 (UTC+1) schrieb Dominic Fandrey: >>>> On 06/04/2010 08:36, Rainer Hurling wrote: >>>>> [..snip..] >>>>> ImageMagick-6.5.8.10_1: /usr/local/lib/libMagickWand.so.2 misses >>>>> libz.so.5 >>>>> arith: syntax error: ""0" + 1"-1.5.2_1 >>>> >>>> The arithmetics happen mostly during locking. I suppose the -1.5.2_1 >>>> is a remainder of a status message and not connected to the error. >>>> >>>> Does this always occur in the same place? Maybe run the command with >>>> -j1 to gain more predictable output. >>> >>> The next try with -j1: >>> >>> #pkg_libchk -j1 >>> arith: syntax error: ""0" + 1"-2.14.17 >>> >>> No other output for the last 30 minutes. The only package installed with >>> this version number is ORBit2. >>> >>> My systems are running under recent 9.0-CURRENT (amd64). >> >> Now, this is a real clue. The svn log states several changes to >> arithmetic expansion. >> >> I'm CC'ing this to the author of said changes. I suspect the >> following function. I wonder, is this a regression or a bug >> in my code? >> >> # >> # This function frees a semaphore. >> # >> # @param $1 >> # The name of the semaphore. >> # >> semaphoreFree() { >> local lock >> lock="$sharedprefix-semaphore-$1" >> lockf -k "$lock" sh -c " >> state=\"\$((\"\$(cat '$lock')\" + 1))\" >> echo \"\$state\"> '$lock' >> " >> } >> >> >> Would you please change the line: >> state=\"\$((\"\$(cat '$lock')\" + 1))\" >> to >> state=\"\$((\$(cat '$lock') + 1))\" >> and test whether that fixes the issue? > > Seems to work this way :-)Thanks a lot, I'll wait for Jilles reaction and decide whether I have to push out a maintenance release. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?