From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,cc057588f5f2521c X-Google-Attributes: gidfee84,public From: Roland Kruse Subject: Re: Unaligned access error. Date: 1997/02/03 Message-ID: <32F62945.3ACF@powel.no>#1/1 X-Deja-AN: 214324207 references: <01bc11da$7335f530$c9d992cf@pluto> <32F61D97.3D6A@wlv.iipo.gtegsc.com> content-type: text/plain; charset=us-ascii organization: Powel Data AS mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 3.0 (WinNT; I) 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 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