Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Roland Kruse <Roland.Kruse@powel.no>
Subject: Re: Unaligned access error.
Date: 1997/02/03	[thread overview]
Message-ID: <32F62945.3ACF@powel.no> (raw)
In-Reply-To: 32F61D97.3D6A@wlv.iipo.gtegsc.com


Allen M. Cohen wrote:
> 
> Tim Cochran wrote:
> >
> > Hello,
> >
> > I am compiling and running a program in C++ (gcc 2.7.2) under Digital UNIX
> > 3.2c.  When I run the program I get Unaligned access errors.  The program
> > does not crash, just print out these errors.  Does anyone know what this
> > means?  (Other programs I have written don't have this problem.)
> >
> > Thanks in advance,
> > Tim
> You need to step trough the program in gdb.

That answer is, while correct, a bit discouraging if the program in
question consists of some 500,000+ source lines.

You can use the information from the error message a bit more creatively
in gdb, I'll show an example:

The message looks like this:
Unaligned access pid=29382 <name> va=143703f7 pc=12130abc ra=12130a84
type=ldl

The most interesting address is the "pc", this is the program counter
where the error occurs. You set a breakpoint at this address like this
in gdb:

(gdb) b *0x12130abc
Breakpoint 1 at 0x12130abc: file buggy_file.c, line 753.

As you see, this immediately pin-pointed a code line. You won't always
be
that lucky but you can always run the program and it will stop at the
breakpoint. 

Im my experience, unaligned access messages always indicate something
seriously
wrong with the program (typically pointer arithmetics and/or casting
problems)
and should always be taken seriously.

hope this helps,

Roland Kruse



  reply	other threads:[~1997-02-03  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-03  5:00 Unaligned access error Tim Cochran
1997-02-03  5:00 ` Allen M. Cohen
1997-02-03  5:00   ` Roland Kruse [this message]
1997-02-06  5:00     ` Mark Bartelt
1997-02-04  5:00   ` Tim Mooney
1997-02-04  5:00     ` Tim Cochran
1997-02-04  5:00 ` Alexander Kogan
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