Closed Bug 424471 Opened 16 years ago Closed 16 years ago

counter overflow in bltest

Categories

(NSS :: Tools, defect, P3)

x86
SunOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: julien.pierre)

Details

Attachments

(1 file)

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.
It overflows at 8 GB.
Assignee: nobody → julien.pierre.boogz
Priority: -- → P3
Target Milestone: --- → 3.12
Attachment #311092 - Flags: review?(nelson)
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;
>     }
Attachment #311092 - Flags: review?(nelson) → review+
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
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: