Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29124 - Apache and libdb linking problems
Summary: Apache and libdb linking problems
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Web Application Packages Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-19 07:49 UTC by CJ Kucera
Modified: 2003-09-26 21:48 UTC (History)
1 user (show)

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


Attachments
my-apache-db4.patch (my-apache-db4.patch,1.65 KB, patch)
2003-09-19 07:52 UTC, CJ Kucera
Details | Diff
An updated patch (apache-1.3.27_db4_gentoo.patch,868 bytes, patch)
2003-09-23 05:39 UTC, Daniele Arduini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description CJ Kucera 2003-09-19 07:49:14 UTC
I had recently upgraded a number of packages on my system, and when I went to
start Apache again (version 1.3.28), I would get the following message:

  Cannot load /etc/apache/modules/mod_auth_dbm.so into server:
/etc/apache/modules/mod_auth_dbm.so: undefined symbol: __db_ndbm_close_4000

Checking /etc/apache/modules/mod_auth_dbm.so, I noticed that it had been linked
against libdb.so.2, which in fact doesn't have that symbol present (libdb.so.2
is owned by sys-libs/db-1.85-r1 on my system), whereas libdb.so *does* (owned by
sys-libs/db-4.0.14-r2).  I tried re-emerging apache and both versions of libdb a
number of times, to no avail.

In order to get mod_auth_dbm.so to link to the proper library, I ended up having
to modify the apache-1.3.27_db4_gentoo.patch which is applied in src_unpack. 
I'll attach what I changed it to, though it's not a good general solution as it
just explicitly forces linking to the library I know works.

In case it matters, I actually have three versions of db installed:
root@arrakis:~# ls -d /var/db/pkg/sys-libs/db-*
/var/db/pkg/sys-libs/db-1.85-r1/   /var/db/pkg/sys-libs/db-4.0.14-r2/
/var/db/pkg/sys-libs/db-3.2.9-r2/

Reproducible: Always
Steps to Reproduce:
1. emerge db-1.85-r1, db-4.0.14-r2, apache-1.3.28
2. try and start apache
Actual Results:  
Error: Cannot load /etc/apache/modules/mod_auth_dbm.so into server:
/etc/apache/modules/mod_auth_dbm.so: undefined symbol: __db_ndbm_close_4000

Expected Results:  
Apache Start

root@arrakis:~# emerge info
Portage 2.0.49-r3 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.22)
=================================================================
System uname: 2.4.22 i686 AMD Duron(tm) Processor
distcc 2.9 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.2 [enabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="no"
CFLAGS="-march=athlon-xp -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox autoaddcvs ccache"
GENTOO_MIRRORS="ftp://mirror.iawnet.sandia.gov/pub/gentoo/
http://www.ibiblio.org/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/local/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apm avi crypt cups encode foomaticdb jpeg libg++ mad mikmod mmx nls
pdflib png quicktime spell gtkhtml alsa gdbm berkdb slang readline arts bonobo
svga java guile sdl gpm tcpd pam libwww ssl python imlib oggvorbis gtk qt kde
motif opengl cdr scanner aalib dga esd gd ggi gif gnome graphviz innodb mozilla
mpeg mysql ncurses mbox -maildir dvd offensive -apache2 odbc oss perl pgsql
postgres tcltk tiff truetype X xml xml2 xmms xv zlib"
Comment 1 CJ Kucera 2003-09-19 07:52:33 UTC
Created attachment 17978 [details, diff]
my-apache-db4.patch

This is the patch I used instead of the apache-1.3.27_db4_gentoo.patch applied
in the ebuild.	It's not a good general-purpose solution because it basically
just forces linking to libdb-4.0, but it worked for me, so here it is.
Comment 2 Daniele Arduini 2003-09-23 01:21:17 UTC
A similar patch already exists in the portage repository, and in the apache-1.3.28.ebuild is applied, but it looks for a library -ldb-4 which
it doesn't exists!

Your patch works because it correctly looks for the -ldb-4.0 library.

Either add a link:

   # ln -s /usr/lib/libdb-4.0.so libdb-4.so

or the patch already in the repository should be fixed.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-09-23 03:29:02 UTC
doing "ln -s /usr/lib/libdb-4.0.so libdb-4.so"
is NOT the correct action, as db-4.1 may exist as well.
The package should look for db-4.0 explictly if that is the version it wants.
include dir should be /usr/include/db40/

Comment 4 Daniele Arduini 2003-09-23 05:39:18 UTC
Created attachment 18199 [details, diff]
An updated patch

An updated patch with better support for db-4 based on the patch already in the
portage repository
Comment 5 Donny Davies (RETIRED) gentoo-dev 2003-09-26 21:48:00 UTC
added this patch to apache-1.3.28-r1, thank you