Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 396691 - net-mail/dovecot - dovecot/auth segfault with error 4 in libldap-2.4.so.2.7.0
Summary: net-mail/dovecot - dovecot/auth segfault with error 4 in libldap-2.4.so.2.7.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Eray Aslan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-01 16:42 UTC by Vincent-Xavier JUMEL
Modified: 2022-05-04 06:17 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge --info,15.32 KB, text/plain)
2012-01-01 16:43 UTC, Vincent-Xavier JUMEL
Details
openldap-2.4.24.ebuild.patch (openldap-2.4.24.ebuild.patch,1.14 KB, patch)
2012-01-14 05:48 UTC, Markus Peloquin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent-Xavier JUMEL 2012-01-01 16:42:32 UTC
As stated in the summary, I did few research on this matter. There's an entry in the OpenLDAP ITS (<http://www.openldap.org/its/index.cgi/Incoming?id=6880;page=9>) where it says :
> Your trace shows that both libldap and libldap_r are present. Your PHP is built
> incorrectly. You cannot link both libraries into the same program; they are not
> compatible. Closing this ITS.

On my server, I typed :

zsh 1007 % ldd /usr/libexec/dovecot/auth | grep ldap
        libldap-2.4.so.2 => /usr/lib64/libldap-2.4.so.2 (0x00007fc77ebc9000)
        libldap_r-2.4.so.2 => /usr/lib64/libldap_r-2.4.so.2 (0x00007fc77d233000)

It seems that /usr/libexec/dovecot/auth is linked against both libldap-2.4.so.2 and libldap_r-2.4.so.2 which wont work as excpeted.



Reproducible: Always




zsh 1008 % emerge -p net-mail/dovecot                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                  
These are the packages that would be merged, in order:                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                  
Calculating dependencies... done!                                                                                                                                                                                                                                                 
[ebuild   R    ] net-mail/dovecot-2.0.16-r1  USE="bzip2 caps doc ipv6 ldap maildir managesieve pam postgres sieve sqlite ssl zlib -cydir -kerberos -mbox -mdbox -mysql -sdbox -static-libs -suid -vpopmail" 0 kB
Comment 1 Vincent-Xavier JUMEL 2012-01-01 16:43:52 UTC
Created attachment 297543 [details]
emerge --info
Comment 2 Rafał Mużyło 2012-01-01 16:50:29 UTC
See 'lddtree /usr/libexec/dovecot/auth' instead.
Comment 3 Eray Aslan gentoo-dev 2012-01-03 11:41:18 UTC
Please give 'lddtree /usr/libexec/dovecot/auth' output.  What is your version of openldap?
Comment 4 Vincent-Xavier JUMEL 2012-01-04 16:05:23 UTC
zsh 1074 % lddtree /usr/libexec/dovecot/auth
auth => /usr/libexec/dovecot/auth (interpreter => /lib64/ld-linux-x86-64.so.2)
    libdovecot.so.0 => /usr/lib64/dovecot/libdovecot.so.0
        librt.so.1 => /lib64/librt.so.1
            libpthread.so.0 => /lib64/libpthread.so.0
    libcrypt.so.1 => /lib64/libcrypt.so.1
    libpam.so.0 => /lib64/libpam.so.0
    libldap-2.4.so.2 => /usr/lib64/libldap-2.4.so.2
        libresolv.so.2 => /lib64/libresolv.so.2
        libgnutls.so.26 => /usr/lib64/libgnutls.so.26
            libtasn1.so.3 => /usr/lib64/libtasn1.so.3
            libz.so.1 => /lib64/libz.so.1
            libgcrypt.so.11 => /usr/lib64/libgcrypt.so.11
                libgpg-error.so.0 => /usr/lib64/libgpg-error.so.0
    liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2
    libpq.so.5 => /usr/lib64/libpq.so.5
        libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0
        libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0
        libldap_r-2.4.so.2 => /usr/lib64/libldap_r-2.4.so.2
    libsqlite3.so.0 => /usr/lib64/libsqlite3.so.0
        libicui18n.so.48 => /usr/lib64/libicui18n.so.48
            libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/32/libstdc++.so.6
                ld-linux.so.2 => /lib64/ld-linux.so.2
            libm.so.6 => /lib64/libm.so.6
            libgcc_s.so.1 => /lib64/libgcc_s.so.1
        libicuuc.so.48 => /usr/lib64/libicuuc.so.48
            libicudata.so.48 => /usr/lib64/libicudata.so.48
    libdl.so.2 => /lib64/libdl.so.2
    libc.so.6 => /lib64/libc.so.6

