After upgrading several perl script today, when I try to log-in to sql-ledger I get an error: apache log: /usr/local/sql-ledger/login.pl: symbol lookup error: /usr/lib/perl5/vendor_perl/5.8.8/i686-linux/auto/DBD/Pg/Pg.so: undefined symbol: PQserverVersion [client 127.0.0.1] Premature end of script headers: login.pl #Joseph Reproducible: Always *** Deprecated use of action 'info', use '--info' instead Portage 2.1.2.2 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r5 i686) ================================================================= System uname: 2.6.19-gentoo-r5 i686 AMD Athlon(tm) Gentoo Base System release 1.12.9 Timestamp of tree: Fri, 09 Mar 2007 17:00:10 +0000 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] dev-java/java-config: 1.3.7, 2.0.31 dev-lang/python: 2.3.5-r3, 2.4.3-r4 dev-python/pycrypto: 2.0.1-r5 sys-apps/sandbox: 1.2.17 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.16.1-r3 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/fax /usr/share/X11/xkb /usr/share/config /var/spool/fax/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distcc distlocks metadata-transfer parallel-fetch sandbox sfperms strict" GENTOO_MIRRORS="http://distro.ibibio.org/pub/linux/distributions/gentoo/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://sunsite.ualberta.ca/pub/unix/Linux/gentoo/ rsync://linux.rz.ruhr-uni-bochum.de/gentoo/ rsync://planetmirror.com/gentoo/" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X acl alsa apache2 apm arts berkdb bitmap-fonts cdr cgi cli cracklib crypt cups devfs26 dri dv dvd eds emboss encode esd fam foomaticdb fortran gdbm gif gimp gimpprint gpm gstreamer gtk gtk2 iconv ieee1394 imlib ipv6 isdnlog java jpeg kde libg++ libwww mad midi mikmod motif mp3 mpeg mysql ncurses nls nptl nptlonly ogg opengl oss pam pcre perl png ppds pppd python qt qt3 qt4 quicktime readline reflection scanner sdl session softmmu sox spell spl ssl tcpd tiff truetype truetype-fonts type1-fonts usb vorbis x86 xml xorg xv zlib" ALSA_CARDS="via82xx" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv vesa fbdev" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
According to documentation from: http://cpan.uwinnipeg.ca/htdocs/DBD-Pg/README.html -----quote------ If you get an error message like: perl: error while loading shared libraries: /usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBD/Pg/Pg.so: undefined symbol: PQconnectdb when you call DBI->connect, then your libpq.so was probably not seen at build-time. This should have caused 'make test' to fail; did you really run it and look at the output? Check the setting of POSTGRES_LIB and recompile DBD-Pg. -----end quote------- Can somebody provide a hint how to ""Check the setting of POSTGRES_LIB" ? #Joseph
Solved! When new perl scripts emerged one of them: DBD-Pg-1.49 build with dependency: libpq Since I had an several older versions of libpq.so: libpq.so libpq.so.3 libpq.so.4 (newest one) ldd of Pq.so showed the following output: ldd /usr/lib/perl5/vendor_perl/5.8.8/i686-linux/auto/DBD/Pg/Pg.so linux-gate.so.1 => (0xffffe000) libpq.so.3 => /usr/lib/libpq.so.3 (0xb7f89000) libc.so.6 => /lib/libc.so.6 (0xb7e62000) libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0xb7e24000) libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb7cec000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7cbe000) libresolv.so.2 => /lib/libresolv.so.2 (0xb7cac000) libnsl.so.1 => /lib/libnsl.so.1 (0xb7c95000) /lib/ld-linux.so.2 (0x80000000) libdl.so.2 => /lib/libdl.so.2 (0xb7c91000) And on my main working server the ldd Pg.so is showing: ... libpq.so.4 => /usr/lib/libpq.so.4 ... So it seems to me the DBD-pg found an older library and linked to it. Solution: rm /usr/lib/libpq.so rm /usr/lib/libpq.so.3 emerge DBD-Pq After re-emerging DBD-Pg the output of the ldd Pq.so was: # ldd /usr/lib/perl5/vendor_perl/5.8.8/i686-linux/auto/DBD/Pg/Pg.so linux-gate.so.1 => (0xffffe000) libc.so.6 => /lib/libc.so.6 (0xb7e24000) /lib/ld-linux.so.2 (0x80000000) So the libpq no longer showed up so I guess the client (sql-ledger) doesn't need it as I was able to login to sql-ledger. Next, run: revdev-rebuild it will complain that libpq.so.3 is missing in some packages but it will rebuild them with libpq.so.4 (I think) as libpq.so.3 did not show up in /usr/lib/ directory I don't know how that glitch happened but there should me some way of removing older library, to prevent such obscure bugs. I always do "emerge -uDNav world" so it makes me wander why the DBD-Pq-1.49 didn't build with the newest library ? #Joseph