Date: Fri, 12 May 2000 15:10:06 +0300 From: Valentin Nechayev <netch@lucky.net> To: freebsd-alpha@FreeBSD.ORG Subject: Re: How to fix unaligned access errors? Message-ID: <20000512151005.A938@lucky.net> In-Reply-To: <14617.21495.418598.708837@grasshopper.cs.duke.edu>; from gallatin@cs.duke.edu on Wed, May 10, 2000 at 08:21:50AM -0400 References: <20000510135444.A65751@fettuccini.unix-ag.uni-kl.de> <14617.21495.418598.708837@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Wed, May 10, 2000 at 08:21:50, gallatin wrote about "Re: How to fix unaligned access errors?": > > You start a program, the kernel throws a million "unaligned access" > > errors. > > > > How do you go about finding and fixing those in the source? > > > > See uac(1) > > In the parent shell, say "uac -s" This will cause a SIGBUS to be sent > to any children of this shell when they generate an unaligned access. > You should now be able to debug it. netch@aleph:~/tmp/4>cat 4.cc #include <iostream> #include <iomanip> char buf[10]; int main() { std::cout << "Enter text:" << flush; return 0; } netch@aleph:~/tmp/4>gcc -o 4 -g 4.cc -lstdc++ netch@aleph:~/tmp/4>( uac -s && ./4 ) parent printing is on parent fixup is on parent sigbus is on pid 14086 (4): unaligned access: va=0x1600b9564 pc=0x160020af4 ra=0x160020c60 op =ldq netch@aleph:~/tmp/4>gdb 4 4.core GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alpha-unknown-freebsd"... Core was generated by `4'. Program terminated with signal 10, Bus error. Reading symbols from /usr/lib/libstdc++.so.3...done. Reading symbols from /usr/lib/libc.so.4...done. Reading symbols from /usr/lib/libm.so.2...done. Reading symbols from /usr/libexec/ld-elf.so.1...done. #0 0x160020af4 in debug_printf () from /usr/libexec/ld-elf.so.1 (gdb) bt #0 0x160020af4 in debug_printf () from /usr/libexec/ld-elf.so.1 #1 0x160020c60 in reloc_non_plt () from /usr/libexec/ld-elf.so.1 Cannot access memory at address 0xfffffffffffffffd. (gdb) q netch@aleph:~/tmp/4>gcc -v Using builtin specs. gcc version 2.95.2 19991024 (release) netch@aleph:~/tmp/4>uname -mrs FreeBSD 4.0-STABLE alpha World sources date: 2000-05-02. C programs work correctly. -- NVA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000512151005.A938>