Issue 78 - ldapmordrn loses records
Summary: ldapmordrn loses records
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: 1999-02-18 19:37 UTC by Roy Hooper
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 Roy Hooper 1999-02-18 19:37:47 UTC
Full_Name: Roy Hooper
Version: 1.2.0-RELEASE
OS: Solaris 2.6x86
URL: 
Submission from: (NULL) (209.195.94.2)


I am using OpenLDAP-1.2.0-RELEASE with the configure options:
./configure --with-threads=lwp --with-ldbm-api=db2

db2 is = 2.3.16

When I "ldapmodrdn [-r] uid=OLDUID,ou=People,o=cyberus.ca uid=NEWUID", searching
for the new or old dn or uid does not work.  The entry appears to get "lost". 
When I restart slapd, the entry can be found again.  If I use -r, the old
attribute is still there (it should have been replaced/delete).

If I perform a large search after one of these modrdn calls, the slapd will go
away.

Core was generated by `/usr/local/libexec/slapd'.
Program terminated with signal 9, Killed.

(gdb) where
#0  0xdff499a1 in __sigprocmask ()
#1  0xdff42a99 in _resetsig ()
#2  0xdff4250a in _sigon ()
#3  0xdff404a0 in _lmutex_unlock ()
#4  0xdff4492e in _thrp_kill ()
#5  0xdff447d9 in pthread_kill ()
#6  0xdfeee243 in raise ()
#7  0xdfedeeb8 in abort ()
#8  0x809daa3 in __eprintf (string=0x80a1824 "%s:%u: failed assertion `%s'\n", 
    expression=0x80a181c "cache.c", line=202, 
    filename=0x80a17f1 "!ldap_pvt_thread_rdwr_active( &e->e_rdwr )")
#9  0x80648a0 in cache_add_entry (cache=0x80ad5bc, e=0x80abfa0, state=0)
    at cache.c:202
#10 0x8067810 in id2entry (be=0x80ad0a8, id=10015, rw=0) at id2entry.c:155
#11 0x806788c in id2entry_r (be=0x80ad0a8, id=10015) at id2entry.c:165
#12 0x806aad9 in ldbm_back_search (be=0x80ad0a8, conn=0x80b5f88, op=0x80aec00, 
    base=0x80abba1 "", scope=2, deref=0, slimit=-804, tlimit=-1, 
    filter=0x8ab41b8, filterstr=0x8a46990 "(uid=A*)", attrs=0x0, attrsonly=0)
    at search.c:173
#13 0x8057247 in do_search (conn=0x80b5f88, op=0x80aec00) at search.c:149
#14 0x805694e in connection_operation (arg_v=0x8a46c68) at connection.c:74


The extra space isn't showing up.

I'm about to check if this bug exists with gdbm.

Comment 1 Kurt Zeilenga 1999-02-18 22:57:06 UTC
moved from Incoming to Software Bugs
Comment 2 Roy Hooper 1999-02-19 21:36:53 UTC
The same problem appears to exist in 1.2.0-RELEASE with the gdbm backend and
lwp threads.

Even worse, is that the first part of the modrdn is working, but the rest is
failing.

> ldapmodrdn -L -b o=cyberus.ca -h localhost -D 'cn=Directory
Manager,o=cyberus.ca' -w <HIDDEN>
"uid=a.gregor,ou=Users,ou=People,o=cyberus.ca" "uid=NEW-a.gregor"
[no output]
> ldapsearch -L -b o=cyberus.ca -h localhost uid=a.gregor dn
[no output]
> ldapsearch -L -b o=cyberus.ca -h localhost uid=NEW-a.gregor dn
[no output]
> ldapsearch -L -b o=cyberus.ca -h localhost uid=* dn
... many records later a coredump happens.

restart slapd:
> ldapsearch -L -b o=cyberus.ca -h localhost uid=NEW-a.gregor dn
[no output]
> ldapsearch -L -b o=cyberus.ca -h localhost uid=a.gregor dn uid
dn: uid=NEW-a.gregor, ou=Users, ou=People, o=cyberus.ca
uid: a.gregor

It seems that the indexes aren't being updated, and that the root dn
attribute isn't getting zapped as expected.  I'm going to look into the code
and see what I can find.

