Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Mar 2008 12:05:22 +0000
From:      Chris <chrcoluk@gmail.com>
To:        "FreeBSD Stable" <freebsd-stable@freebsd.org>
Subject:   linked ssl libraries to binary
Message-ID:  <3aaaa3a0803040405l74135ea9va2ebfbe6ee0b5fc1@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I have a freebsd 6.3 server and a freebsd 7.0 server, I have a binary
I run of the freebsd 7 box but has recently been crashing, the binary
in question is ezbounce.

It was previously running for weeks no problems at all and then during
the past 2 weeks or so its had problems.

Like many shell programs it has a configure script and you then run
make or gmake to compile the binary.

On freebsd 6 it picks up /usr/local ssl libaries no problem and in
fact uses them without even haveing to specify the directory it auto
detects them over the base ssl.  On freebsd 7 it uses the base
libraries even when telling it to search in /usr/local.

So I then decided to move the binary I compiled on freebsd 6 over to
the freebsd 7 box and when I ran ldd on the binary to my surprise it
is using the base libraries on freebsd 7.

ldd on binary on freebsd 6

        libssl.so.5 => /usr/local/lib/libssl.so.5 (0x48102000)
        libcrypto.so.5 => /usr/local/lib/libcrypto.so.5 (0x48143000)
        libcrypt.so.3 => /lib/libcrypt.so.3 (0x4829f000)
        libboost_iostreams.so => /usr/local/lib/libboost_iostreams.so
(0x482b8000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x482c0000)
        libm.so.4 => /lib/libm.so.4 (0x48396000)
        libpthread.so.2 => /lib/libpthread.so.2 (0x483ac000)
        libc.so.6 => /lib/libc.so.6 (0x483d3000)
        libbz2.so.2 => /usr/lib/libbz2.so.2 (0x484cb000)
        libz.so.3 => /lib/libz.so.3 (0x484dc000)

ldd on same binary on freebsd 7

        libssl.so.5 => /usr/lib/libssl.so.5 (0x28101000)
        libcrypto.so.5 => /lib/libcrypto.so.5 (0x28142000)
        libcrypt.so.3 => /usr/local/lib/compat/libcrypt.so.3 (0x2829a000)
        libboost_iostreams.so => /usr/local/lib/libboost_iostreams.so
(0x282b2000)
        libstdc++.so.5 => /usr/local/lib/compat/libstdc++.so.5 (0x282bd000)
        libm.so.4 => /usr/local/lib/compat/libm.so.4 (0x28388000)
        libpthread.so.2 => /usr/local/lib/compat/libpthread.so.2 (0x2839e000)
        libc.so.6 => /usr/local/lib/compat/libc.so.6 (0x283c3000)
        libc.so.7 => /lib/libc.so.7 (0x284a9000)
        libbz2.so.3 => /usr/lib/libbz2.so.3 (0x285a4000)
        libz.so.4 => /lib/libz.so.4 (0x285b4000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x285c6000)
        libm.so.5 => /lib/libm.so.5 (0x286ba000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x286cf000)
        libthr.so.3 => /lib/libthr.so.3 (0x286da000)

The binary doesnt run on the freebsd 7 either it coredumps even tho I
have compat6x installed, typically in the past I have had no problems
at all using binaries compiled on old freebsd versions on newer
versions I just had to install the appropriate compat package.

Here is the ldd when compiled on the freebsd 7 box

        libssl.so.5 => /usr/lib/libssl.so.5 (0x2810f000)
        libcrypto.so.5 => /lib/libcrypto.so.5 (0x28150000)
        libcrypt.so.4 => /lib/libcrypt.so.4 (0x282a8000)
        libboost_iostreams.so => /usr/local/lib/libboost_iostreams.so
(0x282c1000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x282cc000)
        libm.so.5 => /lib/libm.so.5 (0x283c0000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x283d5000)
        libthr.so.3 => /lib/libthr.so.3 (0x283e0000)
        libc.so.7 => /lib/libc.so.7 (0x283f3000)
        libbz2.so.3 => /usr/lib/libbz2.so.3 (0x284ee000)
        libz.so.4 => /lib/libz.so.4 (0x284fe000)

Is the output for the ssl libraries skewed because both the local
filenames and the base filenames are the same? as there is a
/usr/local/lib/libssl.so.5 and a /usr/lib/libssl.so.5.  Or does this
mean that it really is linked against the base libraries as I am
wondering how that is possible when the same binary is linked against
different libraries on a different machine.

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3aaaa3a0803040405l74135ea9va2ebfbe6ee0b5fc1>