>>>>> On Tue, 10 Oct 2006 19:36:51 +0200,
>>>>> Marco Schumann said:


> I compiled using this patch and without --disable-atomic, unfortunately
> named refused to start:


> 10-Oct-2006 19:28:22.894 general: rbtdb.c:1128: INSIST(((unsigned
> int)((&rbtdb->node_locks[node->locknum].references)->ref
> s))) failed
> 10-Oct-2006 19:28:22.894 general: exiting (due to assertion failure)


Oops, sorry, the patch was not really correct. Please use this one
(attached below) instead.

But the actual behavior of these two patches should be the same...do
you mean named exited during initialization by 'refused to start'? Or
do you mean it existed just after starting? In any case, if it dumped
core, backtrace (of all threads) would be helpful as before.

Thanks,

JINMEI, Tatuya
Communication Platform Lab.
Corporate R&D Center, Toshiba Corp.
jinmei@isl.rdc.toshiba.co.jp

--- rbtdb.c.orig Tue Oct 10 23:35:40 2006
+++ rbtdb.c Wed Oct 11 02:47:15 2006
@@ -837,8 +837,8 @@
REQUIRE(version->writer);

if (changed != NULL) {
- dns_rbtnode_refincrement0(node, &refs);
- INSIST(refs > 0);
+ dns_rbtnode_refincrement(node, &refs);
+ INSIST(refs != 0);
changed->node = node;
changed->dirty = ISC_FALSE;
ISC_LIST_INITANDAPPEND(version->changed_list, changed, link);
@@ -1125,6 +1125,7 @@
isc_refcount_increment0(lockref, &lockrefs);
INSIST(lockrefs != 0);
}
+ INSIST(isc_refcount_current(&rbtdb->node_locks[node->locknum].references) > 0);
INSIST(noderefs != 0);
}

@@ -3824,8 +3825,8 @@
REQUIRE(targetp != NULL && *targetp == NULL);

NODE_STRONGLOCK(&rbtdb->node_locks[node->locknum].lock);
- dns_rbtnode_refincrement0(node, &refs);
- INSIST(refs > 1);
+ dns_rbtnode_refincrement(node, &refs);
+ INSIST(refs != 0);
NODE_STRONGUNLOCK(&rbtdb->node_locks[node->locknum].lock);

*targetp = source;
@@ -4285,8 +4286,8 @@

NODE_STRONGLOCK(&rbtdb->node_locks[rbtnode->locknum].lock);

- dns_rbtnode_refincrement0(rbtnode, &refs);
- INSIST(refs > 0);
+ dns_rbtnode_refincrement(rbtnode, &refs);
+ INSIST(refs != 0);

iterator->current = NULL;

@@ -6332,9 +6333,12 @@
* expirenode() currently always returns success.
*/
if (expire_result == ISC_R_SUCCESS && node->down == NULL) {
+ unsigned int refs;
+
rbtdbiter->deletions[rbtdbiter->delete++] = node;
NODE_STRONGLOCK(&rbtdb->node_locks[node->locknum].lock);
- dns_rbtnode_refincrement0(node, NULL);
+ dns_rbtnode_refincrement(node, &refs);
+ INSIST(refs != 0);
NODE_STRONGUNLOCK(&rbtdb->node_locks[node->locknum].lock);
}
}