From the core:
root@blackbox:ldaptest2# gdb /usr/local/libexec/slapd /core
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.6"...
Core was generated by `/usr/local/libexec/slapd'.
Program terminated with signal 9, Killed.
Reading symbols from /usr/lib/libresolv.so.2...done.
Reading symbols from /usr/lib/libnsl.so.1...done.
Reading symbols from /usr/lib/libsocket.so.1...done.
Reading symbols from /usr/lib/libthread.so.1...done.
Reading symbols from /usr/lib/libc.so.1...done.
Reading symbols from /usr/lib/libdl.so.1...done.
Reading symbols from /usr/lib/libmp.so.2...done.
Reading symbols from /usr/lib/nss_files.so.1...done.
#0  0xdff499a1 in __sigprocmask ()
(gdb) where
#0  0xdff499a1 in __sigprocmask ()
#1  0xdff42a99 in _resetsig ()
#2  0xdff4250a in _sigon ()
#3  0xdff404a0 in _lmutex_unlock ()
#4  0xdff4492e in _thrp_kill ()
#5  0xdff447d9 in pthread_kill ()
#6  0xdfeee243 in raise ()
#7  0xdfedeeb8 in abort ()
#8  0x8074103 in __eprintf (string=0x8077e84 "%s:%u: failed assertion
`%s'\n",
    expression=0x8077e7c "cache.c", line=202,
    filename=0x8077e51 "!ldap_pvt_thread_rdwr_active( &e->e_rdwr )")
#9  0x805fa7c in cache_add_entry (cache=0x808105c, e=0x8849338, state=0)
    at cache.c:202
#10 0x8062840 in id2entry (be=0x8080b48, id=10000, rw=0) at id2entry.c:155
#11 0x80628bc in id2entry_r (be=0x8080b48, id=10000) at id2entry.c:165
#12 0x80658bd in ldbm_back_search (be=0x8080b48, conn=0x8089da8,
op=0x807fc88,
    base=0x884a209 "", scope=2, deref=0, slimit=-9987, tlimit=-1,
    filter=0x884b2b8, filterstr=0x884d018 "(uid=*)", attrs=0x8849ac8,
    attrsonly=0) at search.c:173
#13 0x8052423 in do_search (conn=0x8089da8, op=0x807fc88) at search.c:149
#14 0x8051b2a in connection_operation (arg_v=0x884b910) at connection.c:74
#15 0xdff3da9e in L1 ()
#16 0x2710 in ?? ()
---Type <return> to continue, or q <return> to quit---
#17 0x0 in ?? ()


I started slapd with -d 1 and found an even more interesting result...

root@blackbox:ldaptest2# ldapmodrdn -r -D "cn=Directory
Manager,o=cyberus.ca" -w HIDDEN -h localhost
uid=a.gregor,ou=Users,ou=People,o=cyberus.ca uid=NEW-a.gregor

root@blackbox:ldaptest2# ldapsearch -L -b o=cyberus.ca -D "cn=Directory
Manager,o=cyberus.ca" -w HIDDEN -h localhost uid=NEW-a.gregor

root@blackbox:ldaptest2# ldapsearch -L -b o=cyberus.ca -D "cn=Directory
Manager,o=cyberus.ca" -w HIDDEN -h localhost uid=a.gregor
dn: cn=Directory Manager, o=cyberus.ca
objectclass: top
objectclass: account
objectclass: posixAccount
objectclass: shadowAccount
objectclass: cyberusAccount
objectclass: mailRecipient
objectclass: person
objectclass: organizationalperson
objectclass: inetOrgPerson
uid: a.gregor
uidnumber: 24754
gidnumber: 104
homedirectory: /home2/users/a/a.gregor
loginshell: /usr/local/bin/netsh
gecos: Alena Gregor
userpassword: {crypt}HIDDEN
cn: Alena Gregor
cn: Gregor
cn: a.gregor
sn: Gregor
mail: a.gregor@cyberus.ca
givenname: Alena
cleartextpassword: HIDDEN
md5password: HIDDEN
shadowlastchange: 6445
creatorsname: cn=Directory Manager
modifiersname: cn=Directory Manager
createtimestamp: 19990127192735Z
modifytimestamp: 19990127192735Z


root@blackbox:secure# /usr/local/libexec/slapd -d 1
slapd 1.2.0-Release (Thu Feb 18 15:08:42 EST 1999)
        root@blackbox:/usr/local/src/openldap-1.2.0/servers/slapd
