Subject: pkg/12417: digest problem with sha1 on alpha, unaligned access
To: None <gnats-bugs@gnats.netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-bugs
Date: 03/15/2001 18:02:22
>Number:         12417
>Category:       pkg
>Synopsis:       digest problem with sha1 on alpha, unaligned access
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 15 15:03:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     TheMan
>Release:        -current
>Organization:
none
>Environment:
	
System: NetBSD tweedlebsd 1.5S NetBSD 1.5S (FROGS) #5: Wed Mar  7 13:04:03 EST 2001     andrew@tweedlebsd:/usr/src/sys/arch/alpha/compile/FROGS alpha

>Description:

when using digest to computer sha1 hashes, i get tons of spewage on my
terminal that looks like this:

pid 1745 (digest): unaligned access: va=0x12012287f pc=0x120006170 ra=0x466f6f0b4e op=ldl
pid 1745 (digest): unaligned access: va=0x12012287f pc=0x120006208 ra=0x120122867 op=stl

>How-To-Repeat:

% cd /usr/pkgsrc/pkgtools/digest
% make
% echo foo > foo
% ./work.alpha/digest sha1 foo
...[SPEW]...
SHA1 (foo) = f1d2d2f924e986ac86fdf7b36c94bcdf32beec15

>Fix:

this is dopey but it works.  actually, it points out that digest isn't
really the problem, but that the c library is.

% printf '/sha1\ni\nSRCS+=shafoo.c\n.\nw\nq\n' | ed work.alpha/Makefile
% touch work.alpha/shafoo.c
% cp /usr/obj/alpha/lib/libc/sha1.o work.alpha/shafoo.o
% rm work.alpha/.build_done
% make
% ./work.alpha/digest sha1 foo
SHA1 (foo) = f1d2d2f924e986ac86fdf7b36c94bcdf32beec15

which eliminates the spew.
>Release-Note:
>Audit-Trail:
>Unformatted: