Bug 113556 - [panic] trap: memory address not aligned; Rebooting...
Summary: [panic] trap: memory address not aligned; Rebooting...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: sparc64 (show other bugs)
Version: 6.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alexander Motin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-11 09:10 UTC by kes-kes
Modified: 2010-04-15 14:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kes-kes 2007-06-11 09:10:03 UTC
This two commands is a cause of server rebooting:
sysctl net.link.ether.bridge.enable=1
sysctl net.link.ether.bridge.config=rl0,rl1

------------------------------------
This also rebooting the server.
Here my mailing with mpd-users@

 >KES wrote:
 >> Hi.
 >> My machine is:
 >> FreeBSD 6.2-STABLE #1: Tue Apr  3 08:42:50 EEST 2007
 >>     
 >> Timecounter "tick" frequency 360000000 Hz quality 1000
 >> real memory  = 201326592 (192 MB)
 >> avail memory = 178716672 (170 MB)
 >> cpu0: Sun Microsystems UltraSparc-IIi Processor (360.00 MHz CPU)
 >
 >MPD version? I've tested 4.1 on same arch and it works fine for me.
 >
 >> Connecting to mpd causing server to REBOOT
 >> mpd.links
 >> -------------------
 >> pptp0:
 >>     set link type pptp
 >> 
 >> mpd.conf
 >> -------------------
 >> default:
 >>     load pptp0
 >> pptp0:
 >>     new -i ng00 pptp0 pptp0
 >>     load pptp_standart
 >> pptp_standart:
 >>     set iface disable on-demand
 >>     set bundle disable multilink
 >>     set link no pap
 >>     set link enable chap
 >>     set link keep-alive 60 180
 >>     set ipcp yes vjcomp
 >>     #XXXX and YYYY -- my IP addresses
 >>     set ipcp dns 1.2.3.4
 >>     set ipcp dns 5.6.7.8
 >>     set iface disable proxy-arp
 >>     set pptp enable incoming
 >>     set pptp disable originate
 >>     set link yes acfcomp protocomp
 >>     log +auth
 >
 >Try looking at the console. The problem can be caused not directly by 
 >mpd. What exactly says kernel when failing?
 
 
 #####################
 NEXT MAIL
 #####################
 
 My mpd Version is:
 [root@sparc /usr/home/aldec]# mpd4 -v
 Version 4.1 (root@sparc.aldec.com.pl 14:10 29-Mar-2007)
 
 I have ran mpd4 and try to connect from WinXP SP2.
 [root@sparc /]# mpd4 > /vpntest
 after server fail
 [root@sparc /]# cat /vpntest
 Multi-link PPP daemon for FreeBSD
 process 1378 started, version 4.1 (root@sparc.aldec.com.pl 14:10
 29-Mar-2007)
 
 Label 'startup' not found
 [pptp0] using interface ng0
 [pptp1] using interface ng1
 PPTP connection from 192.168.0.1 4765
 pptp0: attached to connection with 192.168.0.1 4765
 [pptp0] Accepting PPTP connection
 [pptp0] opening link "pptp0"...
 [pptp0] link: OPEN event
 [pptp0] LCP: Open event
 [pptp0] LCP: state change Initial --> Starting
 [pptp0] LCP: LayerStart
 [pptp0] attaching to peer's outgoing call
 [pptp0] link: UP event
 [pptp0] link: origination is remote
 [pptp0] LCP: Up event
 [pptp0] LCP: state change Starting --> Req-Sent
 [pptp0] LCP: SendConfigReq #1
  ACFCOMP
  PROTOCOMP
  MRU 1500
  MAGICNUM c62da0c6
  AUTHPROTO CHAP MSOFTv2
 pptp0-0: ignoring SetLinkInfo
 [pptp0] LCP: rec'd Configure Request #0 link 0 (Req-Sent)
  MRU 1400
  MAGICNUM 619e59e8
  PROTOCOMP
  ACFCOMP
  CALLBACK
    Not supported
 [pptp0] LCP: SendConfigRej #0
  CALLBACK
 [pptp0] LCP: rec'd Configure Request #1 link 0 (Req-Sent)
  MRU 1400
  MAGICNUM 619e59e8
  PROTOCOMP
  ACFCOMP
 [pptp0] LCP: SendConfigAck #1
  MRU 1400
  MAGICNUM 619e59e8
  PROTOCOMP
  ACFCOMP
 [pptp0] LCP: state change Req-Sent --> Ack-Sent
 
 
 [root@sparc /] cat /var/log/dmesg.today
 panic: trap: memory address not aligned
 Uptime: 1d5h46m18s
 Cannot dump. No dump device defined.
 Automatic reboot in 15 seconds - press a key on the console to abort
 Rebooting...
 Copyright (c) 1992-2007 The FreeBSD Project.
 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
         The Regents of the University of California. All rights reserved.
 FreeBSD is a registered trademark of The FreeBSD Foundation.
 FreeBSD 6.2-STABLE #1: Tue Apr  3 08:42:50 EEST 2007
     root@sparc.aldec.com.pl:/usr/obj/usr/src/sys/KES_KERN_SUN_v6
 module_register: module ng_mppc already exists!
 Module ng_mppc failed to register: 17
 Timecounter "tick" frequency 360000000 Hz quality 1000
 
 #########
 NEXT MAIL
 #########
 
 >KES wrote:
 >> My mpd Version is:
 >> [root@sparc /usr/home/aldec]# mpd4 -v
 >> Version 4.1 (root@sparc.aldec.com.pl 14:10 29-Mar-2007)
 >
 >> [root@sparc /] cat /var/log/dmesg.today
 >> panic: trap: memory address not aligned
 >
 >This is your pain. Some netgraph modules should be rewrited because they 
 >   do address memory the way sparc don't adore. At least I'm sure that 
 >ng_netflow is unusable on sparc.
 >
 >Try recompiling kernel without most NETGRAPH modules. You actually need 
 >only this 2 lines in your kernel config for mpd to work:
 >
 >options NETGRAPH
 >options NETGRAPH_ETHER
 >
 >All other modules would be loaded automatically.
 
 #######
 NEXT MAIL
 #######
 
 I have recompiled kernel.
 Server still rebooting. But mpd seems fail earlier
 
 #cat /vpntest
 Multi-link PPP daemon for FreeBSD
 process 1044 started, version 4.1 (root@sparc.aldec.com.pl 14:10
 29-Mar-2007)
 
 Label 'startup' not found
 [pptp0] using interface ng0
 [pptp1] using interface ng1

