From owner-freebsd-net@FreeBSD.ORG Sat Aug 2 10:45:16 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 188AE37B401 for ; Sat, 2 Aug 2003 10:45:16 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id A85B143FEC for ; Sat, 2 Aug 2003 10:45:12 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 90247 invoked from network); 2 Aug 2003 17:45:11 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 2 Aug 2003 17:45:11 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sat, 2 Aug 2003 12:43:06 -0500 (CDT) From: Mike Silbersack To: Scot Loach In-Reply-To: Message-ID: <20030802123049.Y2165@odysseus.silby.com> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "'freebsd-net@freebsd.org'" Subject: RE: TCP socket shutdown race condition X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2003 17:45:16 -0000 On Sat, 2 Aug 2003, Scot Loach wrote: > I don't think that's the problem, although it does seem suspicious. > > Here's the struct ucred pointed to by the socket: > > (kgdb) p *so.so_cred > $2 = {cr_ref = 3279453304, cr_uid = 3486088556, cr_ngroups = 1, cr_groups = > { > 0, 3276863080, 3277717504, 21162, 0, 0, 0, 0, 0, 4294967295, 4294967295, > 0, 0, 0, 0, 3279496516}, cr_uidinfo = 0x0} > > This looks like garbage, but the cr_uidinfo pointer is null, and the cr_ref > of _this_ structure is 32 bits. > > This doesn't look to me like a problem with the uidinfo, it looks to me like > the ucred structure has already been freed. > > scot. Well, as ui_ref is the best bet, redoing your tests with it expanded to ui_int is where we need to start before looking further. :) I believe that a uidinfo->ui_ref over/underflow could cause random memory corruption, so maybe the panic you're seeing comes about after a bunch of memory has already been trashed. So anyway, promote ui_ref to a u_int and retest. Tell us what happens. Mike "Silby" Silbersack