[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ch_free symbol undefined while loading dynamic backend

Edward Rudd wrote:

I tried re-compiling my OpenLDAP rpms (2.2.23 on WBEL3) to build dynamic
loading backends(so I could play with/use more of the different backends
available). however I am running into one issue which was brought up in
ITS #2912.

when running slapd like this

# /usr/libexec/slapd -u ldap -d ldap -d 255

with the moduleload back_bdb.la I get this error

line 28 (modulepath /usr/libexec/openldap)
line 29 (moduleload back_bdb.la)
lt_dlopenext failed: (back_bdb.la)
/usr/libexec/openldap/back_bdb-2.2.so.7: undefined symbol: ch_free
/etc/openldap/slapd.conf: line 29: failed to load or initialize module

ldd of /usr/libexec/openldap/back_dbd-2.2.so.7 is libldap_r-2.2.so.7 => /usr/lib/libldap_r-2.2.so.7 (0x00123000)
liblber-2.2.so.7 => /usr/lib/liblber-2.2.so.7 (0x00717000)
libc.so.6 => /lib/tls/libc.so.6 (0x0015d000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00bc5000)
libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00b35000)
libssl.so.4 => /lib/libssl.so.4 (0x00295000)
libcrypto.so.4 => /lib/libcrypto.so.4 (0x00d19000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x003ae000)
libdl.so.2 => /lib/libdl.so.2 (0x00111000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x002c9000)
libz.so.1 => /usr/lib/libz.so.1 (0x00689000)
libgssapi_krb5.so.2 => /usr/kerberos/lib/libgssapi_krb5.so.2
libkrb5.so.3 => /usr/kerberos/lib/libkrb5.so.3 (0x00309000)
libcom_err.so.3 => /usr/kerberos/lib/libcom_err.so.3 (0x00a38000)
libk5crypto.so.3 => /usr/kerberos/lib/libk5crypto.so.3 (0x006ce000)

Openldap was compiled with ./configure --with-slapd --with-slurpd --without-ldapd \ --with-threads=posix --enable-static \ --enable-local --enable-cldap --disable-rlookups \ --with-tls --with-cyrus-sasl --enable-wrappers \ --enable-passwd --enable-shell --enable-cleartext \ --enable-crypt --enable-spassword --enable-modules \ --enable-dynamic --enable-aci \ --enable-bdb=mod --with-kerberos=k5only --enable-kpasswd \ --enable-sql=mod --enable-ldbm=mod --enable-ldap=mod \ --enable-perl=mod --enable-hdb=mod

Any ideas as to why it is giving this symbol error? the ITS report just
said that the ch_free error *shouldn't happen*, but no solution to fix
it, or why it might happen.

As noted in the ITS, there is a problem in the build environment. Not enough information was present in the ITS to identify the problem in the environment. In your case, it looks like you're linking with MIT Kerberos, which is certainly a bad idea. OpenLDAP 2.2.23 doesn't support the kpasswd option, so I don't see any reason to link Kerberos here at all. Most notably missing from the ldd output of your back_bdb module is a reference to libdb. In my stock OpenLDAP 2.2.23 build tree this is what I get:
ldd back-bdb/.libs/back_bdb.so
libdb-4.2.so => /usr/local/lib/libdb-4.2.so (0x0000002a95693000)
libldap_r-2.2-releng.so.7 => /home/hyc/OD/o22/libraries/libldap_r/.libs/libldap_r-2.2-releng.so.7 (0x0000002a95856000)
liblber-2.2-releng.so.7 => /home/hyc/OD/o22/libraries/liblber/.libs/liblber-2.2-releng.so.7 (0x0000002a95995000)
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a95ac5000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000002a95ce8000)
libsasl2.so.2 => /usr/local/lib/libsasl2.so.2 (0x0000002a95dfd000)
libssl.so.0.9.7 => /usr/local/lib/libssl.so.0.9.7 (0x0000002a95f14000)
libcrypto.so.0.9.7 => /usr/local/lib/libcrypto.so.0.9.7 (0x0000002a9604d000)
/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000002a96293000)

configure was run with
--enable-dynamic --enable-modules --enable-bdb=mod --enable-hdb=mod

TLS and SASL are picked up by default, and I always omit switches that are present by default. (That's what defaults are for, after all.)

 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support