Subject: Re: unusual panics on NetBSD/alpha 3.0_* and 4.0_BETA
To: Simon Burge <simonb@NetBSD.org>
From: David Laight <david@l8s.co.uk>
List: port-alpha
Date: 10/08/2006 12:28:24
On Sat, Oct 07, 2006 at 04:38:01PM +1000, Simon Burge wrote:
> 
> This looks like it happened in netinet/tcp_sack.c at:
> 
>         for (i = 0; i < num_sack_blks; i++, lp += 2) {
>                 memcpy(&left, lp, sizeof(*lp));
>                 memcpy(&right, lp + 1, sizeof(*lp));
> --->            left = ntohl(left);
>                 right = ntohl(right);
...
> I think that it looks like gcc is optimising the memcpy out and doing an
> unaligned load directly.  We probably need some sort of qualifier on a
> variable somewhere?

The code will be breaking the 'anti-aliasing' rules.
Given the amount of code that a naive compilation of the above will give,
it may be best just to load the 4 bytes and 'ir' the values together.

	David

-- 
David Laight: david@l8s.co.uk