Package: perl
Version: 5.8.4-5
Severity: important

There is a problem in Digest::MD5 on arm

The attached file runs correctly on x86, but fails on test 10 and 11
on arm.  It is based on the test case from the libmd5-perl package, but
since it was failing those two tests when running on arm, I replaced the
code with Digest::MD5 directly and it still fails.  Strangely enough,
if you add the line '#' or something similar to the file at the start,
the tests pass, so there is something suttle going wrong when dealing
with file handles it would seem where some files work and some don't.
I hope this is only a problem in the MD5 code and not something more
serious in perl about handling files on arm in general.  The main
difference I know of between arm and x86, is that 'char' is signed on
x86 by default and unsiged on arm by default.  I have seen code break
where someone assumed char meant signed.

Len Sorensen

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: arm (armv5tel)
Kernel: Linux 2.4.27-5-rr
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages perl depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libdb4.2                    4.2.52-17    Berkeley v4.2 Database Libraries [
ii  libgdbm3                    1.8.3-2      GNU dbm database routines (runtime
ii  perl-base                   5.8.4-5      The Pathologically Eclectic Rubbis
ii  perl-modules                5.8.4-5      Core Perl modules

-- no debconf information
######################### We start with some black magic to print on failure.

# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)

BEGIN {print "1..14\n";}
END {print "not ok 1\n" unless $loaded;}
use Digest::MD5;
$loaded = 1;
print "ok 1\n";

######################### End of black magic.

# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):

package MD5Test;

# 2: Constructor

print (($md5 = Digest::MD5->new) ? "ok 2\n" : "not ok 2\n");

# 4: Various flavours of file-handle to addfile

open(F, "<$0");

$md5->reset;

$md5->addfile(F);
$hex = $md5->hexdigest;
print ($hex ne '' ? "ok 4\n" : "not ok 4\n");

$orig = $hex;

# 10: Other ways of reading the data -- line at a time

seek(F, 0, 0);
$md5->reset;
while (<F>)
{
    $md5->add($_);
}
$hex = $md5->hexdigest;
print ($hex eq $orig ? "ok 10\n" : "not ok 10\n");

# 11: Input lines as a list to add()

seek(F, 0, 0);
$md5->reset;
$md5->add(<F>);
$hex = $md5->hexdigest;
print ($hex eq $orig ? "ok 11\n" : "not ok 11\n");

close(F);

Reply via email to