> During "make test" of latest CVS revision OpenSSL_0_9_8-stable, the
> sha512 test fails on a segmentation fault in sha512_block_data_order():
> 
> | ../util/shlib_wrap.sh ./sha512t
> | make[1]: *** [test_sha] Segmentation fault (core dumped)
> | make[1]: Leaving directory `/tmp/openssl-0.9.8-cvs/test'
> | make: *** [tests] Error 2
> 
> Note OpenSSL release 0.9.8g works OK. Output of "make report" comes
> attached as testlog.gz

The only difference between sha512 in 098g and 098cvs is byte swapping 
inline assembler. As your compiler is rather old (2.7.2 according to 
testlog), I'd guess it's a compiler bug. Could you collect disassembler 
output for offending code? I.e. run 'gdb test/sha512t core' (or rather 
util/shlib_wrap.sh gdb test/sha512t as you have build for shared), run 
'where', note address, run 'disassemble' and advance to just noted 
address. Submit *complete* disassemble output from function start to 
offending instruction. Test attached patch. Drop optimization level... A.

Index: crypto/sha/sha512.c
===================================================================
RCS file: /e/openssl/cvs/openssl/crypto/sha/sha512.c,v
retrieving revision 1.8.2.3
diff -u -r1.8.2.3 sha512.c
--- crypto/sha/sha512.c	11 Nov 2007 13:34:07 -0000	1.8.2.3
+++ crypto/sha/sha512.c	22 Apr 2008 13:58:22 -0000
@@ -327,10 +327,10 @@
 				((SHA_LONG64)hi)<<32|lo;	})
 #   else
 #    define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\
-			unsigned int hi,lo;			\
+			unsigned int hi=p[0],lo=p[1];		\
 				asm ("bswapl %0; bswapl %1;"	\
 				: "=r"(lo),"=r"(hi)		\
-				: "0"(p[1]),"1"(p[0]));		\
+				: "0"(lo),"1"(hi));		\
 				((SHA_LONG64)hi)<<32|lo;	})
 #   endif
 #  elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64)

Reply via email to