From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,e54ad94713e9c3f0,start X-Google-Attributes: gid111c93,public From: wai-sun.chia@digital.com (Wai-Sun Chia) Subject: How to get rid of unaligned traps (finally) Date: 1998/06/12 Message-ID: <3581fbf8.5003264@usenet.pa.dec.com>#1/1 X-Deja-AN: 362012849 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: Digital Equipment Corporation, Palo Alto, CA, USA Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha People, Like most of you, I'm annoyed to hell of the pesky unaligned traps which occurs with certain commands/utilities (I'm running RH5.1 on an AS200 4/166)... It turns out, that on 64bit Alpha systems, memory must be aligned (see pg 8 of Linux/Alpha FAQ); i.e. memory accesses (read & write) must be in multiples -> you cannot declare a longword (Alpha jargon for 64bit quantity), and then read it to a quadword (Alpha for 32bit). Example of a longword is "long" and example of a quadword is "int". But the kernel is flexible enough to accomodate that (how exactly it is being done is at the black magic level and as I'm not a kernel guru I would not be able to shed any light on that this :-( ... Thus, the offending program/utility will _STILL_ run but the kernel will be impacted by varying degrees on performance degradation... Commenting out the printk statements from the kernel and upping the syslog level is just cosmetic, the kernel still gets impacted. If you're like me using _JUST_ a 166MHz system, you'd also want to milk all the performance that you can get. Netstat is a very common culprit of "unaligned traps", even the one which came with RH5.1 !! **** This version of netstat came with RH5.1 **** # netstat -V Linux NET-3 Base Utilities Source: net-tools 1.33 net-tools@lina.inka.de (Bernd Eckenfels) Kernelsource: 2.0.30 netstat 1.23 (1997-05-19) Fred Baumgarten and Alan Cox. +NEW_ADDRT +RTF_IRTT +RTF_REJECT +FW_IPMASQUERADE -NLS AF:(inet) +UNIX +INET +IPX +AX25 +NETROM +ATALK HW: +ETHER +ARC +SLIP +PPP +TUNNEL +TR +AX25 +NETROM +FR **** This is what was logged **** Jun 11 18:33:47 nexus kernel: netstat(878): unaligned trap at 00000200001615fc: 000000011ffff824 2d 10 Jun 11 18:33:47 nexus kernel: netstat(878): unaligned trap at 00000200001615fc: 000000011ffff834 2d 10 Jun 11 18:33:47 nexus kernel: netstat(878): unaligned trap at 00000200001615fc: 000000011ffff824 2d 10 Jun 11 18:33:47 nexus kernel: netstat(878): unaligned trap at 00000200001615fc: 000000011ffff834 2d 10 The unaligned traps will be solved with a combination of the latest version of compilers/loaders. This implies that any libraries used must also be compiled with these compilers. Assuming you're running RH5.1 (comes with egcs-1.0.2), upgrade your compiler to egcs-1.0.3a and you're basically done. This is as RH5.1 binutils are the latest. So grab the latest source of your offending program/utility and rebuild it using your newly installed egcs and these pesky "unaligned traps" messages will be a thing of the past and your kernel will be running at full speed. As an aside, I grabbed the latest copy of net-tools and compiled it using egcs-1.0.3a, and VOILA! NO MORE UNALIGNED TRAPS!!! **** This is the latest and greatest net-tools **** # ./netstat -V net-tools 1.45 netstat 1.26 (1998-03-02) Fred Baumgarten and Alan Cox. +NEW_ADDRT +RTF_IRTT +RTF_REJECT +RT_NETLINK -FW_MASQUERADE -NLS AF:(inet) +UNIX +INET -INET6 +IPX -AX25 -NETROM +ATALK HW: +ETHER -ARC -SLIP +PPP -TUNNEL -TR -AX25 -NETROM -FR Good Hunting! May you never see unaligned traps again! HTH, Wai-Sun