Subject: | Digest::MD5 error when repeatedly invoked iin oo style mode |
Summary
There seems to be a bug affecting Digest::MD5 version 2.36 when called
repeatedly in OO mode.
The same data gives a different checksum. The procedural version does
not show this behaviour.
Erratic behaviour can be observed by calling repeatedly a test script.
Tests were conducted on two different machines and versions of package.
Test Harness
for i in `seq 1 10`; do ./mk5ck.pl ; done
The test script
#!/usr/bin/perl
#mk5ck.pl
use strict;
use DBI;
my $data='12345678910';
&OO($data);
&PROC($data);
sub OO{
use Digest::MD5;
my $data=shift;
my $digest=new Digest::MD5;
my $dig=$digest->md5_hex($data);
print "Object Style: \t",$dig,"\n";
}
sub PROC{
use Digest::MD5 qw(md5 md5_hex md5_base64);
my $digest=new Digest::MD5;
my $dig=md5_hex($data);
print "Procedural Style:\t",$dig,"\n";
}
Subject: | Digest MD5 error when repeatedly invoked iin oo style mode.eml.html |
Digest::MD5 error when repeatedly invoked iin oo style mode
Sujet: Digest::MD5 error when repeatedly invoked iin oo style modeDe: Philippe Chartrand Date: Thu, 01 Jun 2006 13:01:09 -0400Pour: gisle@ActiveState.com
Summary
There seems to be a bug affecting Digest::MD5 version 2.36 when called repeatedly in OO mode.
The same data gives a different checksum. The procedural version does not show this behaviour.
Erratic behaviour can be observed by calling repeatedly a test script. Tests were conducted on two different machines and versions of package.
Test Harness
for i in `seq 1 10`; do ./mk5ck.pl ; done
The test script
#!/usr/bin/perl
#mk5ck.pl
use strict;
use DBI;
my $data='12345678910';
&OO($data);
&PROC($data);
sub OO{
use Digest::MD5;
my $data=shift;
my $digest=new Digest::MD5;
my $dig=$digest->md5_hex($data);
print "Object Style: \t",$dig,"\n";
}
sub PROC{
use Digest::MD5 qw(md5 md5_hex md5_base64);
my $digest=new Digest::MD5;
my $dig=md5_hex($data);
print "Procedural Style:\t",$dig,"\n";
}
Result on Mandriva (version 2.25)
[philippe@ontledroit ~]$ uname -a
Linux ontledroit.homelinux.org 2.6.12-18mdksmp #1 SMP Wed Mar 15 10:18:39 MST 2006 x86_64 AMD Opteron(tm) Processor 240 unknown GNU/Linux
[philippe@ontledroit ~]$ for i in `seq 1 10`; do ./mk5ck.pl ; done
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
[philippe@ontledroit ~]$ perl -e 'use Digest::MD5;print $Digest::MD5::VERSION,"\n";'
2.25
[philippe@ontledroit ~]$
Results on RH3EL (version 2.36)
-bash-2.05b$ uname -a
Linux intranet2 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005 i686 i686 i386 GNU/Linux
-bash-2.05b$ for i in `seq 1 10`; do ./mk5ck.pl ; done
Object Style: 5f084ce660f2d4c524e3d5aa41f117d8
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 4204d84321e90db5df5cc39f0780972d
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: ff6f78e8717a93e70a7547e8d3524322
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 7f0c1f6bf6b850aae451875df8ef9ab7
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 9a0e38bd904eb23f9bf715d52711dc5d
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: d24de209382cd79c23263b5ffdab3752
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: cce8857a86fc98d967111b05a11258b4
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 1dc54b995732a04e64d3997d3a575961
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: f09f75d129a95e0334bc1ea445ae75d2
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 392bc56627c3c8b1e543abb1aac227fd
Procedural Style: 432f45b44c432414d2f97df0e5743818
2.36-bash-2.05b$ perl -e 'use Digest::MD5;print $Digest::MD5::VERSION,"\n";'
2.36
-bash-2.05b$
Summary
There seems to be a bug affecting Digest::MD5 version 2.36 when called repeatedly in OO mode.
The same data gives a different checksum. The procedural version does not show this behaviour.
Erratic behaviour can be observed by calling repeatedly a test script. Tests were conducted on two different machines and versions of package.
Test Harness
for i in `seq 1 10`; do ./mk5ck.pl ; done
The test script
#!/usr/bin/perl
#mk5ck.pl
use strict;
use DBI;
my $data='12345678910';
&OO($data);
&PROC($data);
sub OO{
use Digest::MD5;
my $data=shift;
my $digest=new Digest::MD5;
my $dig=$digest->md5_hex($data);
print "Object Style: \t",$dig,"\n";
}
sub PROC{
use Digest::MD5 qw(md5 md5_hex md5_base64);
my $digest=new Digest::MD5;
my $dig=md5_hex($data);
print "Procedural Style:\t",$dig,"\n";
}
Result on Mandriva (version 2.25)
[philippe@ontledroit ~]$ uname -a
Linux ontledroit.homelinux.org 2.6.12-18mdksmp #1 SMP Wed Mar 15 10:18:39 MST 2006 x86_64 AMD Opteron(tm) Processor 240 unknown GNU/Linux
[philippe@ontledroit ~]$ for i in `seq 1 10`; do ./mk5ck.pl ; done
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: b895aa73cc8e22b03e3e028e3afcf5e5
Procedural Style: 432f45b44c432414d2f97df0e5743818
[philippe@ontledroit ~]$ perl -e 'use Digest::MD5;print $Digest::MD5::VERSION,"\n";'
2.25
[philippe@ontledroit ~]$
Results on RH3EL (version 2.36)
-bash-2.05b$ uname -a
Linux intranet2 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005 i686 i686 i386 GNU/Linux
-bash-2.05b$ for i in `seq 1 10`; do ./mk5ck.pl ; done
Object Style: 5f084ce660f2d4c524e3d5aa41f117d8
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 4204d84321e90db5df5cc39f0780972d
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: ff6f78e8717a93e70a7547e8d3524322
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 7f0c1f6bf6b850aae451875df8ef9ab7
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 9a0e38bd904eb23f9bf715d52711dc5d
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: d24de209382cd79c23263b5ffdab3752
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: cce8857a86fc98d967111b05a11258b4
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 1dc54b995732a04e64d3997d3a575961
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: f09f75d129a95e0334bc1ea445ae75d2
Procedural Style: 432f45b44c432414d2f97df0e5743818
Object Style: 392bc56627c3c8b1e543abb1aac227fd
Procedural Style: 432f45b44c432414d2f97df0e5743818
2.36-bash-2.05b$ perl -e 'use Digest::MD5;print $Digest::MD5::VERSION,"\n";'
2.36
-bash-2.05b$