Issue 707 - make test fails with Segmentation fault on Linux
Summary: make test fails with Segmentation fault on Linux
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: 2000-09-04 07:26 UTC by bonnaud@iut2.upmf-grenoble.fr
Modified: 2014-08-01 21:06 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 bonnaud@iut2.upmf-grenoble.fr 2000-09-04 07:26:07 UTC
Full_Name: Laurent Bonnaud
Version: 2.0.0
OS: Debian GNU/Linux 2.2
URL: 
Submission from: (NULL) (193.55.51.153)


>make test fails on my Debian GNU/Linux 2.2 system (see the crash
>below).  Here is how I configured and built openldap (without any
>problem):
>
>./configure --enable-spasswd --enable-wrappers 
>make depend
>make
>make install
>
>And here are all necessary packages:
>
>ii  libwrap0             7.6-4                Wietse Venema's TCP wrappers
library
>ii  libwrap0-dev         7.6-4                Wietse Venema's TCP wrappers
library, development files
>ii  libssl09             0.9.4-5              SSL shared libraries
>ii  libssl09-dev         0.9.4-5              SSL development libraries
>ii  libsasl-bin          1.5.21-1             Development files for
authentication abstraction library
>ii  libsasl-dev          1.5.21-1             Development files for
authentication abstraction library
>ii  libsasl-modules      1.5.21-1             Pluggable Authentication Modules
for SASL
>ii  libsasl7             1.5.21-1             Authentication abstraction
library.
>
>slapd is linked with the libdb shared libraries from libc6/glibc2
>whereas the system has a large choice of libraries:
>
>ii  libdb2                 2.4.14-2.7.7.1.c       The Berkeley database
routines (run-time files).
>ii  libdb2-dev             2.4.14-2.7.7.1.c       The Berkeley database
routines (development files).
>ii  libdb2-util            2.4.14-2.7.7.1.c       The Berkeley database
routines (development files).
>ii  libgdbmg1              1.7.3-26.2             GNU dbm database routines
(runtime version). [libc6 version]
>ii  libgdbmg1-dev          1.7.3-26.2             GNU dbm database routines
(development files) [libc6 version

>$ make test
>cd tests; make test
>make[1]: Entering directory `/home/laurent/openldap-2.0.0/tests'
>ln: ./data: cannot overwrite directory
>make[1]: [test-ldbm] Error 1 (ignored)
>Initiating LDAP tests for LDBM...
>>>>>> Executing all LDAP tests...
>>>>>> Test Directory: .
>>>>>> Backend: ldbm
>>>>>> Starting test001-slapadd ...
>running defines.sh . ldbm
>Datadir is ./data
>Cleaning up in ./test-db...
>Running slapadd to build slapd database...
>Starting slapd on TCP/IP port 9009...
>Using ldapsearch to retrieve all the entries...
>./scripts/test001-slapadd: line 43: 21718 Segmentation fault      $LDAPSEARCH
-S "" -b "$BASEDN" -h localhost:$PORT >$SEARCHOUT 2>&1
>./scripts/test001-slapadd: line 43: 21719 Segmentation fault      $LDAPSEARCH
-S "" -b "$BASEDN" -h localhost:$PORT >$SEARCHOUT 2>&1
>./scripts/test001-slapadd: line 43: 21720 Segmentation fault      $LDAPSEARCH
-S "" -b "$BASEDN" -h localhost:$PORT >$SEARCHOUT 2>&1
>./scripts/test001-slapadd: line 43: 21721 Segmentation fault      $LDAPSEARCH
-S "" -b "$BASEDN" -h localhost:$PORT >$SEARCHOUT 2>&1
>./scripts/test001-slapadd: line 43: 21722 Segmentation fault      $LDAPSEARCH
-S "" -b "$BASEDN" -h localhost:$PORT >$SEARCHOUT 2>&1
>./scripts/test001-slapadd: line 43: 21723 Segmentation fault      $LDAPSEARCH
-S "" -b "$BASEDN" -h localhost:$PORT >$SEARCHOUT 2>&1
>./scripts/test001-slapadd: kill: (21717) - No such pid
>ldapsearch failed (139)!
>>>>>> ./scripts/test001-slapadd failed (exit 139)
>make[1]: *** [test-ldbm] Error 139
>make[1]: Leaving directory `/home/laurent/openldap-2.0.0/tests'
>make: *** [test] Error 2
>
>$ ldd  /usr/local/libexec/slapd
>        libdb.so.3 => /lib/libdb.so.3 (0x40017000)
>        libsasl.so.7 => /usr/lib/libsasl.so.7 (0x40052000)
>        libssl.so.0 => /usr/lib/libssl.so.0 (0x4005d000)
>        libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0x4008a000)
>        libcrypt.so.1 => /lib/libcrypt.so.1 (0x40135000)
>        libnsl.so.1 => /lib/libnsl.so.1 (0x40162000)
>        libwrap.so.0 => /lib/libwrap.so.0 (0x40178000)
>        libpthread.so.0 => /lib/libpthread.so.0 (0x4017f000)
>        libc.so.6 => /lib/libc.so.6 (0x40192000)
>        libdl.so.2 => /lib/libdl.so.2 (0x4026f000)
>        libpam.so.0 => /lib/libpam.so.0 (0x40274000)
>        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)


