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: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Subject: Re: Unaligned access error. Date: 1997/02/04 Message-ID: <5d6rdp$9o4@dogbert.cc.ndsu.NoDak.edu>#1/1 X-Deja-AN: 214325159 references: <01bc11da$7335f530$c9d992cf@pluto> <32F61D97.3D6A@wlv.iipo.gtegsc.com> content-type: text/plain; charset=US-ASCII organization: North Dakota Higher Education Computing Network (NDHECN) mime-version: 1.0 newsgroups: comp.unix.osf.osf1 In article <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. To expand on what Allen said ( :-) ), `man uac' to read about unaligned accesses. Essentially, you're accessing data that's not aligned on the proper byte boundaries. As Allen indicated, the best way to find out where the problems are is to run the program under the control of a debugger (dbx and ladebug work fine too). From your prompt, as yourself (not root), do: uac p sigbus to cause unaligned accesses to generate a bus error. Then run your program under control of gdb. Gdb will catch the bus error and show you exactly where it happened. BTW, this is all mentioned in the FAQ for this newsgroup. Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J1, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164