md5sum makes unaligned word accesses...

ldoolitt at recycle.lbl.gov ldoolitt at recycle.lbl.gov
Tue May 9 21:55:44 PDT 2006


Guys -

On Wed, May 10, 2006 at 12:38:19AM -0400, Mike Frysinger wrote:
> On Tuesday 09 May 2006 23:56, Andre wrote:
> > (This is ARM specific and ensures that userspace alignment faults
> > don't cause silent data corruption... which unfortunately is the
> > default behaviour).
> 
> i'm pretty sure the kernel handles [unaligned access] sanely ...
> it would either fixup 
> the unaligned access or kill the process, not let "silent data corruption" 
> happen ... this also isnt an arm-specific issue as many other arches are anal 
> about accessing memory aligned

ARM is unique (AFAIK) in defining one proper semantic for unaligned
memory access to be "pretend the low order address bits are zero,
and carry on" (this is, of course, the simplest and fastest thing
for hardware to do).  Other architectures without hardware support
for unaligned access will trap and let the kernel emulate the more
complex cross-word access.

The C language standard says that unaligned access is not allowed.
Well, it's not that direct, but it's equivalent.  Something about
object types and daemons flying out your nose.  If busybox does
any of this, it's a bug.

> indeed, running `busybox dd if=/dev/zero bs=1 count=123 | busybox md5sum` on 
> some of my arm/amd64/ia64 machines yielded same correct result

All the world's a Vax, eh?

    - Larry


More information about the busybox mailing list