net-nds/openldap-2.4.25-r1  USE="berkdb crypt gnutls icu ipv6 overlays ssl syslog tcpd -cxx -debug -experimental -iodbc -kerberos -minimal -odbc -perl -samba -sasl (-selinux) -slp -smbkrb5passwd"
Comment 5 Eray Aslan gentoo-dev 2012-01-04 18:30:02 UTC
dovecot only links against libldap-2.4.so.2.  Please get a backtrace.
http://www.gentoo.org/proj/en/qa/backtraces.xml should help.
Comment 6 Vincent-Xavier JUMEL 2012-01-04 19:24:27 UTC
Here's a backtrace, maybe you want more information ?


Reading symbols from /usr/libexec/dovecot/auth...Reading symbols from /usr/lib64/debug/usr/libexec/dovecot/auth.debug...done.
done.
[New LWP 14189]

warning: Can't read pathname for load map: Erreur d'entr�e/sortie.
[Thread debugging using libthread_db enabled]
Core was generated by `dovecot/auth -w'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f66b787cd03 in ldap_free_urllist () from /usr/lib64/libldap-2.4.so.2
(gdb) bt full
#0  0x00007f66b787cd03 in ldap_free_urllist () from /usr/lib64/libldap-2.4.so.2
No symbol table info available.
#1  0x00007f66b5ce537b in ?? () from /usr/lib64/libldap_r-2.4.so.2
No symbol table info available.
#2  0x00007f66b5cca62f in ?? () from /usr/lib64/libldap_r-2.4.so.2
No symbol table info available.
#3  0x0000000000000022 in ?? ()
No symbol table info available.
#4  0x0000000000000000 in ?? ()
No symbol table info available.
Comment 7 Vincent-Xavier JUMEL 2012-01-04 22:25:13 UTC
I've rebuilt dovecot with USE="-postgresql", getting rid of the indirect linkage to /usr/lib64/libldap_r-2.4.so.2 and I don't get anymore this segfault message in my log and dmesg.
Comment 8 Eray Aslan gentoo-dev 2012-01-09 20:55:11 UTC
+  09 Jan 2012; Eray Aslan <eras@gentoo.org> dovecot-1.2.17.ebuild,
+  dovecot-2.0.15.ebuild, dovecot-2.0.16.ebuild, dovecot-2.0.16-r1.ebuild,
+  dovecot-2.0.17.ebuild, dovecot-2.1_rc3.ebuild:
+  block against postgresql-base[ldap,threads] - bug #396691
+
Comment 9 Markus Peloquin 2012-01-14 04:10:42 UTC
This solution seems kind of rash, but perhaps fine as a temporary measure.

(1) add a USE=threads to openldap that causes libldap* be a symlink to the corresponding libldap_r*. postgres[threads] can then depend on openldap[threads]. The same goes for anything else that links with libldap_r.
(2) finagle dovecot to try for libldap_r if USE=openldap

I don't understand why people are scared of threads. They have been around for four or so decades, and processors don't get faster anymore.
Comment 10 Markus Peloquin 2012-01-14 04:11:41 UTC
Before the list, I intended to say 'these are two more ideal solutions' or something...
Comment 11 Markus Peloquin 2012-01-14 05:48:10 UTC
Created attachment 298905 [details, diff]
openldap-2.4.24.ebuild.patch

1) Make symlinks libldap* -> libldap_r* for shared/static libraries.
2) s/libldap_r/libldap/ < libldap_r.la > libldap.la

It applies cleanly to the other ebuilds; I just did 2.4.24 because it was amd64-stable.  Then:

--- /usr/portage/dev-db/postgresql-base/postgresql-base-9.1.1.ebuild	2011-12-17 10:31:06.000000000 -0800
+++ /usr/local/portage/dev-db/postgresql-base/postgresql-base-9.1.1.ebuild	2012-01-13 21:28:06.314215452 -0800
@@ -46,7 +46,7 @@
 		 >=app-admin/eselect-postgresql-1.0.10
 		 virtual/libintl
 		 kerberos? ( virtual/krb5 )
-		 ldap? ( net-nds/openldap )
+		 ldap? ( net-nds/openldap threads? ( net-nds/openldap[threads] ) )
 		 pam? ( virtual/pam )
 		 readline? ( sys-libs/readline )
 		 ssl? ( >=dev-libs/openssl-0.9.6-r1 )

Finally, I reverted the openldap ebuilds.
Comment 12 Eray Aslan gentoo-dev 2012-01-14 10:12:38 UTC
Please open a separate bug for it.  Thank you.
Comment 13 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2015-04-01 22:31:26 UTC
Can I ask to remove that fix, since for now it undeservedly blocks new postgres[ldap,threads] to coexist with new dovecot? :)