The default bug view has changed. See this FAQ.

counter overflow in bltest

RESOLVED FIXED in 3.12

Status

NSS
Tools
P3
normal
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Julien Pierre, Assigned: Julien Pierre)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

647 bytes, patch
Nelson Bolyard (seldom reads bugmail)
: review+
Details | Diff | Splinter Review
(Assignee)

Description

9 years ago
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.
(Assignee)

Comment 1

9 years ago
It overflows at 8 GB.
(Assignee)

Updated

9 years ago
Assignee: nobody → julien.pierre.boogz
Priority: -- → P3
Target Milestone: --- → 3.12
(Assignee)

Comment 2

9 years ago
Created attachment 311092 [details] [diff] [review]
cast to PRInt64 to solve this problem
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+
(Assignee)

Comment 4

9 years ago
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
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.