Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 72752 - net-snmp-5.2 + use snmp breaks php/mod_php due to undefined AES symbols
Summary: net-snmp-5.2 + use snmp breaks php/mod_php due to undefined AES symbols
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
: 87746 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-28 12:05 UTC by Keith Landry
Modified: 2005-04-04 05:57 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
php5-sapi.eclass (php5-sapi.eclass,16.86 KB, text/plain)
2004-11-28 12:07 UTC, Keith Landry
Details
net-snmp-5.2+-AES.patch (net-snmp-5.2+-AES.patch,1.02 KB, patch)
2004-11-28 12:07 UTC, Keith Landry
Details | Diff
php5-sapi.eclass (php5-sapi.eclass,16.86 KB, text/plain)
2004-12-13 00:41 UTC, Keith Landry
Details
php-sapi.eclass (php-sapi.eclass,22.95 KB, patch)
2004-12-13 00:42 UTC, Keith Landry
Details | Diff
php5-netsnmp52-aes.diff (php5-netsnmp52-aes.diff,1.82 KB, patch)
2004-12-13 00:45 UTC, Keith Landry
Details | Diff
php4-netsnmp52-aes.diff (php4-netsnmp52-aes.diff,1.81 KB, patch)
2004-12-13 00:46 UTC, Keith Landry
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Landry 2004-11-28 12:05:35 UTC
Broken system with net-analyzer/net-snmp-5.2:

wintermute ~ # /etc/init.d/apache2 start
 * Apache2 has detected a syntax error in your configuration files:
Syntax error on line 6 of /usr/lib/apache2/conf/modules.d/70_mod_php5.conf:
Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: undefined symbol: usmAES192PrivProtocol
wintermute ~ # ldd /usr/lib/apache2/modules/libphp5.so
      linux-gate.so.1 =>  (0xffffe000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7a82000)
        libssl.so.0.9.7 => /usr/lib/libssl.so.0.9.7 (0xb7a52000)
        libcrypto.so.0.9.7 => /usr/lib/libcrypto.so.0.9.7 (0xb7956000)
        libtidy-0.99.so.0 => /usr/lib/libtidy-0.99.so.0 (0xb78f9000)
        libhistory.so.5 => /lib/libhistory.so.5 (0xb78f0000)
        libreadline.so.5 => /lib/libreadline.so.5 (0xb78bb000)
        libncurses.so.5 => /lib/libncurses.so.5 (0xb786d000)
        libpspell.so.15 => /usr/lib/libpspell.so.15 (0xb786b000)
        libpanel.so.5 => /usr/lib/libpanel.so.5 (0xb7867000)
        libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0xb781e000)
        libmcrypt.so.4 => /usr/lib/libmcrypt.so.4 (0xb77e0000)
        libltdl.so.3 => /usr/lib/libltdl.so.3 (0xb77d8000)
        libpam.so.0 => /lib/libpam.so.0 (0xb77cf000)
        libt1.so.5 => /usr/lib/libt1.so.5 (0xb776d000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb76e5000)
        libpng.so.3 => /usr/lib/libpng.so.3 (0xb76ab000)
        libz.so.1 => /lib/libz.so.1 (0xb7699000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb7679000)
        libdb-4.2.so => /usr/lib/libdb-4.2.so (0xb757d000)
        libgdbm.so.3 => /usr/lib/libgdbm.so.3 (0xb7577000)
        libresolv.so.2 => /lib/libresolv.so.2 (0xb7562000)
        libm.so.6 => /lib/libm.so.6 (0xb753f000)
        libdl.so.2 => /lib/libdl.so.2 (0xb753b000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb7525000)
        libcurl.so.3 => /usr/lib/libcurl.so.3 (0xb74f0000)
        libidn.so.11 => /usr/lib/libidn.so.11 (0xb74c0000)
        libodbc.so.1 => /usr/lib/libodbc.so.1 (0xb7456000)
        libnetsnmp.so.5 => /usr/lib/libnetsnmp.so.5 (0xb73a9000)
        libelf.so.1 => /usr/lib/libelf.so.1 (0xb7395000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7265000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7252000)
        libc.so.6 => /lib/libc.so.6 (0xb712a000)
        libgpm.so.1 => /usr/lib/libgpm.so.1 (0xb7123000)
        libaspell.so.15 => /usr/lib/libaspell.so.15 (0xb7057000)
        libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 (0xb6f8b000)
        libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libgcc_s.so.1 (0xb6f81000)
        /lib/ld-linux.so.2 (0x80000000)
