Last Comment Bug 424471 - counter overflow in bltest
: counter overflow in bltest
Status: RESOLVED FIXED
:
Product: NSS
Classification: Components
Component: Tools (show other bugs)
: trunk
: x86 SunOS
: P3 normal (vote)
: 3.12
Assigned To: Julien Pierre
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-21 18:13 PDT by Julien Pierre
Modified: 2008-03-21 19:01 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
cast to PRInt64 to solve this problem (647 bytes, patch)
2008-03-21 18:25 PDT, Julien Pierre
nelson: review+
Details | Diff | Review

Description Julien Pierre 2008-03-21 18:13:30 PDT
There is some kind of wrapping problem for the data in using bltest.
See below :

[jp96085@monstre]/export/home/julien/nss/tip/mozilla/dist/SunOS5.10_i86pc_64_OPT.OBJ/bin 47 % !22
./bltest -E -m rc4 -g 16 -p 100 -4 2 -i ./bltest -o /dev/null
#     mode          in symmkey  opreps  cxreps     context          op   time(sec)     thrgput
     rc4_e       698Mb     128     200       0       0.000    2212.000       1.147       609Mb
[jp96085@monstre]/export/home/julien/nss/tip/mozilla/dist/SunOS5.10_i86pc_64_OPT.OBJ/bin 48 % ./bltest -E -m rc4 -g 16 -p 100 -4 2 -i ./bltest -o /dev/null
#     mode          in symmkey  opreps  cxreps     context          op   time(sec)     thrgput
     rc4_e       698Mb     128     200       0       0.000    2242.000       1.142       611Mb
[jp96085@monstre]/export/home/julien/nss/tip/mozilla/dist/SunOS5.10_i86pc_64_OPT.OBJ/bin 49 % ./bltest -E -m rc4 -g 16 -p 10000 -4 2 -i ./bltest -o /dev/null
#     mode          in symmkey  opreps  cxreps     context          op   time(sec)     thrgput
     rc4_e         4Gb     128     20T       0       0.000  220783.000     112.386        38Mb
[jp96085@monstre]/export/home/julien/nss/tip/mozilla/dist/SunOS5.10_i86pc_64_OPT.OBJ/bin 50 % ./bltest -E -m rc4 -g 16 -p 1000 -4 2 -i ./bltest -o /dev/null
#     mode          in symmkey  opreps  cxreps     context          op   time(sec)     thrgput
     rc4_e         6Gb     128      2T       0       0.000   22216.000      11.148       626Mb
[jp96085@monstre]/export/home/julien/nss/tip/mozilla/dist/SunOS5.10_i86pc_64_OPT.OBJ/bin 51 % ./bltest -E -m rc4 -g 16 -p 2000 -4 2 -i ./bltest -o /dev/null
#     mode          in symmkey  opreps  cxreps     context          op   time(sec)     thrgput
     rc4_e         5Gb     128      4T       0       0.000   45420.000      22.807       253Mb

In the 3rd and 5th tests, the data wrapped around somehow. What's interesting is that it's above 4 Gb . So not sure exactly where it wraps. Anyway, given how fast the RC4 speed seems to be, the counter overflows in about 20 seconds on my dual Opteron 2.2, so we should fix it.
Comment 1 Julien Pierre 2008-03-21 18:18:11 PDT
It overflows at 8 GB.
Comment 2 Julien Pierre 2008-03-21 18:25:12 PDT
Created attachment 311092 [details] [diff] [review]
cast to PRInt64 to solve this problem
Comment 3 Nelson Bolyard (seldom reads bugmail) 2008-03-21 18:54:21 PDT
Comment on attachment 311092 [details] [diff] [review]
cast to PRInt64 to solve this problem

>Index: blapitest.c
>===================================================================
>RCS file: /cvsroot/mozilla/security/nss/cmd/bltest/blapitest.c,v
>retrieving revision 1.53
>diff -u -p -r1.53 blapitest.c
>--- blapitest.c	16 Feb 2008 05:31:31 -0000	1.53
>+++ blapitest.c	22 Mar 2008 01:24:12 -0000
>@@ -2522,7 +2522,7 @@ dump_performance_info(bltestCipherInfo *
>         cxreps += info->cxreps;
>         cxtime += info->cxtime;
>         optime += info->optime;
>-        totalIn += info->input.buf.len * info->repetitions;
>+        totalIn += (PRInt64) info->input.buf.len * (PRInt64) info->repetitions;
>         
>         info = info->next;
>     }
Comment 4 Julien Pierre 2008-03-21 19:01:44 PDT
Thanks, Nelson. I checked this in to the trunk .

Checking in blapitest.c;
/cvsroot/mozilla/security/nss/cmd/bltest/blapitest.c,v  <--  blapitest.c
new revision: 1.54; previous revision: 1.53
done

Note You need to log in before you can comment on or make changes to this bug.