[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#684125: unblock: libmath-random-mt-perl/1.15-2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Dear Release-Team

Please unblock package libmath-random-mt-perl

Version 1.15 introduced a bug: rand() does not handle arguments and
irand() handles arguments wrongly. rand($number) should report value
generated by the PRNG in the interval [0,$number). But due to an
implementing error it still reported only values in [0,1).

Similarly the irand() was implemented wrong. 

Could you consider unblocking this for wheezy even if it is not a
RC-Bug per se? I have attached the debdiff.

Upstream Bugreport is [1], and I opened [2] to track the issue.

Furthermore the package can be fixed by passing trough unstable first.

 [1]: https://rt.cpan.org/Public/Bug/Display.html?id=78200
 [2]: http://bugs.debian.org/684085

unblock libmath-random-mt-perl/1.15-2

Regards,
Salvatore

- -- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCgAGBQJQINaaAAoJEHidbwV/2GP+1CMQAJfSyBp0U2MRrIuKzfQqxryx
ttdrsB9eE7hb/33RslScMH7pYFCkD6hlP+3i0wT1ASFUvsHfbJdrYHZWeP/e8hz/
y7PMm1KHRy82Tm+7mpesxoxFZB0z+lz/C7EtaFNp73tobE8/9az4FDqVGZj36d2c
4ph7YvRRXWSPwfcz7jzhRkpHqX3gJTxjUmD53nnxEXWPfSebJVG7c2j9Gkmyn5Zx
C2I9CNc7qPQuPOEguE3BAk3Ip4SEaB9UqlyzQ6LDM+6W7YMujHfeIUzOARZV1bza
s/KKOle2QkChLOoz79fcv2uwrBby9xsfL1a8hNBhbcpTHGFoRPMWqT08NtTWmPMl
CKDN0+Qd/BzuXeYAIIJz0gboiYd+lR79ZkJmpFkyoXIwl3aI33HV2bVenmeqtdlM
bpmwblDj6Ks2zvy/pLRdrIHu7T+yaeYCnzKaphBXXxjd+VTAKJeoNqE6rHYBTTE+
OUN3ZcBrlJtnPP4YTFEgWLykYd/S7cjvGaPOb5TK0ILxeyEbGlStLh9ZlL50gFmU
83XxuQVCGsp9CHWMrXFC6kdmrrVLDN/oxDpkUE+RgztQwVBWq9sTLInVRqHbcO+y
pmx+7IZGWBcnLkzgsN7fWp9Rk/ItsbjuNn+hct6dw3aB27XGt03hjz+QFLDKQsUH
mtNFIJvz7x7mhIEW2SFT
=4mej
-----END PGP SIGNATURE-----
diffstat for libmath-random-mt-perl-1.15 libmath-random-mt-perl-1.15

 changelog                                                   |    9 +
 patches/0001-Fix-handling-of-rand-and-irand-arguments.patch |   86 ++++++++++++
 patches/series                                              |    1 
 3 files changed, 96 insertions(+)

diff -Nru libmath-random-mt-perl-1.15/debian/changelog libmath-random-mt-perl-1.15/debian/changelog
--- libmath-random-mt-perl-1.15/debian/changelog	2012-06-04 07:03:51.000000000 +0200
+++ libmath-random-mt-perl-1.15/debian/changelog	2012-08-07 08:00:33.000000000 +0200
@@ -1,3 +1,12 @@
+libmath-random-mt-perl (1.15-2) unstable; urgency=low
+
+  * Add 0001-Fix-handling-of-rand-and-irand-arguments.patch patch.
+    Fix handling of rand() and irand() arguments. Fixed the issue introduced
+    in version 1.15 where rand() took no notice of argument and irand() did.
+    (Closes: #684085)
+
+ -- Salvatore Bonaccorso <carnil@debian.org>  Tue, 07 Aug 2012 07:57:49 +0200
+
 libmath-random-mt-perl (1.15-1) unstable; urgency=low
 
   * Imported Upstream version 1.15
diff -Nru libmath-random-mt-perl-1.15/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch libmath-random-mt-perl-1.15/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch
--- libmath-random-mt-perl-1.15/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch	1970-01-01 01:00:00.000000000 +0100
+++ libmath-random-mt-perl-1.15/debian/patches/0001-Fix-handling-of-rand-and-irand-arguments.patch	2012-08-07 08:00:33.000000000 +0200
@@ -0,0 +1,86 @@
+Description: Fix handling of rand() and irand() arguments
+ Fixed issue introduced in version 1.15 where rand() took no notice of
+ argument and irand() did.
+Origin: vendor
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=78200
+Bug-Debian: http://bugs.debian.org/684085
+Forwarded: not-needed
+Author: Salvatore Bonaccorso <carnil@debian.org>
+Last-Update: 2012-08-06
+
+--- a/MT.pm
++++ b/MT.pm
+@@ -41,26 +41,27 @@
+     my ($self, $N) = @_;
+ 
+     unless (ref $self) {
++        $N = $self;
+         Math::Random::MT::srand() unless defined $gen;
+         $self = $gen;
+     }
+ 
+-    return $self->genrand();
++    return ($N || 1) * $self->genrand();
+ }
+ 
+ sub irand
+ {
+-    my ($self, $N) = @_;
++    my ($self) = @_;
+ 
+     unless (ref $self) {
+-        $N = $self;
+         Math::Random::MT::srand() unless defined $gen;
+         $self = $gen;
+     }
+ 
+-    return ($N || 1) * $self->genirand();
++    return $self->genirand();
+ }
+ 
++
+ # Generate a random seed using the built-in PRNG.
+ 
+ sub _rand_seed {
+--- a/t/1.t
++++ b/t/1.t
+@@ -3,7 +3,7 @@
+ use Test;
+ use vars qw($loaded);
+ 
+-BEGIN { plan tests => 6 }
++BEGIN { plan tests => 10 }
+ END   { print "not ok 1\n" unless $loaded }
+ 
+ # Test that the OO interface works
+@@ -15,3 +15,9 @@
+ ok(abs($gen->rand() - 0.135477004107088) < 1e-14);
+ ok($gen->irand() == 3890346734);
+ ok($gen->irand() == 3586334585);
++
++ok(abs($gen->rand(10) - 1.269868118688464) < 1e-14); # rand() takes a multiplier as argument
++ok(abs($gen->rand(10) - 9.688677710946649) < 1e-14);
++
++ok($gen->irand(123) == 3922919429); # irand() takes no argument; given argument does nothing
++ok($gen->irand(123) ==  949333985);
+--- a/t/2.t
++++ b/t/2.t
+@@ -3,7 +3,7 @@
+ use Test;
+ use vars qw($loaded);
+ 
+-BEGIN { plan tests => 5 }
++BEGIN { plan tests => 9 }
+ END   { print "not ok 1\n" unless $loaded }
+ 
+ # Check that the results are the same with the function-call interface
+@@ -16,3 +16,9 @@
+ ok(abs(rand() - 0.135477004107088) < 1e-14);
+ ok(irand() == 3890346734);
+ ok(irand() == 3586334585);
++
++ok(abs(rand(10) - 1.269868118688464) < 1e-14); # rand() takes a multiplier as argument
++ok(abs(rand(10) - 9.688677710946649) < 1e-14);
++
++ok(irand(123) == 3922919429); # irand() takes no argument; given argument does nothing
++ok(irand(123) ==  949333985);
diff -Nru libmath-random-mt-perl-1.15/debian/patches/series libmath-random-mt-perl-1.15/debian/patches/series
--- libmath-random-mt-perl-1.15/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ libmath-random-mt-perl-1.15/debian/patches/series	2012-08-07 08:00:33.000000000 +0200
@@ -0,0 +1 @@
+0001-Fix-handling-of-rand-and-irand-arguments.patch

Reply to: