Full_Name: Heiko W.Rupp Version: 1.1.2 (-release) OS: NetBSd 1.3.2 URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (193.141.42.125) Slapd crashes => dn2id( "o=Xlink GmbH,c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id 1 => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 <= id2entry_r 0x2e480 (cache) <= matched o=Xlink GmbH,c=DE <= remainder cn=Heiko, <= checking for alias for dn o=Xlink GmbH, c=DE <= l&g we have o=Xlink GmbH,c=DE vs o=Xlink GmbH, c=DE ====> cache_return_entry_r <= expanded to cn=Heiko,o=Xlink GmbH, c=DE ====> cache_return_entry_r dn2entry_r: dn: cn=Heiko,o=Xlink GmbH, c=DE => dn2id( "cn=Heiko,o=Xlink GmbH, c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id NOID dn2entry_r: dn: o=Xlink GmbH, c=DE => dn2id( "o=Xlink GmbH, c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id 1 => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 <= id2entry_r 0x2e480 (cache) ====> cache_return_entry_r dn2entry_r: dn: o=Xlink GmbH, c=DE => dn2id( "o=Xlink GmbH, c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id 1 => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 <= id2entry_r 0x2e480 (cache) <= matched o=Xlink GmbH, c=DE <= remainder cn=Heiko, <= checking for alias for dn o=Xlink GmbH, c=DE <= l&g we have o=Xlink GmbH, c=DE vs o=Xlink GmbH, c=DE ====> cache_return_entry_rshanagary# gdb /usr/local/libexec/slapd /slapd.core ====> cache_return_entry_r dn2entry_r: dn: (null)#0 0x40080d81 in strdup () (gdb) bt #0 0x40080d81 in strdup () #1 0xbe85 in ch_strdup (string=0x0) at ch_malloc.c:72 #2 0x1762b in dn2id (be=0x2a800, dn=0x2e498 "") at dn2id.c:72 #3 0x17a6f in dn2entry (be=0x2a800, dn=0x0, matched=0xefbfd46c, rw=0) at dn2id.c:171 #4 0x17b03 in dn2entry_r (be=0x2a800, dn=0x0, matched=0xefbfd46c) at dn2id.c:207 #5 0x1d697 in derefDN (be=0x2a800, conn=0x2b2e4, op=0x2e3c0, dn=0x399a0 "cn=Heiko,o=Xlink GmbH,c=DE") at alias.c:212 #6 0x1c3e2 in ldbm_back_search (be=0x2a800, conn=0x2b2e4, op=0x2e3c0, base=0x399a0 "cn=Heiko,o=Xlink GmbH,c=DE", scope=0, deref=2, slimit=500, tlimit=3600, filter=0x39980, filterstr=0x39a00 "(objectclass=*)", attrs=0x0, attrsonly=0) at search.c:82 #7 0x4239 in do_search (conn=0x2b2e4, op=0x2e3c0) at search.c:169 #8 0x3792 in connection_operation (arg_v=0x37a80) at connection.c:74 #9 0x1faeb in pthread_create (tid=0x2e3ec, attr=0xefbfd598, func=0x35ec <connection_operation>, arg=0x37a80) at thread.c:522 #10 0x3c94 in connection_activity (conn=0x2b2e4) at connection.c:201 #11 0x333f in slapd_daemon (port=0x185) at daemon.c:362 #12 0x1faeb in pthread_create (tid=0x27fd4, attr=0x0, func=0x23a0 <slapd_daemon>, arg=0x185) at thread.c:522 #13 0x1d67 in main (argc=1, argv=0xefbfd7c0) at main.c:182 Segmentation fault (core dumped)(gdb) up #1 0xbe85 in ch_strdup (string=0x0) at ch_malloc.c:72 72 if ( (new = strdup( string )) == NULL ) { (gdb) up #2 0x1762b in dn2id (be=0x2a800, dn=0x2e498 "") at dn2id.c:72 72 dn = ch_strdup( dn ); (gdb) up #3 0x17a6f in dn2entry (be=0x2a800, dn=0x0, matched=0xefbfd46c, rw=0) at dn2id.c:171 171 if ( (id = dn2id( be, dn )) != NOID && (gdb) up #4 0x17b03 in dn2entry_r (be=0x2a800, dn=0x0, matched=0xefbfd46c) at dn2id.c:207 207 return( dn2entry( be, dn, matched, 0 ) ); (gdb) up #5 0x1d697 in derefDN (be=0x2a800, conn=0x2b2e4, op=0x2e3c0, dn=0x399a0 "cn=Heiko,o=Xlink GmbH,c=DE") at alias.c:212 212 if ( (eNew = dn2entry_r( be, newDN, &matched )) != NULL) { This is provoked using web500gw
changed notes
changed notes moved from Incoming to Software
moved from Software to Software Bugs
changed state Open to Feedback
I've committed changes to OPENLDAP_REL_ENG_1_1 branch that may have an impact on this issue. The version is only available via AnonCVS. Would appreciate any testing you might be able to accomplish.
changed notes changed state Feedback to Test
On Thu, Jan 14, 1999 at 08:39:54PM +0000, Kurt Zeilenga wrote: > via AnonCVS. Would appreciate any testing you might be able to > accomplish. This does not help: (gdb) r -d 769 Starting program: /home/hwr/src/openldap-rel-eng/ldap/servers/slapd/slapd -d 769 slapd 1.1.3-Release (Fri Jan 15 12:29:47 MET 1999) hwr@shanagary:/home/hwr/src/openldap-rel-eng/ldap/servers/slapd slapd starting conn=0 fd=8 connection from localhost (127.0.0.1) accepted. do_bind conn=0 op=0 BIND dn="cn=Heiko Rupp,o=Xlink GmbH,c=DE" method=128 do_bind: version 2 dn (cn=Heiko Rupp,o=Xlink GmbH,c=DE) method 128 dn2entry_r: dn: cn=Heiko Rupp,o=Xlink GmbH,c=DE => dn2id( "cn=Heiko Rupp,o=Xlink GmbH,c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (opened 0) <= dn2id NOID dn2entry_r: dn: o=Xlink GmbH,c=DE => dn2id( "o=Xlink GmbH,c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id 1 => id2entry_r( 1 ) => ldbm_cache_open( "/var/db/ldap/id2entry.dbb", 514, 600 ) <= ldbm_cache_open (opened 1) => str2entry <= str2entry 0x2e540 <= id2entry_r( 1 ) (disk) ====> cache_return_entry_r send_ldap_result 0:: conn=0 op=0 RESULT err=0 tag=97 nentries=0 ber_get_next on fd 8 failed errno 35 (Resource temporarily unavailable) *** got 98 of 120 so far do_search conn=0 op=1 SRCH base="" scope=1 filter="(!(objectclass=DSA))" <= dereferencing dn dn2entry_r: dn: => dn2id( "" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id NOID ====> cache_return_entry_r Program received signal SIGSEGV, Segmentation fault. 0x200ac in pthread_rdwr_runlock_np (rdwrp=0x14) at rdwr.c:49 49 if (rdwrp->readers_reading == 0) { (gdb) bt #0 0x200ac in pthread_rdwr_runlock_np (rdwrp=0x14) at rdwr.c:49 #1 0x70db in entry_rdwr_unlock (e=0x0, rw=0) at entry.c:271 #2 0x1399b in cache_return_entry_rw (cache=0x3a018, e=0x0, rw=0) at cache.c:79 #3 0x139bc in cache_return_entry_r (cache=0x3a018, e=0x0) at cache.c:86 #4 0x1bb5e in derefDN (be=0x2a800, conn=0x2b4a0, op=0x2e400, dn=0x333d0 "") at alias.c:207 #5 0x1a8b6 in ldbm_back_search (be=0x2a800, conn=0x2b4a0, op=0x2e400, base=0x333d0 "", scope=1, deref=2, slimit=-1, tlimit=-1, filter=0x39aa0, filterstr=0x39c00 "(!(objectclass=DSA))", attrs=0x39be0, attrsonly=0) at search.c:82 #6 0x41dd in do_search (conn=0x2b4a0, op=0x2e400) at search.c:148 #7 0x3776 in connection_operation (arg_v=0x37bb0) at connection.c:74 #8 0x201fb in pthread_create (tid=0x2e42c, attr=0xefbfd56c, func=0x35d0 <connection_operation>, arg=0x37bb0) at thread.c:534 #9 0x3c94 in connection_activity (conn=0x2b4a0) at connection.c:225 #10 0x332b in slapd_daemon (port=0x185) at daemon.c:365 #11 0x201fb in pthread_create (tid=0x27ff4, attr=0x0, func=0x238c <slapd_daemon>, arg=0x185) at thread.c:534 #12 0x1d5f in main (argc=3, argv=0xefbfd798) at main.c:139 (gdb) up #1 0x70db in entry_rdwr_unlock (e=0x0, rw=0) at entry.c:271 271 return pthread_rdwr_runlock_np(&e->e_rdwr); I did a configure --without-threads, as NetBSD mit-pthreads from ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/devel/mit-pthreads/README.html are not liked by OpenLdap's configure: setenv CPPFLAGS "-I/usr/pkg/include -I/usr/pkg/pthreads/include -D_MIT_POSIX_THREADS" setenv LDFLAGS "-L/usr/pkg/lib -L/usr/pkg/pthreads/lib" checking POSIX thread version... final checking for pthread_create in -lpthread... yes checking for sched_yield... yes checking for pthread_yield... yes checking for pthread_kill... yes checking for pthread_detach... yes checking for pthread_attr_create... no checking for pthread_attr_init... yes checking for pthread_attr_destroy... yes checking for pthread_attr_delete... no checking for pthread_attr_setdetachstate... yes checking for pthread_attr_setdetach_np... no checking for pthread_setconcurrency... no checking for thr_setconcurrency... no checking if pthread_create() works... no configure: error: pthread.h and pthread_create are not compatible (But If I understand correctly, slapd does not necessarily require threads anyway, else it should completely fail to compile). Heiko
At 12:49 PM 1/15/99 GMT, hwr@xlink.net wrote: >On Thu, Jan 14, 1999 at 08:39:54PM +0000, Kurt Zeilenga wrote: >> via AnonCVS. Would appreciate any testing you might be able to >> accomplish. > >This does not help: Are you sure it built correctly. Can you do a make veryclean before running configure? >I did a configure --without-threads, as NetBSD mit-pthreads from >ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/devel/mit-pthreads/README.html OpenLDAP should be able to detect and use mit-pthreads. However, if you ran ./configure --without-threads, threads details should not have been checked nor configured. >are not liked by OpenLdap's configure: > > setenv CPPFLAGS "-I/usr/pkg/include -I/usr/pkg/pthreads/include >-D_MIT_POSIX_THREADS" >setenv LDFLAGS "-L/usr/pkg/lib -L/usr/pkg/pthreads/lib" This looks like --with-threads to me: >checking POSIX thread version... final >checking for pthread_create in -lpthread... yes >checking for sched_yield... yes >checking for pthread_yield... yes >checking for pthread_kill... yes >checking for pthread_detach... yes >checking for pthread_attr_create... no >checking for pthread_attr_init... yes >checking for pthread_attr_destroy... yes >checking for pthread_attr_delete... no >checking for pthread_attr_setdetachstate... yes >checking for pthread_attr_setdetach_np... no >checking for pthread_setconcurrency... no >checking for thr_setconcurrency... no >checking if pthread_create() works... no >configure: error: pthread.h and pthread_create are not compatible This error implies that pthread_create() in -lpthread doesn't have the prototype suggested by pthread.h. >(But If I understand correctly, slapd does not necessarily require threads >anyway, else it should completely fail to compile). SLAPD can be compiled without threads on *most* platforms.
A fix was committed to release engineering that should resolve this problem. http://www.OpenLDAP.org/devel/cvsweb.cgi/servers/slapd/back-ldbm/search.c.diff?r1=1.7.2.11&r2=1.7.2.12 Kurt
Ok, another one: shanagary# !. ./slapd -p 39039 -d 901 slapd 1.1.3-Release (Tue Jan 19 13:07:11 MET 1999) hwr@shanagary:/home/hwr/src/openldap-rel-eng/ldap/servers/slapd ACL: access to dn=.*, O=XLINK GMBH, C=DE by dn=self by dn=.*, O=XLINK GMBH, C=DE by domain=.*xlink.net by dn=.* slapd starting conn=0 fd=5 connection from localhost (127.0.0.1) accepted. do_bind conn=0 op=0 BIND dn="cn=Heiko Rupp,o=Xlink GmbH,c=DE" method=128 do_bind: version 2 dn (cn=Heiko Rupp,o=Xlink GmbH,c=DE) method 128 ==> ldbm_back_bind: dn: cn=Heiko Rupp,o=Xlink GmbH,c=DE dn2entry_r: dn: cn=Heiko Rupp,o=Xlink GmbH,c=DE => dn2id( "cn=Heiko Rupp,o=Xlink GmbH,c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 2) <= ldbm_cache_open (opened 0) <= dn2id NOID dn2entry_r: dn: o=Xlink GmbH,c=DE => dn2id( "o=Xlink GmbH,c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id 1 => id2entry_r( 1 ) => ldbm_cache_open( "/var/db/ldap/id2entry.dbb", 514, 600 ) ldbm_cache_open (blksize 8192) (maxids 2046) (maxindirect 2) <= ldbm_cache_open (opened 1) => str2entry <= str2entry 0x36540 entry_rdwr_rlock: ID: 1 <= id2entry_r( 1 ) (disk) ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 send_ldap_result 0:: conn=0 op=0 RESULT err=0 tag=97 nentries=0 do_search SRCH "cn=Heiko Rupp,o=Xlink GmbH,c=DE" 0 2 0 0 0 filter: (objectclass=*) attrs: conn=0 op=1 SRCH base="cn=Heiko Rupp,o=Xlink GmbH,c=DE" scope=0 filter="(objectclass=*)" => ldbm_back_search <= dereferencing dn: "cn=Heiko Rupp,o=Xlink GmbH,c=DE" dn2entry_r: dn: cn=Heiko Rupp,o=Xlink GmbH,c=DE => dn2id( "cn=Heiko Rupp,o=Xlink GmbH,c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id NOID dn2entry_r: dn: o=Xlink GmbH,c=DE => dn2id( "o=Xlink GmbH,c=DE" ) ====> cache_find_entry_dn2id: found dn: O=XLINK GMBH,C=DE entry_rdwr_rlock: ID: 1 entry_rdwr_runlock: ID: 1 <= dn2id 1 (in cache) => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 entry_rdwr_rlock: ID: 1 <= id2entry_r 0x36540 (cache) ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 dn2entry_r: dn: o=Xlink GmbH,c=DE => dn2id( "o=Xlink GmbH,c=DE" ) ====> cache_find_entry_dn2id: found dn: O=XLINK GMBH,C=DE entry_rdwr_rlock: ID: 1 entry_rdwr_runlock: ID: 1 <= dn2id 1 (in cache) => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 entry_rdwr_rlock: ID: 1 <= id2entry_r 0x36540 (cache) <= matched o=Xlink GmbH,c=DE <= remainder cn=Heiko Rupp, <= checking for alias for dn o=Xlink GmbH, c=DE <= l&g we have o=Xlink GmbH,c=DE vs o=Xlink GmbH, c=DE ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 <= expanded to cn=Heiko Rupp,o=Xlink GmbH, c=DE ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 dn2entry_r: dn: cn=Heiko Rupp,o=Xlink GmbH, c=DE => dn2id( "cn=Heiko Rupp,o=Xlink GmbH, c=DE" ) => ldbm_cache_open( "/var/db/ldap/dn2id.dbb", 514, 600 ) <= ldbm_cache_open (cache 0) <= dn2id NOID dn2entry_r: dn: o=Xlink GmbH, c=DE => dn2id( "o=Xlink GmbH, c=DE" ) ====> cache_find_entry_dn2id: found dn: O=XLINK GMBH,C=DE entry_rdwr_rlock: ID: 1 entry_rdwr_runlock: ID: 1 <= dn2id 1 (in cache) => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 entry_rdwr_rlock: ID: 1 <= id2entry_r 0x36540 (cache) ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 dn2entry_r: dn: o=Xlink GmbH, c=DE => dn2id( "o=Xlink GmbH, c=DE" ) ====> cache_find_entry_dn2id: found dn: O=XLINK GMBH,C=DE entry_rdwr_rlock: ID: 1 entry_rdwr_runlock: ID: 1 <= dn2id 1 (in cache) => id2entry_r( 1 ) ====> cache_find_entry_dn2id: found id: 1 rw: 0 entry_rdwr_rlock: ID: 1 <= id2entry_r 0x36540 (cache) <= matched o=Xlink GmbH, c=DE <= remainder cn=Heiko Rupp, <= checking for alias for dn o=Xlink GmbH, c=DE <= l&g we have o=Xlink GmbH, c=DE vs o=Xlink GmbH, c=DE ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 ====> cache_return_entry_r entry_rdwr_runlock: ID: 1 dn2entry_r: dn: (null) Segmentation fault (core dumped) shanagary# gdb slapd slapd.core #0 0x40081d81 in strdup () (gdb) bt #0 0x40081d81 in strdup () #1 0xea1f in ch_strdup (string=0x0) at ch_malloc.c:72 #2 0x1b79c in dn2id (be=0x32800, dn=0x0) at dn2id.c:72 #3 0x1bcb7 in dn2entry (be=0x32800, dn=0x0, matched=0xefbfd3f8, rw=0) at dn2id.c:171 #4 0x1bda6 in dn2entry_r (be=0x32800, dn=0x0, matched=0xefbfd3f8) at dn2id.c:207 #5 0x23556 in derefDN (be=0x32800, conn=0x332e4, op=0x36400, dn=0x363c0 "cn=Heiko Rupp,o=Xlink GmbH,c=DE") at alias.c:215 #6 0x21d99 in ldbm_back_search (be=0x32800, conn=0x332e4, op=0x36400, base=0x363c0 "cn=Heiko Rupp,o=Xlink GmbH,c=DE", scope=0, deref=2, slimit=-1, tlimit=-1, filter=0x41aa0, filterstr=0x41bc0 "(objectclass=*)", attrs=0x0, attrsonly=0) at search.c:82 #7 0x4d06 in do_search (conn=0x332e4, op=0x36400) at search.c:148 #8 0x403a in connection_operation (arg_v=0x3fbb0) at connection.c:74 #9 0x2818b in pthread_create (tid=0x3642c, attr=0xefbfd528, func=0x3e30 <connection_operation>, arg=0x3fbb0) at thread.c:534 #10 0x466b in connection_activity (conn=0x332e4) at connection.c:225 #11 0x3b80 in slapd_daemon (port=0x987f) at daemon.c:365 #12 0x2818b in pthread_create (tid=0x30004, attr=0x0, func=0x24f8 <slapd_daemon>, arg=0x987f) at thread.c:534 #13 0x1dd2 in main (argc=5, argv=0xefbfd78c) at main.c:139 #5 0x23556 in derefDN (be=0x32800, conn=0x332e4, op=0x36400, dn=0x363c0 "cn=Heiko Rupp,o=Xlink GmbH,c=DE") at alias.c:215 215 if ( (eNew = dn2entry_r( be, newDN, &matched )) != NULL) { (gdb) p newDN $1 = 0x0 A poosible patch (though I think this should be solved "deeper"): diff -c alias.c,1 alias.c *** alias.c,1 Tue Jan 19 14:20:53 1999 --- alias.c Tue Jan 19 14:21:19 1999 *************** *** 212,217 **** --- 212,218 ---- * the final part of the DN might be an alias * so try to dereference it. */ + if (newDN != NULL) { if ( (eNew = dn2entry_r( be, newDN, &matched )) != NULL) { if ((eDeref = derefAlias_r( be, conn, op, eNew )) != NULL) { free (newDN); *************** *** 233,238 **** --- 234,240 ---- send_ldap_result( conn, op, LDAP_ALIAS_PROBLEM, "", "Maximum alias dereference depth exceeded for base" ); } + } if (newDN == NULL) { newDN = ch_strdup ( dn ); Heiko
changed notes changed state Test to Release
At 01:29 PM 1/19/99 GMT, hwr@xlink.net wrote: >A poosible patch (though I think this should be solved "deeper"): > >diff -c alias.c,1 alias.c >*** alias.c,1 Tue Jan 19 14:20:53 1999 >--- alias.c Tue Jan 19 14:21:19 1999 Both our dn deref'ing and suffix aliasing need work. I can see a number of problem with the present code... I'll try to take a deeper look when I get a chance. If you don't specifically need this code, you might just #ifdef the whole body of derefDN out and replace it with: return ch_strdup( dn );
Please issue a separate ITS for your additional issue. Note, you may want checkout latest changes in OPENLDAP_REL_ENG_1_1 (1.1.3 prerelease) and OPENLDAP_REL_ENG_1_2 (1.2 alpha). Kurt
changed notes changed state Release to Closed
Fix committed to -devel and rel eng. Confirmed "fixed" by originator.