#47875 dirsrv not running with old openldap
Closed: wontfix None Opened 9 years ago by nhosoi.

DS fails to start if the older version of openleap (e.g., openldap-2.4.23-32) is installed with the following error:

/usr/bin/pwdhash-bin: symbol lookup error: /usr/lib64/dirsrv/libslapd.so.0: undefined symbol: ldif_getline
Could not import LDIF file '/tmp/ldifHKngyV.ldif'.  Error: 32512.  Output: importing data ...
./ns-slapd: symbol lookup error: /usr/lib64/dirsrv/libslapd.so.0: undefined symbol: ldif_getline

Reviewed by Rich (Thank you!!)

Pushed to master:
c4f396d..9fb3c43 master -> master
commit 9fb3c43
commit 0ae55bc

Pushed to 389-ds-base-1.3.2:
db9c4e7..5995ff0 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit 5995ff0
commit 1bb4389

Pushed to 389-ds-base-1.2.11:
81e5f14..e476c66 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit e476c66
commit dce84e1

These commits are being reverted.
Replying to [comment:4 nhosoi]:

Reviewed by Rich (Thank you!!)

Pushed to master:
c4f396d..9fb3c43 master -> master
commit 9fb3c43
commit 0ae55bc

Pushed to 389-ds-base-1.3.2:
db9c4e7..5995ff0 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit 5995ff0
commit 1bb4389

Pushed to 389-ds-base-1.2.11:
81e5f14..e476c66 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit e476c66
commit dce84e1

git patch file (master) -- automatically generated files from revised patch
0002-Ticket-47875-dirsrv-not-running-with-old-openldap.2.patch

Thanks to Rich for his suggestions and reviews.

Pushed to master:
9fb3c43..a595bd8 master -> master
commit a595bd8
commit 38c74d2

Pushed to 389-ds-base-1.3.2:
5995ff0..9398383 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit 9398383
commit 4917a5e

Pushed to 389-ds-base-1.2.11:
e476c66..62ef849 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 4a16332
commit 62ef849

git patch file (master) -- automatically generated file by autogen.sh
0002-Ticket-47875-dirsrv-not-running-with-old-openldap.3.patch

{{{
148 LDFLAGS="$LDFLAGS -lldap$ol_libver"
149 ol_libver="-${ol_ver_maj}.${ol_ver_min}"
}}}

Don't you need to set ol_libver before using it in LDFLAGS?

Replying to [comment:11 rmeggins]:

{{{
148 LDFLAGS="$LDFLAGS -lldap$ol_libver"
149 ol_libver="-${ol_ver_maj}.${ol_ver_min}"
}}}

Don't you need to set ol_libver before using it in LDFLAGS?
That's the tricky part... :) ol_libver at line 148 is set/unset at the libldap check. We'd like to refer the setting.
{{{
137 AC_CHECK_LIB([ldap$ol_libver], [ldap_initialize], [have_ldap_lib=1])
138 if test -z "$have_ldap_lib" ; then
139 AC_CHECK_LIB([ldap], [ldap_initialize], [unset ol_libver],
^^^^^^^^^^^^^^^
140 [AC_MSG_ERROR([specified with-openldap but libldap not found])])
141 fi
}}}
Not sure if we use -lldap (instead of -lldap-#.#), we have a chance to link with -lldif-#.# or not, but just in case, I'm checking -lldif-#.#, first.

So the problem is that, in order to run
{{{
AC_CHECK_LIB([ldif$ol_libver], [_init], [ldap_lib_ldif=-lldif$ol_libver], [ldap_lib_ldif=])
}}}
You need to have "-lldif$ol_libver" in LDFLAGS?

Note that if you have libldif-2.4.so, you must have libldap-2.4.so. It is not possible to have libldif-2.4.so without libldap-2.4.so. So this check should be unnecessary:
{{{
if test -z "$ldap_lib_ldif" ; then
AC_CHECK_LIB([ldif], [_init], [ldap_lib_ldif=-lldif],
[ldap_lib_ldif=])
fi
}}}

For example, if libldap-2.4.so was found, ol_libver will be set to "-2.4". If libldif-2.4.so is not found, then we can't use libldif.so even if it is found, because it may not match libldap-2.4.so.

So I guess I'm just not clear what the problem is and what this fix is trying to address.

So I guess I'm just not clear what the problem is and what this fix is trying to address.

The problem was configure tried to compile conftest.c with -lldif, but it was failing like this. And configure reported libldif was not available. If we set -lldap to LDFLAGS, this undefined references are solved.
{{{
configure:22729: checking for _init in -lldif
configure:22764: gcc -o conftest -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include -I/usr/include/nss3 -I/usr/include/nspr4 -I/usr/include/nspr4 conftest.c -lldif >&5
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference to ber_strdup' /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference tober_memrealloc'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference to ber_str2bv' /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference tober_memfree'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference to ber_pvt_log_printf' /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference tober_dupbv'
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference to ldap_pvt_hex_unescape' /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libldif.so: undefined reference tober_memalloc'
collect2: ld returned 1 exit status
configure:22771: $? = 1
}}}
I'm re-running the test. Just adding this to LDFLAGS solves the problem.
{{{
diff --git a/m4/openldap.m4 b/m4/openldap.m4
index 1e297c4..70312c7 100644
--- a/m4/openldap.m4
+++ b/m4/openldap.m4
@@ -145,7 +145,7 @@ if test "$with_openldap" = yes ; then
dnl look for separate libldif - newer versions of openldap have moved the
dnl ldif functionality into libldap
ldap_lib_ldif=""
- LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -lldap$ol_libver"
AC_CHECK_LIB([ldif$ol_libver], [_init], [ldap_lib_ldif=-lldif$ol_libver],
[ldap_lib_ldif=])
if test -z "$ldap_lib_ldif" ; then
}}}

Ok, I understand the problem and the fix looks correct.

git patch file (master) -- revised; To check libldif, -lldap$ol_libver needs to be added to LDFLAGS to compile test conftest.c.
0001-Ticket-47875-dirsrv-not-running-with-old-openldap.4.patch

Thank you, Rich!! I added the final patch (that includes generated configure, as well).

Can you also get rid of this:
{{{
if test -z "$ldap_lib_ldif" ; then
AC_CHECK_LIB([ldif], [_init], [ldap_lib_ldif=-lldif],
[ldap_lib_ldif=])
fi
}}}
?

Okay. Let me do that...

Since I already pushed the previous patch, I keep the records here...

Pushed to master:
61dc5e1..8c7ac72 master -> master
commit 8c7ac72

Pushed to 389-ds-base-1.3.3:
9eae60a..84f91dd 389-ds-base-1.3.3 -> 389-ds-base-1.3.3
commit 84f91dd

Pushed to 389-ds-base-1.3.2:
c4a3563..a690f70 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit a690f70

Pushed to 389-ds-base-1.2.11:
819467e..3612ac6 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit 3612ac6

git patch file (master) -- removed unnecessary checking for -lldif from openldap.m4
0001-Ticket-47875-dirsrv-not-running-with-old-openldap.5.patch

Pushed to master:
8c7ac72..0172a73 master -> master
commit 0172a73

Pushed to 389-ds-base-1.3.3:
84f91dd..48b3153 389-ds-base-1.3.3 -> 389-ds-base-1.3.3
commit 48b3153

Pushed to 389-ds-base-1.3.2:
a690f70..eb6d5a3 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit eb6d5a3

Pushed to 389-ds-base-1.2.11:
3612ac6..dd7c125 389-ds-base-1.2.11 -> 389-ds-base-1.2.11
commit dd7c125

Metadata Update from @nhosoi:
- Issue set to the milestone: 1.2.11.30

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1206

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.

Metadata