From: Adam J. R. <ad...@yg...> - 2001-12-16 10:46:38
|
I am not a SuperH developer, but here is some advice on how you might want to proceed. >From: Adrian McMenamin <ad...@mc...> >./sox: Killing process "sox" due to unaligned access >To be honest I still don't know enough about Linux development to know what >"unaligned access" is other than it sounds like a linker fix up problem. I imagine the error message came from do_address_error at line 473 of linux-2.5.1-pre1/arch/sh/kernel/traps.c (may be different for other kernels). By the way, here is a handy shell command for searching for error messages or other strings in the kernel source tree. When you have a mysterious error message, it is a good idea to try tis on the kernel and other potentially related source trees if you have them handy, like the sources for glibc and the applications that you were running. % find /usr/src/linux -type f | xargs egrep 'due to unaligned access' /usr/src/linux/arch/sh/kernel/traps.c: printk(KERN_NOTICE "Killing process \"%s\" due to unaligned access\n", current->comm); "unaligned access" sounds like an attempt to do a 32-bit access to an address that is not a multiple of 4 or 16-bit memory access to an address that is not a multiple of 2. Most architectures allow unaligned access from hardware, but some, apparently including SuperH, do not. From the source code near that error message in traps.c, it looks like the kernel emulates around ordinary unaligned reads and writes, but that there are a number number of cases where the kernel has to give up and generate this error, such as when jumping to an address that is an odd number. So, probably your next step is to add a few printk's to the different points of do_address_error that jump or fall through to the "uspace_segv:" label so you can see which case is actually generating the error. You might also want to print out the program counter ("regs->pc") to try to figure out what address is causing the problem (check with gdb or something). At the very least, you should get some idea of whether or not you were accessing an otherwise legitimate unaligned address or had jumped to a garbage address. Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104 ad...@yg... \ / San Jose, California 95129-1034 +1 408 261-6630 | g g d r a s i l United States of America fax +1 408 261-6631 "Free Software For The Rest Of Us." |