Hi Daniel,

Thanks for the guest access to your sparc 64 system.  The problem with
stat_driver is intermittent.  The attached patch appears to resolve the
problem, can you confirm using your view?  It looks like the nonce value
is never initialized to zero.  This intermittently results in garbage
being used for the nonce value.

Thanks,
John


On 07/19/2013 05:16 AM, Daniel Pocock wrote:
> On 19/07/13 01:39, John Foley wrote:
>> With respect to the master branch, you should be able to avoid the patch
>> and compile with -DFORCE_64BIT_ALIGN.  The patch provides no value in
>> the master branch. 
> The version I am testing is the Debian git master, it is the same as
> master on github but with some local patches:
>
> http://anonscm.debian.org/gitweb/?p=collab-maint/srtp.git;a=tree;f=debian/patches;hb=HEAD
>
> Without FORCE_64BIT_ALIGN  and without the patch mentioned below (patch
> ID 2002 in Debian): I get the bus error in the test
>
> crypto/tests/cipher_driver
>
>
>
> With FORCE_64BIT_ALIGN  and without the patch mentioned below (patch ID
> 2002 in Debian): no more bus error, it fails in the test
>
> test/stat_driver  (although running the test a second time it passes)
>
>
> With FORCE_64BIT_ALIGN  and patch ID 2002 (remove pad, add algorithm to 
> cipher_t) the tests all pass on the first run
>
> If it helps, we can provide a guest account on the Debian sparc test machine 
> if you would be able to try this directly.
>
>
>> I'll need to address this problem in the openssl-feature branch.  There
>> should be no need to force the 64-bit alignment when the cipher_t struct
>> contains the 'algorithm' field. 
>>
>> Regarding x86_64, I have tested this platform and have never seen an
>> issue in this code.  The compiler is likely doing the alignment
>> automatically, knowing that it's compiling for a 64 bit target. 
>>
>>
>>
>> On 07/18/2013 06:02 PM, Daniel Pocock wrote:
>>> On 18/07/13 23:46, Michael Jerris wrote:
>>>> If you don't remove that block from the code after that other var was 
>>>> added… it will cause this error to come back on that branch now that 
>>>> you've forced the 64bit align
>>>>
>>> Ok, patching it like this:
>>>
>>> --- a/crypto/include/cipher.h
>>> +++ b/crypto/include/cipher.h
>>> @@ -161,8 +161,9 @@ typedef struct cipher_t {
>>>    void          *state;
>>>    int            key_len;
>>>  #ifdef FORCE_64BIT_ALIGN
>>> -  int            pad;
>>> +  //int            pad;
>>>  #endif
>>> +  int algorithm;
>>>  } cipher_t;
>>>
>>>
>>> and using
>>>
>>> CFLAGS += -DFORCE_64BIT_ALIGN
>>>
>>> gives me an successful runtest on sparc first time around.  The build
>>> still fails later during the doc phase on sparc, but that is unrelated
>>> to all this.
>>>
>>> I also tested on amd64 / x86_64 without FORCE_64BIT_ALIGN and it builds
>>> successfully.
>>>
>>> .
>>>
> .
>

diff --git a/crypto/test/stat_driver.c b/crypto/test/stat_driver.c
index f9d75b7..145cd02 100644
--- a/crypto/test/stat_driver.c
+++ b/crypto/test/stat_driver.c
@@ -51,6 +51,7 @@ main (int argc, char *argv[]) {
 
   printf("statistical tests driver\n");
 
+  v128_set_to_zero(&nonce);
   for (i=0; i < 2500; i++)
     buffer[i] = 0;

Reply via email to