Bug 41642

Summary: dhclient gives unaligned access on Alpha - causes kernel panic
Product: Base System Reporter: Rob Byrnes <rbyrnes>
Component: alphaAssignee: freebsd-alpha (Nobody) <alpha>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.6-RELEASE   
Hardware: Any   
OS: Any   

Description Rob Byrnes 2002-08-14 00:00:09 UTC
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
Comment 1 Andrew Gallatin 2002-08-23 01:07:18 UTC
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);
Comment 2 Andrew Gallatin freebsd_committer freebsd_triage 2002-10-21 21:52:22 UTC
State Changed
From-To: open->closed

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.