From owner-freebsd-alpha Fri Feb 16 12:45:19 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from altrade.nijmegen.inter.nl.net (altrade.nijmegen.inter.nl.net [193.67.237.6]) by hub.freebsd.org (Postfix) with ESMTP id 8A5C637B491 for ; Fri, 16 Feb 2001 12:45:14 -0800 (PST) Received: from ntpc by altrade.nijmegen.inter.nl.net via 1Cust33.tnt5.rtm1.nl.uu.net [213.116.104.33] with SMTP id VAA26837 (8.8.8/1.3); Fri, 16 Feb 2001 21:45:03 +0100 (MET) Reply-To: From: "Peter Blok" To: "'Terry Lambert'" Cc: "'Andrew Gallatin'" , Subject: RE: unaligned access Date: Fri, 16 Feb 2001 21:43:10 +0100 Message-ID: <000d01c09859$1383a600$8a02a8c0@ntpc> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <200102160013.RAA10748@usr08.primenet.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Just an update. I have found two problems. 1) mpd-netgraph has its own alloc routine that doesn't roundup the size to a 64 bit boundary. Easy to fix. 2) The other one was in the byte swapping area. That one puzzled me for a while. It turns out to be a compiler issue. When you allocate a pointer to a 33 bit long locally on the stack, it is not always aligned. The allocation was not done in the scope of the function, but within another scope under a case statement. I have removed the definition to the scope of the function, to check its value with gdb and it suddenly worked! I'm not getting any errors any more, but it still doesn't work yet. The next problem looks related to the select system-call. Any know problems with it? Peter -----Original Message----- From: owner-freebsd-alpha@FreeBSD.ORG [mailto:owner-freebsd-alpha@FreeBSD.ORG]On Behalf Of Terry Lambert Sent: Friday, February 16, 2001 01:14 To: Peter.Blok@inter.NL.net Cc: 'Terry Lambert'; 'Andrew Gallatin'; freebsd-alpha@FreeBSD.ORG Subject: Re: unaligned access > Thanks for the hints. One big cause was the embedded alloc routines, that > doesn't do aligning. The next buffer allocated was unaligned, because the > previous size was unaligned. I haven't looked closely enough to the > structures. I also had one unaligned access in a varargs construction. > Haven't found the cause yet. Andrew is the "big guns" when it comes to Alpha work; I'm just someone on the sidelines. But remember that your problem is not the fixups themselves, but that the code does not operate in the presence of fixups, which it should. This implies the operational problem has nothing to do with the fixups, and is instead related to some other problem. My money is still on structure packing in the user space code; if you ensure that it isn't a problem by using "#pragma pack(1)", then I suspect your code will work, even though the console will still whine about unaligned access errors. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message