From nobody@FreeBSD.org  Tue Aug 13 15:55:24 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E455B37B400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Aug 2002 15:55:24 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B58F143E70
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Aug 2002 15:54:54 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g7DMseOT084349
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 13 Aug 2002 15:54:40 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g7DMsee5084348;
	Tue, 13 Aug 2002 15:54:40 -0700 (PDT)
Message-Id: <200208132254.g7DMsee5084348@www.freebsd.org>
Date: Tue, 13 Aug 2002 15:54:40 -0700 (PDT)
From: Rob Byrnes <rbyrnes@ozemail.com.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: dhclient gives unaligned access on Alpha - causes kernel panic
X-Send-Pr-Version: www-1.0

>Number:         41642
>Category:       alpha
>Synopsis:       dhclient gives unaligned access on Alpha - causes kernel panic
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-alpha
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 13 16:00:09 PDT 2002
>Closed-Date:    Mon Oct 21 13:52:50 PDT 2002
>Last-Modified:  Mon Oct 21 13:52:50 PDT 2002
>Originator:     Rob Byrnes
>Release:        4.6-RELEASE
>Organization:
>Environment:
FreeBSD 4.6-RELEASE FreeBSD 4.6-RELEASE #0: Sat June 15 11:06:32 GMT2002    root@sema.baldwin.cx:/usr/src/sys/compile/GENERIC  alpha
>Description:
dhclient crashes whole machine (Cabriolet) on boot with the following error:

pid 48 (dhclient): unaligned access: va=0x11ffb08c pc=0x1200274e4 ra=0x12002740c op=ldt

fatal kernel trap:

     trap entry = 0x2 (memory management fault)
     a0         = 0x0
     a1         = 0x1
     a2         = 0xffffffffffffffff
     pc         = 0x0
     ra         = 0xfffffc0000610940
     curproc    = 0

panic: trap

syncing disks ....
fatal kernel trap:

     trap entry = 0x2
     a0         = 0x58
     a1         = 0x1
     a2         = 0x0
     pc         = 0xfffffc00005a9b84
     ra         = 0xfffffc00005b0d28
     curproc    = 0

panic: trap
>How-To-Repeat:
enable dhcp in rc.conf
>Fix:
      
>Release-Note:
>Audit-Trail:

From: Andrew Gallatin <gallatin@cs.duke.edu>
To: "Rob B" <rbyrnes@ozemail.com.au>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: alpha/41642: dhclient gives unaligned access on Alpha - causes kernel panic
Date: Thu, 22 Aug 2002 20:07:18 -0400 (EDT)

 Rob B writes:
  > > Do 'nm -n /kernel' and look for the area near 0xfffffc0000610940
  > >
  > 
  > aylee# nm -n /kernel | more
  > <snip>
  > fffffc00006108a0 T swi_null
  > fffffc00006108c0 T swi_generic
  > fffffc0000610900 t swi_net
  > fffffc0000610980 T do_sir
  > fffffc0000610ac0 T setdelayed
  > fffffc0000610b00 T setsofttty
  > fffffc0000610b40 T setsoftnet
  > 
 
 
 OK, this agees with my guess -- the arpintr netisr is not initialized.
 Peter fixed this in -current.  Can you please try the appended patch
 and see if it solves the problem?
 
 Thanks,
 
 Drew
 
 Index: netinet/if_ether.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/netinet/if_ether.c,v
 retrieving revision 1.64.2.19
 diff -u -r1.64.2.19 if_ether.c
 --- netinet/if_ether.c	18 Jun 2002 00:15:31 -0000	1.64.2.19
 +++ netinet/if_ether.c	23 Aug 2002 00:00:26 -0000
 @@ -102,7 +102,7 @@
  static	LIST_HEAD(, llinfo_arp) llinfo_arp;
  
  struct	ifqueue arpintrq = {0, 0, 0, 50};
 -static int	arp_inuse, arp_allocated;
 +static int	arp_inuse, arp_allocated, arpinit_done;
  
  static int	arp_maxtries = 5;
  static int	useloopback = 1; /* use loopback interface for local traffic */
 @@ -167,13 +167,10 @@
  	register struct sockaddr *gate = rt->rt_gateway;
  	register struct llinfo_arp *la = (struct llinfo_arp *)rt->rt_llinfo;
  	static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
 -	static int arpinit_done;
  
  	if (!arpinit_done) {
  		arpinit_done = 1;
 -		LIST_INIT(&llinfo_arp);
  		timeout(arptimer, (caddr_t)0, hz);
 -		register_netisr(NETISR_ARP, arpintr);
  	}
  	if (rt->rt_flags & RTF_GATEWAY)
  		return;
 @@ -912,3 +909,12 @@
  	ifa->ifa_rtrequest = arp_rtrequest;
  	ifa->ifa_flags |= RTF_CLONING;
  }
 +
 +static void
 +arp_init(void)
 +{
 +	LIST_INIT(&llinfo_arp);
 +	register_netisr(NETISR_ARP, arpintr);
 +}
 +
 +SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);
 				   
State-Changed-From-To: open->closed 
State-Changed-By: gallatin 
State-Changed-When: Mon Oct 21 13:52:22 PDT 2002 
State-Changed-Why:  
This has been fixed (in current: if_ether 1.95 and stable: if_ether 1.64.2.20) 
and this fix has been confirmed by others on the freebsd-alpha mailing lists. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=41642 
>Unformatted:
This has been fixed (in current: if_ether 1.95 and stable: if_ether 1.64.2.20)
and this fix has been confirmed by others on the freebsd-alpha mailing lists.