wintermute ~ # file /usr/lib/libnetsnmp.so.5
/usr/lib/libnetsnmp.so.5: symbolic link to `libnetsnmp.so.5.2.0
wintermute ~ # strings /usr/lib/libnetsnmp.so.5.2.0 | grep usmAES192PrivProtocol

System that works with net-analyzer/net-snmp-5.1.2:

strings /usr/lib/libnetsnmp.so.5.1.2|  grep usmAES192PrivProtocol
usmAES192PrivProtocol


Attempt to rebuild mod_php:

hp-5.0.2/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/pspell  -D_REENTRANT -I/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/TSRM -DTHREAD=1  -O3 -mfpmath=sse,387 -march=pentium4 -ffast-math -fomit-frame-pointer -pipe -pthread -DZTS  -prefer-pic -c /var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/soap/soap.c -o ext/soap/soap.lo
distcc[1506] ERROR: compile /root/.ccache/snmp.tmp.wintermute.1502.i on localhost failed
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function `netsnmp_session_set_sec_protocol':
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: `usmAES192PrivProtocol' undeclared (first use in this function)
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: (Each undeclared identifier is reported only once
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: for each function it appears in.)
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:799: error: `usmAES256PrivProtocol' undeclared (first use in this function)
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function `netsnmp_session_gen_auth_key':
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:822: warning: initialization discards qualifiers from pointer target type
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function `netsnmp_session_gen_sec_key':
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:851: warning: initialization discards qualifiers from pointer target type
distcc[1502] ERROR: compile /var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c on localhost failed
make: *** [ext/snmp/snmp.lo] Error 1
make: *** Waiting for unfinished jobs....


Looks like change was made here:

http://cvs.sourceforge.net/viewcvs.py/net-snmp/net-snmp/snmplib/snmpusm.c?r1=5.10&r2=5.11&only_with_tag=MAIN

And Here:

http://cvs.sourceforge.net/viewcvs.py/net-snmp/net-snmp/snmplib/snmpv3.c?r1=5.9&r2=5.10&only_with_tag=MAIN

To conform with:

http://www.ietf.org/rfc/rfc3826.txt

Made a patch to only reference usmAES128PrivProtocol and usmAESPrivProtocol.

Looked like all patching was being done in the eclass so that's where I added:

use snmp && has_version '>=net-analyzer/net-snmp-5.2' && epatch ${FILESDIR}/net-snmp-5.2+-AES.patch






Reproducible: Always
Steps to Reproduce:
1.USE="~x86" emerge net-snmp
2. restart apache if using mod_php or compile mod_php
3. 

Actual Results:  
Apache fails to start with:
wintermute ~ # /etc/init.d/apache2 start
 * Apache2 has detected a syntax error in your configuration files:
Syntax error on line 6 of /usr/lib/apache2/conf/modules.d/70_mod_php5.conf:
Cannot load /usr/lib/apache2/modules/libphp5.so into server:
/usr/lib/apache2/modules/libphp5.so: undefined symbol: usmAES192PrivProtocol

