Re: 7.0-CURRENT panic from today build

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Wed, 2 Aug 2006 16:06:11 +0100 (BST)
On Wed, 2 Aug 2006, Goran Gajic wrote:

> fbsd# kgdb /usr/src/sys/i386/compile/GENERIC/kernel.debug /var/crash/vmcore.3
> [GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so: 
> Undefined symbol "ps_pglobal_lookup"]
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 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-marcel-freebsd".

Thanks for the report.  This is similar to a problem that cropped up in the 
UNIX domain socket code last week after changes in the way socket tear-down 
were made.  I'll likely have a fix for this in the next 24 hours or so, just 
need to read some code and decide which of two or three approaches is most 
likely the right one.

To be specific: the problem is that right now we largely tear down socket 
state, such as socket buffers and kqueue, before we enter the pru_detach 
routine now.  This means that the call to soisdisconnected() from 
tcp_discardcb() is no longer occuring in the right place, and needs to move. 
There was already a comment from me there suggesting it was in the wrong place 
from before, now it is definitely in the wrong place.  Likely the socket 
should already be detached from the pcb when we run tcp_discardcb(), and the 
caller should have called soisdisconnected() if it was needed.

I'll commit the fix directly to CVS, so you will want to cvsup in about 24 
hours to pick it up.

Thanks,

Robert N M Watson
Computer Laboratory
University of Cambridge