How-To-Repeat: 1) 
sysctl net.link.ether.bridge.enable=1
sysctl net.link.ether.bridge.config=rl0,rl1

2) Install mpd and UP vpn link
after connection server goes down
Comment 1 Alexander Motin freebsd_committer freebsd_triage 2010-04-01 16:12:11 UTC
State Changed
From-To: open->patched

Set of patches committed to HEAD. 


Comment 2 Alexander Motin freebsd_committer freebsd_triage 2010-04-01 16:12:11 UTC
Responsible Changed
From-To: freebsd-sparc64->mav

I'll track it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2010-04-15 13:39:12 UTC
Author: mav
Date: Thu Apr 15 12:38:55 2010
New Revision: 206657
URL: http://svn.freebsd.org/changeset/base/206657

Log:
  NFC r206000:
  Make ng_ppp fulfill upper protocol stack layers alignment requirements
  on platforms with strict alignment constraints.
  This fixes kernel panics on arm and probably other architectures.
  
  PR:             sparc64/80410, sparc/118932, sparc/113556

Modified:
  stable/8/sys/netgraph/ng_ppp.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netgraph/ng_ppp.c
==============================================================================
--- stable/8/sys/netgraph/ng_ppp.c	Thu Apr 15 12:30:46 2010	(r206656)
+++ stable/8/sys/netgraph/ng_ppp.c	Thu Apr 15 12:38:55 2010	(r206657)
@@ -907,7 +907,21 @@ ng_ppp_proto_recv(node_p node, item_p it
 	const priv_p priv = NG_NODE_PRIVATE(node);
 	hook_p outHook = NULL;
 	int error;
+#ifdef ALIGNED_POINTER
+	struct mbuf *m, *n;
 
+	NGI_GET_M(item, m);
+	if (!ALIGNED_POINTER(mtod(m, caddr_t), uint32_t)) {
+		n = m_defrag(m, M_NOWAIT);
+		if (n == NULL) {
+			m_freem(m);
+			NG_FREE_ITEM(item);
+			return (ENOBUFS);
+		}
+		m = n;
+	}
+	NGI_M(item) = m;
+#endif /* ALIGNED_POINTER */
 	switch (proto) {
 	    case PROT_IP:
 		if (priv->conf.enableIP)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 4 dfilter service freebsd_committer freebsd_triage 2010-04-15 13:41:52 UTC
Author: mav
Date: Thu Apr 15 12:41:36 2010
New Revision: 206660
URL: http://svn.freebsd.org/changeset/base/206660

Log:
  MFC r206017:
  Make ng_ksocket fulfill lower protocol stack layers alignment requirements
  on platforms with strict alignment constraints.
  This fixes kernel panics on arm and probably other architectures.
  
  PR:             sparc64/80410, sparc/118932, sparc/113556

Modified:
  stable/8/sys/netgraph/ng_ksocket.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netgraph/ng_ksocket.c
==============================================================================
--- stable/8/sys/netgraph/ng_ksocket.c	Thu Apr 15 12:40:33 2010	(r206659)
+++ stable/8/sys/netgraph/ng_ksocket.c	Thu Apr 15 12:41:36 2010	(r206660)
@@ -902,12 +902,24 @@ ng_ksocket_rcvdata(hook_p hook, item_p i
 	struct sockaddr *sa = NULL;
 	int error;
 	struct mbuf *m;
+#ifdef ALIGNED_POINTER
+	struct mbuf *n;
+#endif /* ALIGNED_POINTER */
 	struct sa_tag *stag;
 
 	/* Extract data */
 	NGI_GET_M(item, m);
 	NG_FREE_ITEM(item);
-
+#ifdef ALIGNED_POINTER
+	if (!ALIGNED_POINTER(mtod(m, caddr_t), uint32_t)) {
+		n = m_defrag(m, M_NOWAIT);
+		if (n == NULL) {
+			m_freem(m);
+			return (ENOBUFS);
+		}
+		m = n;
+	}
+#endif /* ALIGNED_POINTER */
 	/*
 	 * Look if socket address is stored in packet tags.
 	 * If sockaddr is ours, or provided by a third party (zero id),
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 5 Alexander Motin freebsd_committer freebsd_triage 2010-04-15 14:16:21 UTC
State Changed
From-To: patched->closed

Patches merged to 8-STABLE.