Core was generated by `../clients/tools/ldapsearch -P 3 -x -LLL -S  -b
o=University of Michigan, c=US'.
Program terminated with signal 11, Segmentation fault.
#0  0x401e6183 in ?? ()
(gdb) bt
#0  0x401e6183 in ?? ()
#1  0x401e6145 in ?? ()
#2  0x80584a1 in ldap_utf8_strspn (str=0x8095230 "\030U\t\b\002", set=0x8095518
"\003") at utf-8.c:402
#3  0x804ee9c in sb_sasl_setup (sbiod=0x8095230, arg=0x80959a8) at cyrus.c:95
#4  0x8056b73 in ldap_pvt_tls_init_def_ctx () at tls.c:202
#5  0x804eb0c in ldap_int_get_controls (ber=0x8095230, ctrls=0x1) at
controls.c:194
#6  0x8056872 in ldap_charray2str (a=0x8095230, sep=0x60 <Address 0x60 out of
bounds>) at charray.c:232
#7  0x8054b25 in ldap_url_list2hosts (ludlist=0x8095230) at url.c:749
#8  0x8054bb2 in ldap_url_list2hosts (ludlist=0x8095230) at url.c:761
#9  0x805516a in openldap_ldap_init_w_conf (file=0x8095230 "\030U\t\b\002",
userconf=0) at init.c:167
#10 0x804eadf in ldap_int_get_controls (ber=0x8095230, ctrls=0x0) at
controls.c:186
#11 0x804c18f in process_ldif_rec (rbuf=0x0, count=-1073742796) at
/usr/include/stdlib.h:311
#12 0x40155a52 in ?? ()

Comment 1 Kurt Zeilenga 2000-09-04 16:06:22 UTC
At 07:26 AM 9/4/00 +0000, bonnaud@iut2.upmf-grenoble.fr wrote:
>Core was generated by `../clients/tools/ldapsearch -P 3 -x -LLL -S  -b
>o=University of Michigan, c=US'.
>Program terminated with signal 11, Segmentation fault.
>#0  0x401e6183 in ?? ()
>(gdb) bt
>#0  0x401e6183 in ?? ()
>#1  0x401e6145 in ?? ()
>#2  0x80584a1 in ldap_utf8_strspn (str=0x8095230 "\030U\t\b\002", set=0x8095518
>"\003") at utf-8.c:402
>#3  0x804ee9c in sb_sasl_setup (sbiod=0x8095230, arg=0x80959a8) at cyrus.c:95
>#4  0x8056b73 in ldap_pvt_tls_init_def_ctx () at tls.c:202
>#5  0x804eb0c in ldap_int_get_controls (ber=0x8095230, ctrls=0x1) at
>controls.c:194
>#6  0x8056872 in ldap_charray2str (a=0x8095230, sep=0x60 <Address 0x60 out of
>bounds>) at charray.c:232
>#7  0x8054b25 in ldap_url_list2hosts (ludlist=0x8095230) at url.c:749
>#8  0x8054bb2 in ldap_url_list2hosts (ludlist=0x8095230) at url.c:761
>#9  0x805516a in openldap_ldap_init_w_conf (file=0x8095230 "\030U\t\b\002",
>userconf=0) at init.c:167
>#10 0x804eadf in ldap_int_get_controls (ber=0x8095230, ctrls=0x0) at
>controls.c:186
>#11 0x804c18f in process_ldif_rec (rbuf=0x0, count=-1073742796) at
>/usr/include/stdlib.h:311
>#12 0x40155a52 in ?? ()

Looks like your stack is trashed as this back trace makes little
sense.  I suggest:
  make clean; make depend; make

Kurt


Comment 2 Ben Collins 2000-09-04 16:06:33 UTC
On Mon, Sep 04, 2000 at 07:26:08AM +0000, bonnaud@iut2.upmf-grenoble.fr wrote:
> Full_Name: Laurent Bonnaud
> Version: 2.0.0
> OS: Debian GNU/Linux 2.2
> URL: 
> Submission from: (NULL) (193.55.51.153)

> >
> >slapd is linked with the libdb shared libraries from libc6/glibc2
> >whereas the system has a large choice of libraries:
> >

You can simply use the slapd package in woody (Debian unstable), which is
currently 2.0-gamma. It is linked against libdb2, not the glibc specific
db2 (which is old anyway, and will disappear once glibc 2.2 is in woody).

If you read the OpenLDAP2 release notes, you'll notice that it suggests db
2.7 or greater, which the db2 in glibc 2.1 is not (it's 2.4.x I think).

Ben

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`  bcollins@debian.org  --  bcollins@openldap.org  --  bcollins@linux.com  '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'
Comment 3 Laurent Bonnaud 2000-09-04 18:20:15 UTC
>>>>> "Kurt" == Kurt D Zeilenga <Kurt@OpenLDAP.org> writes:
Kurt> 
Kurt> Looks like your stack is trashed as this back trace makes little
Kurt> sense. 

Here is a better backtrace:

Core was generated by `../clients/tools/ldapsearch -P 3 -x -LLL -S  -b o=University of Michigan, c=US'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libsasl.so.7...done.
Reading symbols from /usr/lib/libssl.so.0...done.
Reading symbols from /usr/lib/libcrypto.so.0...done.
Reading symbols from /lib/libcrypt.so.1...done.
Reading symbols from /lib/libnsl.so.1...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/libdb.so.3...done.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /lib/libpam.so.0...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.2...done.
#0  0x401e6183 in inet_ntop () from /lib/libc.so.6
(gdb) bt
#0  0x401e6183 in inet_ntop () from /lib/libc.so.6
#1  0x401e6145 in inet_ntop () from /lib/libc.so.6
#2  0x8058442 in ldap_connect_to_host (ld=0x8095160, sb=0x8095448, proto=0, host=0x8095490 "localhost", 
    address=0, port=12579, async=0) at os-ip.c:337
#3  0x804ee9c in ldap_int_open_connection (ld=0x8095160, conn=0x80958d8, srv=0x80954a8, async=0)
    at open.c:271
#4  0x8056b73 in ldap_new_connection (ld=0x8095160, srvlist=0x80954a8, use_ldsb=1, connect=1, bind=0x0)
    at request.c:259
#5  0x804eb0c in ldap_open_defconn (ld=0x8095160) at open.c:29
#6  0x8056872 in ldap_send_initial_request (ld=0x8095160, msgtype=96, dn=0x8085e9e "", ber=0x80950c8)
    at request.c:91
#7  0x8054b25 in ldap_sasl_bind (ld=0x8095160, dn=0x8085e9e "", mechanism=0x0, cred=0xbfffdb14, 
    sctrls=0x0, cctrls=0x0, msgidp=0xbfffdad8) at sasl.c:146
#8  0x8054bb2 in ldap_sasl_bind_s (ld=0x8095160, dn=0x0, mechanism=0x0, cred=0xbfffdb14, sctrls=0x0, 
    cctrls=0x0, servercredp=0x0) at sasl.c:180
#9  0x805516a in ldap_simple_bind_s (ld=0x8095160, dn=0x0, passwd=0x0) at sbind.c:110
#10 0x804eadf in ldap_bind_s (ld=0x8095160, dn=0x0, passwd=0x0, authmethod=128) at bind.c:112
#11 0x804c18f in main (argc=0, argv=0xbffffc44) at ldapsearch.c:778

-- 
Laurent.
Comment 4 Kurt Zeilenga 2000-09-08 11:19:42 UTC
moved from Incoming to Software Bugs
Comment 5 Kurt Zeilenga 2000-09-15 09:56:02 UTC
changed notes
changed state Open to Feedback
Comment 6 Kurt Zeilenga 2000-10-03 17:25:59 UTC
changed notes
Comment 7 Kurt Zeilenga 2000-10-05 08:53:23 UTC
changed notes
Comment 8 Vadim Popov 2000-10-19 11:54:44 UTC
> On Mon, Sep 04, 2000 at 07:26:08AM +0000, bonnaud@iut2.upmf-grenoble.fr wrote:
> > Full_Name: Laurent Bonnaud
> > Version: 2.0.0
> > OS: Debian GNU/Linux 2.2
> > URL: 
> > Submission from: (NULL) (193.55.51.153)
> 
> > >
> > >slapd is linked with the libdb shared libraries from libc6/glibc2
> > >whereas the system has a large choice of libraries:
> > >
> 
> You can simply use the slapd package in woody (Debian unstable), which is
> currently 2.0-gamma. It is linked against libdb2, not the glibc specific
> db2 (which is old anyway, and will disappear once glibc 2.2 is in woody).
> 
> If you read the OpenLDAP2 release notes, you'll notice that it suggests db
> 2.7 or greater, which the db2 in glibc 2.1 is not (it's 2.4.x I think).

All versions of openldap 2 series are working fine with db distributed
in Debian.

> 
> Ben

I replicate same results on Debian 2.2 and the problem was in incorrect
dealing
with IPv6 (the first try to correct is in ITS #716). Configure
automaticaly finds
installed headers for IPv6 and enables HAVE_IP6 and HAVE_GETADDRINFO,
but getaddrinfo
dosn't work well in Debian. I correct generated .h files (undefine ip6
related things)
and problem disappear.
The main symptoms of this problem:
1. make test failed with Segmentation fault in ldapsearch
2. slapd -d 65535 failed to start with socket creation error


-- 
--------------------------
Vadim A. Popov
IATP2/Belarus System Administrator
IILSR Networks Development Coordinator
tel: +375-(17)-2233174
e-mail: vap@iatp.unibel.by
ICQ: 89569789
Comment 9 Kurt Zeilenga 2001-06-07 05:16:45 UTC
changed notes
changed state Feedback to Closed
Comment 10 Kurt Zeilenga 2002-06-18 20:31:47 UTC
moved from Software Bugs to Archive.Software Bugs
Comment 11 OpenLDAP project 2014-08-01 21:06:54 UTC
fixed in 2.0.?