>
> Unread portion of the kernel message buffer:
> Kernel page fault with the following non-sleepable locks held:
> exclusive sleep mutex so_rcv r = 0 (0xc30a56f0) locked _at_ 
> kern/uipc_socket2.c:166
> exclusive sleep mutex inp (tcpinp) r = 0 (0xc30db480) locked _at_ 
> netinet/tcp_usrreq.c:252
> exclusive sleep mutex tcp r = 0 (0xc0a5a2ec) locked _at_ 
> netinet/tcp_usrreq.c:251
> KDB: stack backtrace:
> kdb_backtrace(3,c2c91d38,c,c2773360,d5aa8a5c,...) at kdb_backtrace+0x29
> witness_warn(5,0,c0946263) at witness_warn+0x192
> trap(c0a50008,28,c0910028,c30a56d8,c30a567c,...) at trap+0x108
> calltrap() at calltrap+0x5
> --- trap 0xc, eip = 0xc06818d2, esp = 0xd5aa8aa4, ebp = 0xd5aa8aa4 ---
> knlist_mtx_locked(0) at knlist_mtx_locked+0x6
> knote(c30a56d8,0,1,c30a56f0,c30a567c,...) at knote+0x1d
> sowakeup(c30a567c,c30a56cc) at sowakeup+0x61
> soisdisconnected(c30a567c) at soisdisconnected+0x61
> tcp_discardcb(c30b6570) at tcp_discardcb+0x1f5
> tcp_detach(c30a567c,c30db3f0,c30a567c,c09d1568,d5aa8b74,...) at 
> tcp_detach+0x14e
> tcp_usr_detach(c30a567c) at tcp_usr_detach+0x67
> sofree(c30a567c) at sofree+0x1fe
> soclose(c30a567c) at soclose+0x2d9
> soo_close(c30dfbd0,c2773360) at soo_close+0x4b
> fdrop_locked(c30dfbd0,c2773360,c24806d0,0,c091adae,...) at fdrop_locked+0x88
> fdrop(c30dfbd0,c2773360,6b5,c0a11a94,0,...) at fdrop+0x24
> closef(c30dfbd0,c2773360,1,0,0,...) at closef+0x367
> kern_close(c2773360,1d,d5aa8d30,c08990de,c2773360,...) at kern_close+0x1b6
> close(c2773360,d5aa8d04) at close+0x10
> syscall(a8e0003b,bf1f003b,8245003b,e,947fa38,...) at syscall+0x256
> Xint0x80_syscall() at Xint0x80_syscall+0x1f
> --- syscall (6, Linux ELF, close), eip = 0x28feecaf, esp = 0xbf1ff698, ebp = 
> 0x91ed218 ---
>
>
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0; apic id = 00
> fault virtual address   = 0x10
> fault code              = supervisor read, page not present
> instruction pointer     = 0x20:0xc06818d2
> stack pointer           = 0x28:0xd5aa8aa4
> frame pointer           = 0x28:0xd5aa8aa4
> 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         = 598 (skype)
> Dumping 511 MB (2 chunks)
>  chunk 0: 1MB (159 pages) ... ok
>  chunk 1: 511MB (130736 pages) 495 479 463 447 431 415 399 383 367 351 335 
> 319 303 287 271 255 239 223 207 191 175 159 143 127 111 95 79 63 47 31 15
>
> #0  doadump () at pcpu.h:166
> 166     pcpu.h: No such file or directory.
>        in pcpu.h
> (kgdb) ) where
> #0  doadump () at pcpu.h:166
> #1  0xc04758a3 in db_fncall (dummy1=-710244144, dummy2=0, dummy3=1016, 
> dummy4=0xd5aa88a4 "¼\210ªÕø\003") at ../../../ddb/db_command.c:481
> #2  0xc04756af in db_command (last_cmdp=0xc09f0a84, cmd_table=0x0) at 
> ../../../ddb/db_command.c:396
> #3  0xc047576a in db_command_loop () at ../../../ddb/db_command.c:448
> #4  0xc0477369 in db_trap (type=12, code=0) at ../../../ddb/db_main.c:221
> #5  0xc06b71d0 in kdb_trap (type=12, code=0, tf=0xd5aa8a64) at 
> ../../../kern/subr_kdb.c:502
> #6  0xc0898dc1 in trap_fatal (frame=0xd5aa8a64, eva=16) at 
> ../../../i386/i386/trap.c:858
> #7  0xc089843f in trap (frame=
>      {tf_fs = -1062928376, tf_es = 40, tf_ds = -1064239064, tf_edi = 
> -1022732584, tf_esi = -1022732676, tf_ebp = -710243676, tf_isp = -710243696, 
> tf_ebx = -102
> 2732596, tf_edx = -1032388600, tf_ecx = 4, tf_eax = 0, tf_trapno = 12, tf_err 
> = 16, tf_eip = -1066919726, tf_cs = 32, tf_eflags = 66050, tf_esp = 
> -710243652, tf
> _ss = -1066920643}) at ../../../i386/i386/trap.c:277
> #8  0xc0883e2a in calltrap () at ../../../i386/i386/exception.s:138
> #9  0xc06818d2 in knlist_mtx_locked (arg=0x0) at 
> ../../../kern/kern_event.c:1644
> #10 0xc068153d in knote (list=0xc30a56d8, hint=0, islocked=1) at 
> ../../../kern/kern_event.c:1520
> #11 0xc06da6dd in sowakeup (so=0xc30a567c, sb=0xc30a56cc) at 
> ../../../kern/uipc_sockbuf.c:190
> #12 0xc06df7dd in soisdisconnected (so=0xc30a567c) at 
> ../../../kern/uipc_socket2.c:170
> #13 0xc07476d1 in tcp_discardcb (tp=0xc30b6570) at 
> ../../../netinet/tcp_subr.c:786
> #14 0xc074bee2 in tcp_detach (so=0xc30a567c, inp=0xc30db3f0) at 
> ../../../netinet/tcp_usrreq.c:212
> #15 0xc074bf9b in tcp_usr_detach (so=0xc30a567c) at 
> ../../../netinet/tcp_usrreq.c:257
> #16 0xc06dc206 in sofree (so=0xc30a567c) at ../../../kern/uipc_socket.c:614
> #17 0xc06dc4f1 in soclose (so=0xc30a567c) at ../../../kern/uipc_socket.c:684
> #18 0xc06c9c53 in soo_close (fp=0xc30dfbd0, td=0xc2773360) at 
> ../../../kern/sys_socket.c:315
> #19 0xc067dcc8 in fdrop_locked (fp=0xc30dfbd0, td=0xc2773360) at file.h:296
> #20 0xc067dc38 in fdrop (fp=0xc30dfbd0, td=0xc2773360) at 
> ../../../kern/kern_descrip.c:2164
> #21 0xc067c727 in closef (fp=0xc30dfbd0, td=0xc2773360) at 
> ../../../kern/kern_descrip.c:1979
> #22 0xc067a002 in kern_close (td=0xc2773360, fd=29) at 
> ../../../kern/kern_descrip.c:1026
> #23 0xc0679e48 in close (td=0xc2773360, uap=0x0) at 
> ../../../kern/kern_descrip.c:977
> #24 0xc08990de in syscall (frame=
>      {tf_fs = -1461714885, tf_es = -1088487365, tf_ds = -2109407173, tf_edi 
> = 14, tf_esi = 155712056, tf_ebp = 153014808, tf_isp = -710242972, tf_ebx = 
> 29, tf_
> edx = 156362632, tf_ecx = 1, tf_eax = 6, tf_trapno = 22, tf_err = 2, tf_eip = 
> 687795375, tf_cs = 51, tf_eflags = 582, tf_esp = -1088424296, tf_ss = 59})
>    at ../../../i386/i386/trap.c:1006
> #25 0xc0883e7f in Xint0x80_syscall () at ../../../i386/i386/exception.s:191
> #26 0x00000033 in ?? ()
> Previous frame inner to this frame (corrupt stack?)
> (kgdb)
>
>
> FreeBSD fbsd.interex.net 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Aug  2 
> 13:15:27 CEST 2006 root_at_fbsd.interex.net:/usr/src/sys/i386/compile/GENERIC 
> i386
>
>
> Regards,
> gg.
>
Received on Wed Aug 02 2006 - 13:06:14 UTC

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