ldap_rename_s(ldap, "cn=Anders Lund, o=UNINETT Sekretariat, dc=uninett, dc=no", "cn=Birger Lund", "o=UNINETT Sekretariat, dc=uninett, dc=no", 0, NULL, NULL); modrdn.c:128 (make sure parent entry exist and we can write its children) dn2entry_rw (be=0x80ce3d0, dn=0x80f9240 "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO", matched=0x0, rw=1) at dn2id.c:282 282 Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: \"%s\"\n", (gdb) next dn2entry_w: dn: "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO" 283 rw ? "w" : "r", dn, 0); (gdb) 285 if( matched != NULL ) { (gdb) 290 if ( (id = dn2id( be, dn )) != NOID && (gdb) => dn2id( "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO" ) ====> cache_find_entry_dn2id("O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO"): 1 (1 tries) <= dn2id 1 (in cache) => id2entry_w( 1 ) entry_rdwr_wtrylock: ID: 1 ====> cache_find_entry_id( 1 ) "o=UNINETT Sekretariat, dc=uninett, dc=no" (found) (1 tries) <= id2entry_w( 1 ) 0x80d87f0 (cache) ldbm_back_modrdn: wr to children of entry O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO OK ldbm_back_modrdn: parent dn= o=UNINETT Sekretariat, dc=uninett, dc=no 155 p_dn, 0, 0 ); 178 if ( newSuperior != NULL ) { (gdb) next 179 Debug( LDAP_DEBUG_TRACE, (gdb) next ldbm_back_modrdn: new parent "o=UNINETT Sekretariat, dc=uninett, dc=no" requested... 181 newSuperior, 0, 0 ); (gdb) step 183 np_dn = ch_strdup( newSuperior ); (gdb) next 184 np_ndn = ch_strdup( np_dn ); (gdb) next 185 (void) dn_normalize( np_ndn ); (gdb) next 191 if( (np = dn2entry_w( be, np_ndn, NULL )) == NULL) { (gdb) step dn2entry_rw (be=0x80ce3d0, dn=0x80f92d0 "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO", matched=0x0, rw=1) at dn2id.c:282 282 Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: \"%s\"\n", (gdb) next dn2entry_w: dn: "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO" 283 rw ? "w" : "r", dn, 0); (gdb) step 285 if( matched != NULL ) { (gdb) next 290 if ( (id = dn2id( be, dn )) != NOID && (gdb) step dn2id (be=0x80ce3d0, dn=0x80f92d0 "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO") at dn2id.c:104 104 struct ldbminfo *li = (struct ldbminfo *) be->be_private; Note that we are looking up the same id, so we eventually try to lock id 1 again. (gdb) step 109 Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 ); (gdb) next => dn2id( "O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO" ) 112 if ( (id = cache_find_entry_dn2id( be, &li->li_cache, dn )) != NOID ) { (gdb) next ====> cache_find_entry_dn2id("O=UNINETT SEKRETARIAT,DC=UNINETT,DC=NO"): 1 (1 tries) 113 Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld (in cache)\n", id, (gdb) next <= dn2id 1 (in cache) 114 0, 0 ); (gdb) step 149 return( id ); (gdb) step 150 } (gdb) step id2entry_rw (be=0x80ce3d0, id=1, rw=1) at id2entry.c:110 110 struct ldbminfo *li = (struct ldbminfo *) be->be_private; Here we are trying to lock the same id 1 again! (gdb) step 118 Debug( LDAP_DEBUG_TRACE, "=> id2entry_%s( %ld )\n", (gdb) next => id2entry_w( 1 ) 119 rw ? "w" : "r", id, 0 ); (gdb) step 121 if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) { (gdb) step cache_find_entry_id (cache=0x80d56a0, id=1, rw=1) at cache.c:526 526 int count = 0; (gdb) step 528 e.e_id = id; (gdb) step 532 ldap_pvt_thread_mutex_lock( &cache->c_mutex ); (gdb) next cache_find_entry_id (cache=0x80d56a0, id=1, rw=1) at cache.c:534 534 if ( (ep = (Entry *) avl_find( cache->c_idtree, (caddr_t) &e, cache_find_entry_id (cache=0x80d56a0, id=1, rw=1) at cache.c:540 540 count++; (gdb) step 542 assert( ep->e_private ); (gdb) next 544 ep_id = ep->e_id; (gdb) 545 state = LEI(ep)->lei_state; (gdb) 550 if ( state != CACHE_ENTRY_READY ) { (gdb) 566 if ( cache_entry_rdwr_trylock(ep, rw) == LDAP_PVT_THREAD_EBUSY ) { (gdb) step cache_entry_rdwr_trylock (e=0x80d87f0, rw=1) at cache.c:62 62 Debug( LDAP_DEBUG_ARGS, "entry_rdwr_%strylock: ID: %ld\n", (gdb) next entry_rdwr_wtrylock: ID: 1 63 rw ? "w" : "r", e->e_id, 0); (gdb) step 65 if (rw) (gdb) step 66 return ldap_pvt_thread_rdwr_wtrylock(&LEI(e)->lei_rdwr); (gdb) step ldap_pvt_thread_rdwr_wtrylock (rwlock=0x80f90e0) at rdwr.c:260 260 assert( rwlock != NULL ); (gdb) next 261 rw = *rwlock; (gdb) step 263 assert( rw != NULL ); (gdb) next 264 assert( rw->ltrw_valid == LDAP_PVT_THREAD_RDWR_VALID ); (gdb) next 269 ldap_pvt_thread_mutex_lock( &rw->ltrw_mutex ); (gdb) next ldap_pvt_thread_rdwr_wtrylock (rwlock=0x80f90e0) at rdwr.c:271 271 assert( rw->ltrw_w_active >= 0 ); (gdb) next 272 assert( rw->ltrw_w_wait >= 0 ); (gdb) next 273 assert( rw->ltrw_r_active >= 0 ); (gdb) next 274 assert( rw->ltrw_r_wait >= 0 ); (gdb) next 276 if ( rw->ltrw_w_active > 0 || rw->ltrw_r_active > 0 ) { (gdb) next 277 ldap_pvt_thread_mutex_unlock( &rw->ltrw_mutex ); (gdb) next 278 return LDAP_PVT_THREAD_EBUSY; (gdb) step 286 } (gdb) step cache_entry_rdwr_trylock (e=0x80d87f0, rw=1) at cache.c:69 69 } (gdb) step cache_find_entry_id (cache=0x80d56a0, id=1, rw=1) at cache.c:573 573 ldap_pvt_thread_mutex_unlock( &cache->c_mutex ); (gdb) next 575 Debug(LDAP_DEBUG_TRACE, (gdb) next ====> cache_find_entry_id( 1 ): 1 (busy) 2 577 id, ep_id, state); (gdb) step 579 ldap_pvt_thread_yield(); (gdb) step ldap_pvt_thread_yield () at thr_posix.c:147 147 return sched_yield(); (gdb) step 159 } (gdb) cache_find_entry_id (cache=0x80d56a0, id=1, rw=1) at cache.c:580 580 goto try_again; Never leaves this loop.