Subject: bin/36684: named crashes with INSIST failure
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <morth@morth.org>
List: netbsd-bugs
Date: 07/23/2007 18:35:01
>Number:         36684
>Category:       bin
>Synopsis:       named crashes soon after start with a INSIST failure.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 23 18:35:01 +0000 2007
>Originator:     Pelle Johansson
>Release:        NetBSD 3.1.1_PATCH
>Organization:
	
>Environment:
	
	
System: NetBSD kaninen.morth.org 3.1.1_PATCH NetBSD 3.1.1_PATCH (kaninen) #0: Mon Jul 23 11:24:37 CEST 2007 pelle@kaninen.morth.org:/mnt/netbsd/netbsd-3.1/obj.kaninen/sys/arch/macppc/compile/kaninen macppc
Architecture: powerpc
Machine: macppc
>Description:
I today upgraded to the latest sources on the 3.1-branch.
After the upgrade, bind failed to start:
Jul 23 19:18:34 kaninen named[364]: 23-Jul-2007 19:18:34.245/mnt/netbsd/netbsd-3
.1/src/dist/bind/lib/dns/rbt.c:1581: INSIST(child != (void *)0) failed
Jul 23 19:18:34 kaninen named[364]: 23-Jul-2007 19:18:34.413exiting (due to asse
rtion failure)
	
>How-To-Repeat:
	
	Unsure about exact procedures, but it's completely repeatable on my maching, even if only caching queries.
>Fix:
	
As suggested at http://mail-index.netbsd.org/port-macppc/2005/02/22/0003.html
removing inline from rotate_left() and rotate_right() in rbt.c fixes the problem.
Likely newer versions of gcc behaves better as well, so might not affect -current.
Diff for netbsd-3.1 branch:
Index: src/dist/bind/lib/dns/rbt.c
===================================================================
RCS file: /cvsroot/src/dist/bind/lib/dns/rbt.c,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 rbt.c
--- src/dist/bind/lib/dns/rbt.c	13 Jul 2006 22:02:18 -0000	1.2.2.1
+++ src/dist/bind/lib/dns/rbt.c	23 Jul 2007 18:28:20 -0000
@@ -197,9 +197,9 @@
 #define unhash_node(rbt, node)
 #endif
 
-static inline void
+static void
 rotate_left(dns_rbtnode_t *node, dns_rbtnode_t **rootp);
-static inline void
+static void
 rotate_right(dns_rbtnode_t *node, dns_rbtnode_t **rootp);
 
 static void
@@ -1570,7 +1570,7 @@
 }
 #endif /* DNS_RBT_USEHASH */
 
-static inline void
+static void
 rotate_left(dns_rbtnode_t *node, dns_rbtnode_t **rootp) {
 	dns_rbtnode_t *child;
 
@@ -1603,7 +1603,7 @@
 	PARENT(node) = child;
 }
 
-static inline void
+static void
 rotate_right(dns_rbtnode_t *node, dns_rbtnode_t **rootp) {
 	dns_rbtnode_t *child;
 

>Unformatted: