panic: _rw_wlock_hard

Robert Watson rwatson at FreeBSD.org
Sat Feb 21 06:50:32 PST 2009


On Wed, 18 Feb 2009, dikshie wrote:

> does anyone see this panic on -HEAD:
>
> panic: _rw_wlock_hard: recursing but non-recursive rw radix node head @ 
> /usr/src/sys/net/route.c:831
>
> kdb_enter() at kdb_enter+0x3a
> panic() at panic+0x136
> _rw_wlock_hard() at _rw_wlock_hard+0x66
> _rw_wlock() at _rw_wlock+0xae
> rtquest1_fib() at rtquest1_fib+0x95
> rtquest_fib() at rtquest_fib+0x5e
> in_rtquest() at in_rtquest+0x3b
> in_rtqkill() at in_rtqkill+0x7f
> rn_walktree() at rn_walktree+0x65
> in_rtqtimo() at in_rtqtimo+0xb0
> softclock() at softclock+0x24a
> intr_event_execute_handlers() at intr_event_execute_handlers+0x125
> ithread_loop() at ithread_loop+0x9f
> fork_exit() at fork_exit+0xb8
> fork_trampoline() at fork_trampoline+0x8
>
> -HEAD built on Feb 16 14:26:25 JST.

Something like the following may help -- build-tested but not not run-time 
tested:

Index: in_rmx.c
===================================================================
--- in_rmx.c	(revision 186118)
+++ in_rmx.c	(working copy)
@@ -230,6 +230,8 @@
  	struct rtentry *rt = (struct rtentry *)rn;
  	int err;

+	RADIX_NODE_HEAD_WLOCK_ASSERT(ap->rnh);
+
  	if (rt->rt_flags & RTPRF_OURS) {
  		ap->found++;

@@ -240,7 +242,8 @@
  			err = in_rtrequest(RTM_DELETE,
  					(struct sockaddr *)rt_key(rt),
  					rt->rt_gateway, rt_mask(rt),
-					rt->rt_flags, 0, rt->rt_fibnum);
+					rt->rt_flags | RTF_RNH_LOCKED, 0,
+					rt->rt_fibnum);
  			if (err) {
  				log(LOG_WARNING, "in_rtqkill: error %d\n", err);
  			} else {


More information about the freebsd-net mailing list