Bug 409821 - libcrypto.so is not included in libnetsnmp.so on x86_64
Summary: libcrypto.so is not included in libnetsnmp.so on x86_64
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp
Version: 4.6
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
: ---
Assignee: Jan Safranek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-04 08:12 UTC by Atsushi Nakabayashi
Modified: 2008-07-24 19:50 UTC (History)
0 users

Fixed In Version: RHBA-2008-0700
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-24 19:50:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0700 0 normal SHIPPED_LIVE net-snmp bug fix update 2008-07-23 15:45:38 UTC

Description Atsushi Nakabayashi 2007-12-04 08:12:46 UTC
Description of problem:

I tried to make a net-snmp tool, which includes libnetsnmp.so.5.1.2. 
When I compiled the tool, I got the following error messages. 
(It did not happen on x86) 

[root@dhcp-0136 c]# LANG=C make
gcc -Wp,-MD,./.snmptest.o.d -g -c -o snmptest.o snmptest.c
gcc -g  -o snmptest snmptest.o -lnetsnmp
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/libnetsnmp.so:
undefined reference to `EVP_DigestInit'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/libnetsnmp.so:
undefined reference to `EVP_DigestFinal'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/libnetsnmp.so:
undefined reference to `EVP_DigestFinal_ex'
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/libnetsnmp.so:
undefined reference to `AES_set_encrypt_key'
                            :

After looking into the problem I discovered that there is a difference between
libnetsnmp.so on x86 and x86_64.  libcrypto.so was not included on x86_64. 

[root@dhcp-0136 c]# ldd /usr/lib64/libnetsnmp.so.5.1.2
ldd: warning: you do not have execution permission for
`/usr/lib64/libnetsnmp.so.5.1.2'
        libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95737000)
        /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)

[root@dhcp-0136 c]# ldd /usr/lib/libnetsnmp.so.5.1.2
ldd: warning: you do not have execution permission for
`/usr/lib/libnetsnmp.so.5.1.2'
        linux-gate.so.1 =>  (0xffffe000)
        libcrypto.so.4 => /lib/libcrypto.so.4 (0xf7e48000)  
        libc.so.6 => /lib/tls/libc.so.6 (0xf7d1c000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0xf7d08000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0xf7ca3000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0xf7ca0000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0xf7c7f000)
        libresolv.so.2 => /lib/libresolv.so.2 (0xf7c6b000)
        libdl.so.2 => /lib/libdl.so.2 (0xf7c67000)
        libz.so.1 => /usr/lib/libz.so.1 (0xf7c57000)
        /lib/ld-linux.so.2 (0x56555000)



Version-Release number of selected component (if applicable):
net-snmp-5.1.2-11.EL4.11

How reproducible:
always

Steps to Reproduce:
1.ldd /usr/lib64/libnetsnmp.so.5.1.2
2.
3.
  
Actual results:
libcrypto.so is not included in libnetsnmp.so

Expected results:
libcrypto.so is included in libnetsnmp.so

Additional info:

I rebuilt net-snmp-5.1.2-11.EL4.11 on my x86_64 machine.  I installed it and
verified that libcrypto.so was included, as below. 
[root@dhcp-0136 ~]# ldd /usr/lib64/libnetsnmp.so.5.1.2
ldd: warning: you do not have execution permission for
`/usr/lib64/libnetsnmp.so.5.1.2'
        libcrypto.so.4 => /lib64/libcrypto.so.4 (0x0000003900400000)
        libc.so.6 => /lib64/tls/libc.so.6 (0x00000038fcb00000)
        libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00000038fee00000)
        libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00000038ffe00000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00000038fe800000)
        libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00000038ffa00000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00000038fd600000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00000038fd000000)
        libz.so.1 => /usr/lib64/libz.so.1 (0x00000038fd200000)
        /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)

So I believe that this was a compile machine problem.  
I suggest that the compile machine in your environment should be double-checked.

My own compile machine had a similar problem, as seen below. 

*** Warning: linker path does not have real file for library -lcrypto.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libcrypto but no candidates were found. (...for file magic test)
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

So I applied the following patch to net-snmp package, to fix the problem. 

--- net-snmp-5.1.2/Makefile.top.org     2007-11-30 17:28:48.000000000 +0900
+++ net-snmp-5.1.2/Makefile.top 2007-11-30 17:28:58.000000000 +0900
@@ -63,7 +63,7 @@ LIBREVISION = 2
 # generally, LIBCURRENT should stay the same unless major changes occur.
 # Increment REVISION every release.
 # Increment AGE if new stuff is available.
-LIB_LD_CMD      = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -rpath $(libdir)
-version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
+LIB_LD_CMD      = $(LIBTOOL) --mode=link $(CC) -L$(libdir) $(CFLAGS) -rpath
$(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
 LIB_EXTENSION   = la
 LIB_VERSION     =
 LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(libdir)

Comment 1 Jan Safranek 2007-12-04 12:31:39 UTC
Thanks for the report! Please set the 'version' field to ver. where the bug is
found, not where you want it to be fixed.

Comment 2 Jan Safranek 2007-12-04 13:08:23 UTC
oops, criticizing others and making the same mistake. Changing the version to 4.6.

Comment 3 RHEL Program Management 2007-12-04 13:14:57 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 4 Jan Safranek 2007-12-04 14:49:59 UTC
It's the same problem as bug #197684 (Fedora).

Comment 10 errata-xmlrpc 2008-07-24 19:50:28 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0700.html


Note You need to log in before you can comment on or make changes to this bug.