From owner-freebsd-current@FreeBSD.ORG Tue Nov 29 21:29:45 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E301716A426 for ; Tue, 29 Nov 2005 21:29:45 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id B32DB43D53 for ; Tue, 29 Nov 2005 21:29:09 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2827616 for multiple; Tue, 29 Nov 2005 16:28:54 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jATLSuFW074701; Tue, 29 Nov 2005 16:29:01 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 29 Nov 2005 16:29:07 -0500 User-Agent: KMail/1.8.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511291629.09069.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Mark Atkinson Subject: Re: LOR: so_snd @ /usr/src/sys/kern/uipc_coket.c:780 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2005 21:29:46 -0000 On Tuesday 29 November 2005 03:08 pm, Mark Atkinson wrote: > this one seems new, and doesn't seem to match anything on the known > list. Typed by hand. Single processor, no hyperthreading. The last > thing it was doing was doing a 'test' command on a file over nfs. > > Lock order reversal: > 1st 0xc5ef0ec so_snd (so_snd) @ /usr/src/sys/kern/uipc_socket.c:780 > 2nd 0xc0ac15ec tcp (tcp) @ /usr/src/sys/netinet/tcp_usrreq.c:580 > KDB: stack backstrace: > kdb_backtrace() at kdb_backtrace+0x2e > witness_checkorder() at witness_checkorder+0x6d3 > _mtx_lock_flags() at _mtx_lock_flags+0x8a > tcp_usr_shutdown() at tcp_usr_shutdown+0x3d > soshutdown() at soshutdown+0x41 > nfs_disconnect() at nfs_disconnect+0xd5 > nfs_reconnect() at nfs_reconnect+0x1c > nfs_reply() at nfs_reply+0x170 > nfs_request() at nfs_request+0x451 > nfs3_access_otw() at nfs3_access_otw+0xde > nfs_access() at nfs_access+0x120 > VOP_ACCESS_APV() at VOP_ACCESS_APV+0xac > nfs_lookup() at nfs_lookup+0xe5 > VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xb4 > lookup() at lookup+0x468 > namei() at namei+0x468 > kern_stat() at kern_stat+0x3d > stat() at stat+0x2f > syscall() at Xint0x80_syscall+0x1f > --- syscall (188, FreeBSD ELF32, stat, eip = 0x2819ad63, esp = > 0xbfbfe8cc, ebp = 0xbfbfe9c8 --- > panic: _mtx_lock_sleep: recursed on non-recursive mutex so_snd @ > /usr/src/sys/kern/uipc_socket.c:391 > > cpuid = 0 > KDB: enter: panic > Stopped at kdb_enter+0x30: leave > db> > db> show alllocks > Process 54517 (sh) thread 0xc5f1fd80 (100100) > exclusive sleep mutex so_snd r = 0 (0xc5aef0ec) locked @ > /usr/src/sys/kern/uipc_socket.c:780 > exclusive sleep mutex Giant r = 0 (0xc0a713c0) locked @ > /usr/src/sys/kern/vfs_lookup.c:619 > Process 54515 (cc1) thread 0xc5eac600 (100093) > exclusive sx user map r = 0 (0xc5fa2170) locked @ > /usr/src/sys/vm/vm_map:2996 Try this patch: Index: uipc_socket.c =================================================================== RCS file: /usr/cvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.254 diff -u -r1.254 uipc_socket.c --- uipc_socket.c 28 Nov 2005 21:45:36 -0000 1.254 +++ uipc_socket.c 29 Nov 2005 21:28:16 -0000 @@ -716,7 +716,7 @@ } #define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? M_NOWAIT : M_WAITOK) -#define snderr(errno) { error = (errno); goto out; } +#define snderr(errno) { error = (errno); goto release; } /* * Send on a socket. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org