On Saturday 30 December 2006 15:11, Karol Kwiatkowski wrote:
> Ivan Voras wrote:
> > Karol Kwiatkowski wrote:
> >> This works: FreeBSD 6.2-PRERELEASE #0: Thu Dec 14 11:34:36 CET 2006
> >> This doesn't: FreeBSD 6.2-PRERELEASE #0: Sat Dec 30 11:27:11 CET
> >> 2006
> >>
> >> I'm not sure it that's all that matters, I can supply more
> >> information if needed.
> >
> > Yes, you'll need to send at least a kernel stack backtrace. See here:
> > http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/
> >kerneldebug-online-ddb.html
> >
> > Get it to start the debugger on panic and post the backtrace (bt).
>
> Thanks for the link, I hope I've done it right. Here it is:
>
>
> Fatal trap 12: page fault while in kernel mode
> fault virtual address   = 0x74
> fault code              = supervisor read, page not present
> instruction pointer     = 0x20:0xc055d18d
> stack pointer           = 0x28:0xe989dbbc
> frame pointer           = 0x28:0xe989dbc0
> code segment            = base 0x0, limit 0xfffff, type 0x1b
>                         = DPL 0, pres 1, def32 1, gran 1
> processor eflags        = resume, IOPL = 0
> current process         = 637 (ntpd)
> [thread pid 637 tid 100059 ]
> Stopped at      turnstile_setowner+0xd: movl    0x74(%ecx),%eax
> db> bt
> Tracing pid 637 tid 100059 td 0xc4de2780
> turnstile_setowner(c4de9240,0,c4dc9240,c07201e0,c5102090,...) at
> turnstile_setowner+0xd
> turnstile_wait(c5101090,0,c5101000,c07234e0,e989dc24,...) at
> turnstile_wait+0xca
> _mtx_lock_sleep(c5102090,c4de2780,0,0,0,...) at _mtx_lock_sleep+0xb4
> in_pcballoc(c4e892c8,c07234e0,10000,c06c8de5,38,...) at
> in_pcballoc+0xbe tcp_attach(c4e892c8,c4e8933c,c06c8de5,0,c4e892c8,...)
> at tcp_attach+0x58 tcp_usr_attach(c4e892c8,0,c4de2780,0,0,...) at
> tcp_usr_attach+0x63 socreate(2,e989dcb8,1,0,c4ab1c90,...) at
> socreate+0x167
> socket(c4de2780,e989dd04,c,c4de2780,80d3000,...) at socket+0xb3
> syscall(3b,3b,3b,0,7,...) at syscall+0x380
> Xint0x80_syscall() at Xint0x80_syscall+0x1f
> --- syscall (97, FreeBSD ELF32, socket), eip = 0x282939d3, esp =
> 0xbfbfeb1c, ebp = 0xbfbfebf8 ---
> db >

Something like the attached should fix it.  Seems tcp was forgotten in a 
recent change to INP locking.

-- 
/"\  Best regards,                      | [EMAIL PROTECTED]
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | [EMAIL PROTECTED]
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
Index: tcp_subr.c
===================================================================
RCS file: /usr/store/mlaier/fcvs/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.228.2.12
diff -u -r1.228.2.12 tcp_subr.c
--- tcp_subr.c	1 Oct 2006 05:33:50 -0000	1.228.2.12
+++ tcp_subr.c	30 Dec 2006 15:06:45 -0000
@@ -300,6 +300,15 @@
 		uma_zone_set_max(tcptw_zone, tcptw_auto_size());
 }
 
+static int
+tcp_inpcb_init(void *mem, int size, int flags)
+{
+	struct inpcb *inp = mem;
+
+	INP_LOCK_INIT(inp, "inp", "tcpinp");
+	return (0);
+}
+
 void
 tcp_init()
 {
@@ -328,7 +337,7 @@
 	tcbinfo.porthashbase = hashinit(hashsize, M_PCB,
 					&tcbinfo.porthashmask);
 	tcbinfo.ipi_zone = uma_zcreate("inpcb", sizeof(struct inpcb),
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+	    NULL, NULL, tcp_inpcb_init, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
 	uma_zone_set_max(tcbinfo.ipi_zone, maxsockets);
 #ifdef INET6
 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr))

Attachment: pgpTdZroeH8uw.pgp
Description: PGP signature

Reply via email to