[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Frequent "unaligned access", an init that dies, ...

On Thu, 23 Oct 1997, Branden Robinson wrote:

> According to my roommate, who runs a Red Hat Linux on his Alpha, this is a
> bug at the program level.  Specifically, many programs try to do 8- or
> 16-bit memory accesses.  These often cause misaligned memory accesses on
> the Alpha's 64-bit architecture.

An update to this, we've solved his problem on the Debian-Alpha list.  It
turns out that he was using the stock DEC Tulip driver (by Donald Becker)
which needed to be patched for the Alpha.  I'm working on submitting a
patch for inclusion in Donald's upstream driver source to keep this
question from recurring.  It seems all of us knew about it for awhile now,
but nobody has managed to get it fixed for good.

> The hardware generates an exception, which the kernel catches, and while it
> spits out the warning, it does multiple memory accesses to get all the
> required data and shuffles the registers around to produce what the program
> expected.
> This slows things down, but is not fatal.  Basically it's the product of
> programmers not being prepared for a 64-bit system when building their data
> structures, and possibly gcc not being intelligent enough in reorganizing
> them for optimization.

After a lengthy discussion with Richard Henderson, gcc isn't to blame.  In
most cases, you're correct about programmers not making their software
64-bit-friendly, but in quite a few cases (as I've discovered lately), the
kernel itself is to blame (IPX support, ext2fs structures, etc all can
cause unaligned trap warnings).  A good set of assembly byte-read/write
routines would solve alot of our problems.  Also, if gcc could be improved
to generate more optimised code for the specific members of the Alpha
family as we see with x86/P5/P6 (we supposedly will see this in egcs
and/or gcc 2.8), then that would at least be a start :)

> In this specific case, the unaligned access is generated by the kernel
> itself, though many other programs can and do cause them.

If it's any help to anyone here, check the following URL for info on how
the Alpha architecture differs from the x86 from a programmer's

FYI, the Alphas are extremely picky about alignment boundaries, so bear
that in mind if you're trying to make your software more portable.

> This breakdown is care of roommate, whose recollection may be inaccurate;
> it would probably be wise to check with gurus if more exacting (and
> confident) information is required.

If you want the best source for how these warnings are
formatted/generated, check the kernel source.  It's commented pretty well.

 Christopher C. Chimelis          chris@classnet.med.miami.edu
 Systems Supervisor
 Division of Biomedical Communications
 University of Miami School of Medicine
 --> finger chris@classnet.med.miami.edu for PGP public key <--

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . Trouble? 
e-mail to templin@bucknell.edu .

Reply to: