Unaligned access fault in fxp on alpha
Maxime Henrion
mux at freebsd.org
Sat May 10 15:16:14 PDT 2003
Andrew Gallatin wrote:
>
> Kris Kennaway writes:
> > I reported this to mux 3 days ago, but haven't heard any
> > acknowledgement from him of the issue. Could someone else
> > investigate? This is a reproducible panic.
> >
>
> Can you try this patch please?
>
> It causes gcc to emit slightly different code, which deals with
> storing to aligned 16-bit values.
>
> What's happening is that because the u_int32_t link_addr (and rbd_addr)
> fields preceded the "size" field, gcc was assuming that the rfa struct
> would be aligned and was cheating. It was using operations which only
> work on aligned-32 bit values on 16-bit values. Removing the
> u_int32_t's disabuses gcc of this assumption, therby causing safe
> code to be emitted.
>
> I don't understand why mux changed these fields in rev 1.31, with, so
> I'm not sure that I want to commit this until mux reviews it. For all
> I know, it breaks sparc64 or something..
Thanks Andrew, I should have taken care of this since some time but was
veyr busy these days.
I removed them because they were just looking bogus. I wanted to ask
people to test a patch adding a __packed in the struct definition to see
if it fixed things. If it works with a __packed keyword, I'd like
it better than going back to having an array of four u_int8_t.
Otherwise I'll put the u_int8_t back.
Cheers,
Maxime
More information about the freebsd-alpha
mailing list