From owner-freebsd-net@FreeBSD.ORG Tue Aug 9 20:47:31 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 8C9BA16A41F for ; Tue, 9 Aug 2005 20:47:31 +0000 (GMT) (envelope-from darcy@wavefire.com) Received: from mail2.dbitech.ca (radius.wavefire.com [64.141.13.252]) by mx1.FreeBSD.org (Postfix) with SMTP id 2257A43D48 for ; Tue, 9 Aug 2005 20:47:30 +0000 (GMT) (envelope-from darcy@wavefire.com) Received: (qmail 7781 invoked from network); 9 Aug 2005 22:51:11 -0000 Received: from dbitech.internal.wavefire.ca (64.141.15.12) by radius.wavefire.com with SMTP; 9 Aug 2005 22:51:11 -0000 From: Darcy Buskermolen Organization: Wavefire Technologies Corp To: Brooks Davis Date: Tue, 9 Aug 2005 13:48:04 -0700 User-Agent: KMail/1.8.2 References: <200508090854.21278.darcy@wavefire.com> <20050809181601.GB20908@odin.ac.hmc.edu> In-Reply-To: <20050809181601.GB20908@odin.ac.hmc.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508091348.05099.darcy@wavefire.com> Cc: freebsd-net@freebsd.org Subject: Re: panic: if_attach called without if_alloc'd input() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2005 20:47:31 -0000 On Tuesday 09 August 2005 11:16, Brooks Davis wrote: > On Tue, Aug 09, 2005 at 08:54:21AM -0700, Darcy Buskermolen wrote: > > I'm getting the following panic on my RELENG_6 test box: > > > > xl1f0: BUG: if_attach called without if_alloc'd input() > > > > Where should I be looking to track this down? I suspect it has to do with > > a custom kernel, it wasn't doing it when i was running GENERIC > > The ef(4) device is currently broken. I haven't had time to look at it > much though it seems mostly correct by inspection so I'm not sure what's > going on. > > If you could compile with debugging and get be a stack trace from the > panic, that might help be track this down. Here is a trace without your patch KDB: enter: panic [thread pid 0 tid 0 ] Stoped at kdb_enter+0x2b: nop db> trace Tracing pid 0 tid 0 td 0xc0824dc0 kdb_enter(c07b7c59) at kdb_enter+0xb2 panic(c07bd294,c13b5c10,c0c20cfc,c059605d,c13b8c10) at panic+0xbb if_attach(c13b5c00,c13b5c00,c1380a00,c0c20d28,c05e93ed) at if_attach+0x33 ether_ifattach(c13b5c00,c12ba2ab,0,c0c20d40,c05e9c86) at ether_ifattach+0x19 ef_attach(c13b04d0) at ef_attach+0x5d ef_load(c0c20d74,c0572383,c12b6600,0,0) at ef_load+0x1ae if_ef_modevent(c16b6600,0,0,c08259c0,0) at if_ef_modeevent+0x19 module_redgister)init(c07fe220,c1ec00,c1e000,0,c0444065) at module_register_init+0x4b mi_startup() at mi_startup+0x96 begin() at begin+0x2c db> This was transcribed for the monitor behind me so I may have typoed an address along the way, but hopefully it's enough to point you down the right path, if you need more detail just let me know. I'm compiling with your patch now, but it may take a bit before i get back to you with answers on how it does, darn slow hardware.. > I'm assuming there's a path > through the code that I'm missing that results in using a bogus cast to > get an ifnet pointer and thus causes a panic. You might also try the > following patch which fixes a couple bugs I think are unrelated, but may > not be. > > -- Brooks > > Index: if_ef.c > =================================================================== > RCS file: /home/ncvs/src/sys/net/if_ef.c,v > retrieving revision 1.34 > diff -u -p -r1.34 if_ef.c > --- if_ef.c 10 Jun 2005 16:49:18 -0000 1.34 > +++ if_ef.c 26 Jul 2005 23:56:39 -0000 > @@ -477,7 +477,7 @@ ef_clone(struct ef_link *efl, int ft) > efp->ef_pifp = ifp; > efp->ef_frametype = ft; > eifp = efp->ef_ifp = if_alloc(IFT_ETHER); > - if (ifp == NULL) > + if (eifp == NULL) > return (ENOSPC); > snprintf(eifp->if_xname, IFNAMSIZ, > "%sf%d", ifp->if_xname, efp->ef_frametype); > @@ -536,8 +536,8 @@ ef_load(void) > SLIST_FOREACH(efl, &efdev, el_next) { > for (d = 0; d < EF_NFT; d++) > if (efl->el_units[d]) { > - if (efl->el_units[d]->ef_pifp != NULL) > - if_free(efl->el_units[d]->ef_pifp); > + if (efl->el_units[d]->ef_ifp != NULL) > + if_free(efl->el_units[d]->ef_ifp); > free(efl->el_units[d], M_IFADDR); > } > free(efl, M_IFADDR); -- Darcy Buskermolen Wavefire Technologies Corp. http://www.wavefire.com ph: 250.717.0200 fx: 250.763.1759