Compiling mod_php fails with:
distcc[1506] ERROR: compile /root/.ccache/snmp.tmp.wintermute.1502.i on
localhost failed
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function
`netsnmp_session_set_sec_protocol':
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error:
`usmAES192PrivProtocol' undeclared (first use in this function)
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: (Each
undeclared identifier is reported only once
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:795: error: for
each function it appears in.)
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:799: error:
`usmAES256PrivProtocol' undeclared (first use in this function)
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function
`netsnmp_session_gen_auth_key':
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:822: warning:
initialization discards qualifiers from pointer target type
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c: In function
`netsnmp_session_gen_sec_key':
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c:851: warning:
initialization discards qualifiers from pointer target type
distcc[1502] ERROR: compile
/var/tmp/portage/mod_php-5.0.2/work/php-5.0.2/ext/snmp/snmp.c on localhost failed
make: *** [ext/snmp/snmp.lo] Error 1
make: *** Waiting for unfinished jobs....


Expected Results:  
Starting and compiling without error

wintermute ~ # emerge info
Portage 2.0.51-r3 (gcc34-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20041102-r0,
2.6.9-nitro4 i686)
=================================================================
System uname: 2.6.9-nitro4 i686 Intel(R) Pentium(R) 4 CPU 3.06GHz
Gentoo Base System version 1.6.6
distcc 2.18.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mfpmath=sse,387 -march=pentium4 -ffast-math -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control /var/www/localhost/htdocs//mythweb/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -mfpmath=sse,387 -march=pentium4 -ffast-math -fomit-frame-pointer
-pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache distcc distlocks fixpackages prelink"
GENTOO_MIRRORS="ftp://gentoo.ccccom.com http://gentoo.ccccom.com
http://mymirror.asiaosc.org/gentoo/"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi aim alsa apache2 apm arts artswrappersuid audiofile avi berkdb
bitmap-fonts bonobo caps cdparanoia cdr crypt cups curl curlwrappers dba
divx4linux doc dvd dvdr encode esd ethereal f77 ffmpeg flac foomatic foomaticdb
fortran ftp gd gdbm gif gnome gnustep gphoto2 gpm gstreamer gtk gtk2 gtkhtml
guile iconv icq imap imlib ipv6 ithreads jabber jack java joystick jpeg kde
libg++ libwww lirc mad mikmod mmx motif mozilla mpeg mppe-mppc mysql ncurses nls
nptl nptlonly objc odbc offensive oggvorbis opengl oscar oss pam pcmcia pcre
pdflib perl png pnp posix ppds python qt quicktime readline ruby samba sasl sdl
session slang slp snmp soap spell spl sse sse2 ssl svga sysvipc tcltk tcpd tetex
theora threads tidy tiff transcode truetype usb videos wireless x86 xine
xinerama xml2 xmms xosd xprint xv xvid yahoo zlib"
Comment 1 Keith Landry 2004-11-28 12:07:03 UTC
Created attachment 44885 [details]
php5-sapi.eclass
Comment 2 Keith Landry 2004-11-28 12:07:52 UTC
Created attachment 44886 [details, diff]
net-snmp-5.2+-AES.patch
Comment 3 Andrew D. Keyser (aka Legoguy) 2004-11-28 15:55:40 UTC
Also applies for normal PHP.
My 2 cents.
Comment 4 PJ 2004-11-28 17:20:35 UTC
I am experencing this same condition with both php and mod_php.
Comment 5 Keith Landry 2004-11-28 22:11:28 UTC
Same errors with php here too:

wintermute ~ # php
php: symbol lookup error: php: undefined symbol: usmAES192PrivProtoco

Seeing as I put the epatch in the eclass the patch works for php as well if copied to the php/files directory.

(Not sure if that is right, but makes more sense to me now as php5/mod_php5 use the same source tarball)
Comment 6 Dan A. Dickey 2004-11-30 11:02:30 UTC
This new eclass and patch allows mod_php to emerge on my system.
Can it be committed to CVS and this bug closed?
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-06 01:04:44 UTC
It would help if somebody copied us PHP folk on this...
Comment 8 Martin Holzer (RETIRED) gentoo-dev 2004-12-07 09:43:44 UTC
works here too
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-07 11:57:36 UTC
I submitted a similar fix to upstream a few days ago. I'll throw it back this way soon.
Comment 10 Keith Landry 2004-12-07 16:41:49 UTC
And your patch makes more sense :-)
Comment 11 Blu3 2004-12-12 07:59:22 UTC
any update on getting this into portage so things will build?  :)
Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-12 16:10:50 UTC
sorry, I'm busy dealing with finals this week (until the end of Saturday 18th December), and it doesn't seem any other PHP folk are around.
Comment 13 Keith Landry 2004-12-13 00:41:22 UTC
Created attachment 45881 [details]
php5-sapi.eclass

new php5-sapi.eclass
Comment 14 Keith Landry 2004-12-13 00:42:51 UTC
Created attachment 45882 [details, diff]
php-sapi.eclass

php-sapi.eclass applies patch for php4
Comment 15 Keith Landry 2004-12-13 00:45:36 UTC
Created attachment 45883 [details, diff]
php5-netsnmp52-aes.diff

php5-netsnmp52-aes.diff patch from http://bugs.php.net/bug.php?id=30995
Comment 16 Keith Landry 2004-12-13 00:46:58 UTC
Created attachment 45884 [details, diff]
php4-netsnmp52-aes.diff

php4-netsnmp52-aes.diff patch from http://bugs.php.net/bug.php?id=30995
Comment 17 Keith Landry 2004-12-13 00:54:28 UTC
I grabbed the patches http://bugs.php.net/bug.php?id=30995 and updated the eclass to use them.

I tested as follows:

With net-snmp-5.1.2 and patch/eclass inplace I compiled and ran php4/php5/mod_php4/mod_php5. 

With net-snmp-5.2 and patch/eclass inplace I compiled and ran php4/php5/mod_php4/mod_php5.

SNMP worked in each case as well.
Comment 18 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-13 02:06:25 UTC
upstream had a much better patch based on mine (and just re-used my comments), grab it from the CVS if you are going to apply any patch at all.
Comment 19 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-15 13:22:02 UTC
sorry I delayed this.
I knew the fixes would be in 4.3.10/5.0.3 which were released today, so I didn't exactly jump at putting this patch in.

I'm just testing the new versions now, then they'll be in the tree.
Comment 20 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-15 22:49:38 UTC
4.3.10 and 5.0.3 are in CVS now.
Comment 21 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-04-04 05:57:37 UTC
*** Bug 87746 has been marked as a duplicate of this bug. ***