Issue 7141 - Segmentation fault during stopping slapd
Summary: Segmentation fault during stopping slapd
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-28 15:10 UTC by Michael Ströder
Modified: 2014-08-01 21:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Michael Ströder 2012-01-28 15:10:24 UTC
Full_Name: 
Version: RE24 git a9b2c4fd2457fb502e9a2d47307e72ab2ec4b59d
OS: openSUSE 11.4 x86_64
URL: 
Submission from: (NULL) (84.163.33.76)


slapd was started with:

-h "ldap://0.0.0.0:53123 ldapi://%2Ftmp%2Fopenldap-e2-infra-testbed"

I can reproduce this always in a test bed but currently with a confidential
customer configuration. Please request more information if really needed and I
will try to provide a test config without confidential information.

Core was generated by `/opt/openldap-RE24/libexec/slapd -d config,stats -h
ldap://0.0.0.0:53123 ldapi:'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fc684f37cfb in ldap_free_urllist (ludlist=0x100000000) at url.c:1515
1515			next = ludp->lud_next;
(gdb) info threads
* 1 Thread 20121  0x00007fc684f37cfb in ldap_free_urllist (ludlist=0x100000000)
at url.c:1515
(gdb) thread 1
[Switching to thread 1 (Thread 20121)]#0  0x00007fc684f37cfb in
ldap_free_urllist (ludlist=0x100000000) at url.c:1515
1515			next = ludp->lud_next;
(gdb) bt full
#0  0x00007fc684f37cfb in ldap_free_urllist (ludlist=0x100000000) at url.c:1515
        ludp = 0x100000000
        next = 0x7fc67d751040
#1  0x00007fc67d5329a3 in ?? () from /usr/lib64/libldap_r-2.4.so.2
No symbol table info available.
#2  0x00007fc67d515b1f in ?? () from /usr/lib64/libldap_r-2.4.so.2
No symbol table info available.
#3  0x00007fff849df338 in ?? ()
No symbol table info available.
#4  0x0000000000000000 in ?? ()
No symbol table info available.
(gdb) frame 0
#0  0x00007fc684f37cfb in ldap_free_urllist (ludlist=0x100000000) at url.c:1515
1515			next = ludp->lud_next;
(gdb) info locals
ludp = 0x100000000
next = 0x7fc67d751040
Comment 1 Hallvard Furuseth 2012-01-28 15:33:57 UTC
 On Sat, 28 Jan 2012 15:10:24 GMT, michael@stroeder.com wrote:
> Core was generated by `/opt/openldap-RE24/libexec/slapd (...)
> (...)
> #1  0x00007fc67d5329a3 in ?? () from /usr/lib64/libldap_r-2.4.so.2

 Looks like slapd is linked to the wrong libldap_r, and you need
 to configure with something like

 $ pr=/opt/openldap-RE24
 $ ./configure --prefix=$pr LDFLAGS="-L$pr/lib -Wl,-rpath,$pr/lib"

-- 
 Hallvard

Comment 2 Michael Ströder 2012-01-28 16:20:10 UTC
Hallvard B Furuseth wrote:
> On Sat, 28 Jan 2012 15:10:24 GMT, michael@stroeder.com wrote:
>> Core was generated by `/opt/openldap-RE24/libexec/slapd (...)
>> (...)
>> #1 0x00007fc67d5329a3 in ?? () from /usr/lib64/libldap_r-2.4.so.2
>
> Looks like slapd is linked to the wrong libldap_r, and you need
> to configure with something like
>
> $ pr=/opt/openldap-RE24
> $ ./configure --prefix=$pr LDFLAGS="-L$pr/lib -Wl,-rpath,$pr/lib"

Uumpf! I forgot to update my local version of

contrib/slapd-modules/smbk5pwd/Makefile

after pulling from git. This Makefile does not use prefix and LDFLAGS used 
with ./configure before.

Please close this ITS.

Ciao, Michael.

Comment 3 Michael Ströder 2012-01-28 16:51:26 UTC
michael@stroeder.com wrote:
> Uumpf! I forgot to update my local version of
>
> contrib/slapd-modules/smbk5pwd/Makefile
>
> after pulling from git. This Makefile does not use prefix and LDFLAGS used
> with ./configure before.

Hmm, it seems I get better result linking smbk5pwd with
contrib/slapd-modules/smbk5pwd/Makefile containing:

LDAP_LIB=-lldap_r -llber -L../../../libraries/libldap_r/.libs 
-L../../../libraries/liblber/.libs

instead of just

LDAP_LIB=-lldap_r -llber

Is that the right solution when rpath is already set when invoking configure?

Ciao, Michael.

Comment 4 Hallvard Furuseth 2012-01-28 17:23:23 UTC
 On Sat, 28 Jan 2012 16:52:05 GMT, michael@stroeder.com wrote:
> Hmm, it seems I get better result linking smbk5pwd with
> contrib/slapd-modules/smbk5pwd/Makefile containing:
>
> LDAP_LIB=-lldap_r -llber -L../../../libraries/libldap_r/.libs
> -L../../../libraries/liblber/.libs
>
> instead of just
>
> LDAP_LIB=-lldap_r -llber
>
> Is that the right solution when rpath is already set when invoking 
> configure?

 If you build *and install* the rest of OpenLDAP first and then build
 smbk5pwd, I imagine it'll work fine if -L and -rpath are the same.
 Otherwise you should point -L at where all the 
 libraries-to-be-installed
 are, which with a dynamic build is the .lib/ directories.

 After all -L is for build time and -rpath for runtime, and they should
 be set so that you build against the same libraries you will run with.
 At least I hope that's all.  I wouldn't be surprised if some libtool
 magic introduces more complications:-(

-- 
 Hallvard

Comment 5 Hallvard Furuseth 2012-01-28 19:52:05 UTC
changed notes
changed state Open to Closed
Comment 6 OpenLDAP project 2014-08-01 21:03:51 UTC
user error