slapd starting
do_bind
do_bind: version 2 dn (cn=Directory Manager,o=cyberus.ca) method 128
dn2entry_r: dn: "CN=DIRECTORY MANAGER,O=CYBERUS.CA"
=> dn2id( "CN=DIRECTORY MANAGER,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (opened 0)
<= dn2id NOID
dn2entry_r: dn: "O=CYBERUS.CA"
=> dn2id( "O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id 1
=> id2entry_r( 1 )
=> ldbm_cache_open( "/raid1/ldap/id2entry.gdbm", 2, 600 )
<= ldbm_cache_open (opened 1)
=> str2entry
<= str2entry 0x8082848
<= id2entry_r( 1 ) (disk)
====> cache_return_entry_r
do_bind: bound "cn=Directory Manager,o=cyberus.ca" to "cn=Directory Manager,
o=cyberus.ca"
send_ldap_result 0::
do_modrdn
dn2entry_w: dn: "UID=A.GREGOR,OU=USERS,OU=PEOPLE,O=CYBERUS.CA"
=> dn2id( "UID=A.GREGOR,OU=USERS,OU=PEOPLE,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id 19169
=> id2entry_w( 19169 )
=> ldbm_cache_open( "/raid1/ldap/id2entry.gdbm", 2, 600 )
<= ldbm_cache_open (cache 1)
=> str2entry
<= str2entry 0x80826a0
<= id2entry_w( 19169 ) (disk)
dn2entry_w: dn: "OU=USERS,OU=PEOPLE,O=CYBERUS.CA"
=> dn2id( "OU=USERS,OU=PEOPLE,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id 10
=> id2entry_w( 10 )
=> ldbm_cache_open( "/raid1/ldap/id2entry.gdbm", 2, 600 )
<= ldbm_cache_open (cache 1)
=> str2entry
<= str2entry 0x846c298
<= id2entry_w( 10 ) (disk)
=> dn2id( "UID=NEW-A.GREGOR,OU=USERS,OU=PEOPLE,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
=> dn2id_add( "UID=NEW-A.GREGOR,OU=USERS,OU=PEOPLE,O=CYBERUS.CA", 19169 )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id_add 0
=> dn2id_delete( "UID=A.GREGOR,OU=USERS,OU=PEOPLE,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id_delete 0
====> cache_delete_entry:
=> id2entry_add( 19169, "uid=NEW-a.gregor, ou=Users, ou=People,
o=cyberus.ca" )
=> ldbm_cache_open( "/raid1/ldap/id2entry.gdbm", 2, 600 )
<= ldbm_cache_open (cache 1)
<= id2entry_add 0
send_ldap_result 0::
====> cache_return_entry_w
====> cache_return_entry_w
do_unbind
ber_get_next on fd 5 failed errno 0 (Error 0)
*** got 0 of 0 so far
do_bind
do_bind: version 2 dn (cn=Directory Manager,o=cyberus.ca) method 128
dn2entry_r: dn: "CN=DIRECTORY MANAGER,O=CYBERUS.CA"
=> dn2id( "CN=DIRECTORY MANAGER,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
dn2entry_r: dn: "O=CYBERUS.CA"
=> dn2id( "O=CYBERUS.CA" )
====> cache_find_entry_dn2id: found dn: O=CYBERUS.CA
<= dn2id 1 (in cache)
=> id2entry_r( 1 )
====> cache_find_entry_dn2id: found id: 1 rw: 0
<= id2entry_r 0x8082848 (cache)
====> cache_return_entry_r
do_bind: bound "cn=Directory Manager,o=cyberus.ca" to "cn=Directory Manager,
o=cyberus.ca"
send_ldap_result 0::
do_search
using base "O=CYBERUS.CA"
subtree_candidates: base: "O=CYBERUS.CA" lookupbase
dn2entry_r: dn: "O=CYBERUS.CA"
=> dn2id( "O=CYBERUS.CA" )
====> cache_find_entry_dn2id: found dn: O=CYBERUS.CA
<= dn2id 1 (in cache)
=> id2entry_r( 1 )
====> cache_find_entry_dn2id: found id: 1 rw: 0
<= id2entry_r 0x8082848 (cache)
====> cache_return_entry_r
=> filter_candidates
=> list_candidates 0xa1
=> filter_candidates
=> ava_candidates 0xa3
=> index_read( "objectclass" "=" "REFERRAL" )
=> ldbm_cache_open( "/raid1/ldap/objectclass.gdbm", 2, 600 )
<= ldbm_cache_open (opened 2)
<= index_read 0 candidates
<= ava_candidates 0
<= filter_candidates 0
=> filter_candidates
=> ava_candidates 0xa3
=> index_read( "uid" "=" "NEW-A.GREGOR" )
=> ldbm_cache_open( "/raid1/ldap/uid.gdbm", 2, 600 )
<= ldbm_cache_open (opened 3)
<= index_read 0 candidates
<= ava_candidates 0
<= filter_candidates 0
<= list_candidates 0
<= filter_candidates 0
send_ldap_result 0::
do_unbind
do_bind
do_bind: version 2 dn (cn=Directory Manager,o=cyberus.ca) method 128
dn2entry_r: dn: "CN=DIRECTORY MANAGER,O=CYBERUS.CA"
=> dn2id( "CN=DIRECTORY MANAGER,O=CYBERUS.CA" )
=> ldbm_cache_open( "/raid1/ldap/dn2id.gdbm", 2, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
dn2entry_r: dn: "O=CYBERUS.CA"
=> dn2id( "O=CYBERUS.CA" )
====> cache_find_entry_dn2id: found dn: O=CYBERUS.CA
<= dn2id 1 (in cache)
=> id2entry_r( 1 )
====> cache_find_entry_dn2id: found id: 1 rw: 0
<= id2entry_r 0x8082848 (cache)
====> cache_return_entry_r
do_bind: bound "cn=Directory Manager,o=cyberus.ca" to "cn=Directory Manager,
o=cyberus.ca"
send_ldap_result 0::
do_search
using base "O=CYBERUS.CA"
subtree_candidates: base: "O=CYBERUS.CA" lookupbase
dn2entry_r: dn: "O=CYBERUS.CA"
=> dn2id( "O=CYBERUS.CA" )
====> cache_find_entry_dn2id: found dn: O=CYBERUS.CA
<= dn2id 1 (in cache)
=> id2entry_r( 1 )
====> cache_find_entry_dn2id: found id: 1 rw: 0
<= id2entry_r 0x8082848 (cache)
====> cache_return_entry_r
=> filter_candidates
=> list_candidates 0xa1
=> filter_candidates
=> ava_candidates 0xa3
=> index_read( "objectclass" "=" "REFERRAL" )
=> ldbm_cache_open( "/raid1/ldap/objectclass.gdbm", 2, 600 )
<= ldbm_cache_open (cache 2)
<= index_read 0 candidates
<= ava_candidates 0
<= filter_candidates 0
=> filter_candidates
=> ava_candidates 0xa3
=> index_read( "uid" "=" "A.GREGOR" )
=> ldbm_cache_open( "/raid1/ldap/uid.gdbm", 2, 600 )
<= ldbm_cache_open (cache 3)
<= index_read 2 candidates
<= ava_candidates 2
<= filter_candidates 2
<= list_candidates 2
<= filter_candidates 2
=> id2entry_r( 15 )
=> ldbm_cache_open( "/raid1/ldap/id2entry.gdbm", 2, 600 )
<= ldbm_cache_open (cache 1)
<= id2entry_r( 15 ) not found
=> id2entry_r( 19169 )
====> cache_find_entry_dn2id: found id: 19169 rw: 0
<= id2entry_r 0x80826a0 (cache)
=> send_search_entry (cn=Directory Manager, o=cyberus.ca)
<= send_search_entry
====> cache_return_entry_r
send_ldap_result 0::
do_unbind
^Cslapd got shutdown signal 2
slapd got do_nothing signal 16
slapd shutting down - waiting for 0 threads to terminate
slapd shutting down - waiting for backends to close down
ldbm backend saving nextid
ldbm backend syncing
ldbm flushing db (/raid1/ldap/dn2id.gdbm)
ldbm flushing db (/raid1/ldap/id2entry.gdbm)
ldbm flushing db (/raid1/ldap/objectclass.gdbm)
ldbm flushing db (/raid1/ldap/uid.gdbm)
ldbm backend done syncing
slapd stopping



--
Roy Hooper
Sr. Systems Administrator
Cyberus Online Inc.
(613) 233-0068


Comment 3 Kurt Zeilenga 1999-03-03 22:34:04 UTC
changed notes
Comment 4 Kurt Zeilenga 1999-03-03 22:34:55 UTC
changed notes
Comment 5 gomez@openldap.org 1999-03-24 18:24:22 UTC
changed notes
changed state Open to Test
Comment 6 gomez@openldap.org 1999-03-24 18:34:31 UTC
changed notes
Comment 7 Kurt Zeilenga 1999-03-26 21:23:54 UTC
changed notes
Comment 8 gomez@openldap.org 1999-04-06 21:09:25 UTC
changed notes
changed state Test to Closed
Comment 9 OpenLDAP project 2014-08-01 21:06:51 UTC
gomez to look at this issue. Changes have been made to solve this problem,
futher testing is needed before we close this ITS.