Re: panic: lock (sleep mutex) inp not locked _at_ /usr/src/sys/netinet6/in6_pcb.c:710

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Wed, 18 Aug 2004 00:02:44 -0400 (EDT)
On Wed, 18 Aug 2004, Jun Kuriyama wrote:

> This is current kernel as of 2004.08.17.04.10.00+00.
> 
> panic: lock (sleep mutex) inp not locked _at_
> /usr/src/sys/netinet6/in6_pcb.c:710

Hmm.  This code is somewhat more spaghetti than I thought.  In the IPv4
version, we check the return value of the notify function to decide if we
need to unlock.  Something like the following may fix this:

Index: in6_pcb.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/in6_pcb.c,v
retrieving revision 1.59
diff -u -r1.59 in6_pcb.c
--- in6_pcb.c	14 Aug 2004 15:32:20 -0000	1.59
+++ in6_pcb.c	18 Aug 2004 04:02:00 -0000
_at__at_ -705,9 +705,11 _at__at_
 		}
 
 	  do_notify:
-		if (notify)
-			(*notify)(inp, errno);
-		INP_UNLOCK(inp);
+		if (notify) {
+			if ((*notify)(inp, errno))
+				INP_UNLOCK(inp);
+		} else
+			INP_UNLOCK(inp);
 	}
 	INP_INFO_WUNLOCK(pcbinfo);
 	splx(s);

Do you have a dump for this?  If so, is there any chance you could tell me
what function 'notify' was set to point to, and what the value of 'inp' is
there?

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert_at_fledge.watson.org      Principal Research Scientist, McAfee Research


> cpuid = 1;
> KDB: enter: panic
> [thread 100012]
> Stopped at      kdb_enter+0x2b: nop
> db> trace
> kdb_enter(c0679e1c) at kdb_enter+0x2b
> panic(c067d733,c068df54,c0688ab3,c0686de5,2c6) at panic+0x131
> witness_unlock(c3b4084c,8,c0686de5,2c6) at witness_unlock+0xbc
> _mtx_unlock_flags(c3b4084c,0,c0686de5,2c6) at _mtx_unlock_flags+0x5b
> in6_pcbnotify(c0709d40,e4d3abb0,1600,e4d3abd0,9bed) at in6_pcbnotify+0x26d
> tcp6_ctlinput(6,e4d3abb0,e4d3ab80) at tcp6_ctlinput+0xf0
> icmp6_notify_error(c3ad5b00,28,4c,6) at icmp6_notify_error+0x70e
> icmp6_input(e4d3acd4,e4d3ac74,3a,0,3a) at icmp6_input+0xc14
> ip6_input(c3ad5b00) at ip6_input+0xd22
> netisr_processqueue(c0708ca4) at netisr_processqueue+0x6e
> swi_net(0) at swi_net+0x88
> ithread_loop(c3461b80,e4d3ad48,c3461b80,c04de148,0) at ithread_loop+0x124
> fork_exit(c04de148,c3461b80,e4d3ad48) at fork_exit+0xa4
> fork_trampoline() at fork_trampoline+0x8
> --- trap 0x1, eip = 0, esp = 0xe4d3ad7c, ebp = 0 ---
> 
> 
> -- 
> Jun Kuriyama <kuriyama_at_imgsrc.co.jp> // IMG SRC, Inc.
>              <kuriyama_at_FreeBSD.org> // FreeBSD Project
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> 
Received on Wed Aug 18 2004 - 02:04:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:06 UTC