From: Oscar Levi <elf@buici.com>
To: axp-list@redhat.com
Subject: Re: How do I find/fix unaligned accesses?
Date: Fri, 4 Dec 1998 13:16:16 -0800 [thread overview]
Message-ID: <19981204131616.A24274@hazel.buici.com> (raw)
In-Reply-To: <yv4lnkng3xw.fsf@tuxedo.applix.com>; from Eric Ding on Fri, Dec 04, 1998 at 01:25:15PM -0500
On Fri, Dec 04, 1998 at 01:25:15PM -0500, Eric Ding wrote:
> Hi all,
>
> I've read the FAQ about unaligned accesses on Alpha Linux. My question is,
> now that I've got a whole log full of errors about unaligned accesses, how
> do I go about tracking down the actual place in the code that's causing the
> problem?
>
> I see, for example,
>
> axmain(521): unaligned trap at 0000000120472178: 000000011ffff2f4 2d 2
>
> in /var/log/messages. Now what? Help me get Applixware for Linux/Alpha
> out the door! :)
What you do is get the source, apply the appropriate patches, build it
and use a command like this to find the symbol:
nm program | sort | less
Once you have this, you know the name of the errant routine. Then,
you generate an assembly language listing of the file with that
routine.
gcc ${CFLAGS} -S sourcefile.c
And generate an assembler listing file.
as -a sourcefile.s > sourcefile.lst
Now, you have something. Find the first address of the routine in the
listing, call this value A1. Take the base address of the symbol from
the symbol output of nm, call this value A2, and the faulting address
A3. The address in the listing where the problem occurs is A2 - A3 +
A1.
Now, I've done this many times. For some reason, I'm not getting the
exact instruction where the fault occurs. Last I checked, I was
getting the instruction after it. It is likely that my algorithm is
wrong somewhere, but it gets you close.
You can also load the program into gdb and use
disass *<fault address>
to get an assembly language listing of the problem instruction.
Cheers.
next prev parent reply other threads:[~1998-12-04 21:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-12-04 18:25 How do I find/fix unaligned accesses? Eric Ding
1998-12-04 21:16 ` Oscar Levi [this message]
1998-12-04 21:17 ` nbecker
1998-12-04 21:18 ` Harvey J. Stein
1998-12-04 21:35 ` Rich Payne
1998-12-05 2:29 ` Tom Linden
1998-12-05 16:37 ` Oscar Levi
1998-12-07 23:45 ` Eric Ding
1998-12-08 0:44 ` Richard Hadsell
1998-12-08 1:07 ` Uncle George
1998-12-08 3:58 ` Eric Ding
1998-12-08 7:16 ` Wes Bauske
1998-12-08 11:14 ` Uncle George
1998-12-08 13:04 ` nbecker
-- strict thread matches above, loose matches on Subject: below --
1998-12-08 21:13 Christian Groessler
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox