Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 May 2002 01:30:02 -0700 (PDT)
From:      Dmitry Frolov <frolov@riss-telecom.ru>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/38325: fatal trap on running trafd daemon and trafstat utility
Message-ID:  <200205200830.g4K8U2I36101@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/38325; it has been noted by GNATS.

From: Dmitry Frolov <frolov@riss-telecom.ru>
To: freebsd-gnats-submit@FreeBSD.org, sergio@nexcom.ru,
	silby@FreeBSD.org
Cc: count@riss-telecom.ru
Subject: Re: kern/38325: fatal trap on running trafd daemon and trafstat utility
Date: Mon, 20 May 2002 15:27:35 +0700

 This is due to not checking for empty socket listen queue in sonewconn3 in
 sys/kern/uipc_socket2.h when rotating queues.
 This bug is probably caused by revision 1.87 of this file and MFC
 at May 1.
 
 Patch:
 
 --- src/sys/kern/uipc_socket2.c.org	Mon May 20 12:21:48 2002
 +++ src/sys/kern/uipc_socket2.c	Mon May 20 13:15:30 2002
 @@ -210,7 +210,8 @@
  		so->so_state |= SS_COMP;
  		head->so_qlen++;
  	} else {
 -		if (head->so_incqlen >= head->so_qlimit) {
 +		if (! TAILQ_EMPTY(&head->so_incomp)
 +				&& head->so_incqlen >= head->so_qlimit) {
  			struct socket *sp;
  			sp = TAILQ_FIRST(&head->so_incomp);
  			(void) soabort(sp);
 
 gdb output:
 
 GNU gdb 4.18
 Copyright 1998 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you are
 welcome to change it and/or distribute copies of it under certain conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for details.
 This GDB was configured as "i386-unknown-freebsd"...
 IdlePTD at phsyical address 0x0036d000
 initial pcb at physical address 0x0027bde0
 panicstr: page fault
 panic messages:
 ---
 Fatal trap 12: page fault while in kernel mode
 fault virtual address	= 0xc
 fault code		= supervisor read, page not present
 instruction pointer	= 0x8:0xc0171760
 stack pointer	        = 0x10:0xd133ad20
 frame pointer	        = 0x10:0xd133ad28
 code segment		= base 0x0, limit 0xfffff, type 0x1b
 			= DPL 0, pres 1, def32 1, gran 1
 processor eflags	= interrupt enabled, resume, IOPL = 0
 current process		= 85 (trafd)
 interrupt mask		= 
 trap number		= 12
 panic: page fault
 
 syncing disks... 8 8 
 done
 Uptime: 1m58s
 
 dumping to dev #ad/0x20001, offset 262144
 dump ata0: resetting devices .. done
 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129  128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
 ---
 #0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
 487		if (dumping++) {
 (kgdb) where
 #0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
 #1  0xc0152e63 in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:316
 #2  0xc01532a1 in panic (fmt=0xc024be0c "%s")
     at /usr/src/sys/kern/kern_shutdown.c:595
 #3  0xc020f377 in trap_fatal (frame=0xd133ace0, eva=12)
     at /usr/src/sys/i386/i386/trap.c:966
 #4  0xc020f025 in trap_pfault (frame=0xd133ace0, usermode=0, eva=12)
     at /usr/src/sys/i386/i386/trap.c:859
 #5  0xc020ebcb in trap (frame={tf_fs = -819593200, tf_es = 16, tf_ds = -65520, 
       tf_edi = 0, tf_esi = 0, tf_ebp = -785142488, tf_isp = -785142516, 
       tf_ebx = -819528384, tf_edx = 0, tf_ecx = 0, tf_eax = 0, tf_trapno = 12, 
       tf_err = 0, tf_eip = -1072228512, tf_cs = 8, tf_eflags = 66118, 
       tf_esp = -819528384, tf_ss = -819528000})
     at /usr/src/sys/i386/i386/trap.c:458
 #6  0xc0171760 in soabort (so=0x0) at /usr/src/sys/kern/uipc_socket.c:339
 #7  0xc0173b02 in sonewconn3 (head=0xcf26fec0, connstatus=0, p=0xce878100)
     at /usr/src/sys/kern/uipc_socket2.c:216
 #8  0xc0177783 in unp_connect (so=0xcf26fe00, nam=0xc3b3d000, p=0xce878100)
     at /usr/src/sys/kern/uipc_usrreq.c:671
 #9  0xc0176ce7 in uipc_connect (so=0xcf26fe00, nam=0xc3b3d000, p=0xce878100)
     at /usr/src/sys/kern/uipc_usrreq.c:156
 #10 0xc0171822 in soconnect (so=0xcf26fe00, nam=0xc3b3d000, p=0xce878100)
     at /usr/src/sys/kern/uipc_socket.c:389
 #11 0xc0174d5d in connect (p=0xce878100, uap=0xd133af80)
     at /usr/src/sys/kern/uipc_syscalls.c:394
 #12 0xc020f641 in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, 
       tf_edi = 135065600, tf_esi = 4, tf_ebp = -1077937796, 
       tf_isp = -785141804, tf_ebx = -1077937904, tf_edx = 134535920, 
       tf_ecx = -1077937886, tf_eax = 98, tf_trapno = 0, tf_err = 2, 
       tf_eip = 671859572, tf_cs = 31, tf_eflags = 659, tf_esp = -1077937984, 
       tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1167
 #13 0xc0202555 in Xint0x80_syscall ()
 #14 0x80499e1 in ?? ()
 #15 0xbfbfffac in ?? ()
 #16 0x2807832f in ?? ()
 #17 0x80498b6 in ?? ()
 #18 0x804926d in ?? ()
 (kgdb) up 6
 #6  0xc0171760 in soabort (so=0x0) at /usr/src/sys/kern/uipc_socket.c:339
 339	{
 (kgdb) list
 334	 * Must be called at splnet...
 335	 */
 336	int
 337	soabort(so)
 338		struct socket *so;
 339	{
 340		int error;
 341	
 342		error = (*so->so_proto->pr_usrreqs->pru_abort)(so);
 343		if (error) {
 (kgdb) p so
 $1 = (struct socket *) 0x0
 (kgdb) up
 #7  0xc0173b02 in sonewconn3 (head=0xcf26fec0, connstatus=0, p=0xce878100)
     at /usr/src/sys/kern/uipc_socket2.c:216
 216				(void) soabort(sp);
 (kgdb) list
 211			head->so_qlen++;
 212		} else {
 213			if (head->so_incqlen >= head->so_qlimit) {
 214				struct socket *sp;
 215				sp = TAILQ_FIRST(&head->so_incomp);
 216				(void) soabort(sp);
 217			}
 218			TAILQ_INSERT_TAIL(&head->so_incomp, so, so_list);
 219			so->so_state |= SS_INCOMP;
 220			head->so_incqlen++;
 (kgdb) p (&head->so_incomp)->tqh_first
 $2 = (struct socket *) 0x0
 (kgdb) p head->so_incqlen
 $3 = 0
 (kgdb) p head->so_qlimit
 $4 = 0
 (kgdb) p (head->so_incqlen >= head->so_qlimit)
 $5 = 1
 (kgdb) qu
 
     wbr&w, dmitry.
 -- 
 Dmitry Frolov <frolov@riss-telecom.ru>
 RISS-Telecom Network, Novosibirsk, Russia
 66415911@ICQ, +7 3832 NOWA1T, DVF-RIPE

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205200830.g4K8U2I36101>