Skip Menu |

This queue is for tickets about the Net-Netmask CPAN distribution.

Report information
The Basics
Id: 43348
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Net-Netmask

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.9015
Fixed in: (no value)



Subject: Test fails on -Duselongdouble systems
Hi David, while watching cpan testers results I discovered fail reports against Net::Netmask who had in common that they had nvsize != 8. You can build such systems on 64bit systems when compiling perl with -Duselongdouble. There may be other ways to build such systems, I haven't investigated that. But I have verified on one of my smoker boxes. The result is: t/netmasks (Wstat: 0 Tests: 282 Failed: 6) Failed tests: 132, 135, 260, 262, 269-270 HTH, Thank you,
I could use some help with this one. I can confirm the problem but I don't know how to fix it.
On Mon Feb 16 23:14:03 2009, ANDK wrote: Show quoted text
> Hi David, > > while watching cpan testers results I discovered fail reports against > Net::Netmask who had in common that they had nvsize != 8. > > You can build such systems on 64bit systems when compiling perl with > -Duselongdouble. There may be other ways to build such systems, I > haven't investigated that. > > But I have verified on one of my smoker boxes. The result is: > > t/netmasks (Wstat: 0 Tests: 282 Failed: 6) > Failed tests: 132, 135, 260, 262, 269-270 > > HTH, Thank you,
With the test script from #57145, this becomes: t/netmasks.t .......... 1/282 # Failed test at t/netmasks.t line 239. # got: '216.240.32.128/25 216.240.33.0/24 216.240.34.0/23 216.240.36.0/26 216.240.36.64/26' # expected: '216.240.32.128/25 216.240.33.0/24 216.240.34.0/23 216.240.36.0/25' # Failed test at t/netmasks.t line 249. # got: '216.240.36.0/26' # expected: '216.240.36.0/25' # Failed test at t/netmasks.t line 462. # got: '216.240.32.0/24 216.240.33.0/26 216.240.33.64/26 216.240.34.0/24' # expected: '216.240.32.0/24 216.240.33.0/25 216.240.34.0/24' # Failed test at t/netmasks.t line 471. # got: '216.240.32.0/24 216.240.33.0/26 216.240.33.64/26 216.240.34.0/24' # expected: '216.240.32.0/24 216.240.33.0/25 216.240.34.0/24' # Failed test at t/netmasks.t line 495. # got: '216.240.33.128/26 216.240.33.192/26 216.240.35.0/24' # expected: '216.240.33.128/25 216.240.35.0/24' # Failed test at t/netmasks.t line 499. # got: '216.240.33.128/26 216.240.33.192/26 216.240.35.0/24' # expected: '216.240.33.128/25 216.240.35.0/24' # Looks like you failed 6 tests of 282. t/netmasks.t .......... Dubious, test returned 6 (wstat 1536, 0x600) Failed 6/282 subtests and so it looks like certain operations are outputting a correct, but sub-optimal list of subnets (216.240.33.128/26 + 216.240.33.192/26 is equivalent to 216.240.33.128/25, for example).
On Sun May 02 12:03:47 2010, DOM wrote: Show quoted text
> and so it looks like certain operations are outputting a correct, but > sub-optimal list of subnets (216.240.33.128/26 + 216.240.33.192/26 is > equivalent to 216.240.33.128/25, for example).
This is caused by rounding errors due to using int() in irange2cidrlist. Using POSIX::floor seems to be consistent with both sorts of perl, so here is a patch. Regards, Dominic.
Subject: uselongdouble.patch
Index: libnet-netmask-perl/Netmask.pm =================================================================== --- libnet-netmask-perl.orig/Netmask.pm 2010-05-02 17:40:16.000000000 +0100 +++ libnet-netmask-perl/Netmask.pm 2010-05-02 17:38:14.000000000 +0100 @@ -28,6 +28,7 @@ use strict; use warnings; use Carp; +use POSIX qw(floor); use overload '""' => \&desc, '<=>' => \&cmp_net_netmask_block, @@ -462,7 +463,7 @@ my @result; while ($end >= $start) { my $maxsize = imaxblock($start, 32); - my $maxdiff = 32 - int(log($end - $start + 1)/log(2)); + my $maxdiff = 32 - floor(log($end - $start + 1)/log(2)); $maxsize = $maxdiff if $maxsize < $maxdiff; push (@result, bless { 'IBASE' => $start,
Ping?
Subject: Re: [rt.cpan.org #43348] Test fails on -Duselongdouble systems
Date: Thu, 17 Mar 2011 09:38:09 -0700
To: bug-Net-Netmask [...] rt.cpan.org
From: David Muir Sharnoff <muir [...] idiom.org>
Next up after an update to IO::Event On Thu, Mar 17, 2011 at 12:11 AM, Andreas Koenig via RT <bug-Net-Netmask@rt.cpan.org> wrote: Show quoted text
>       Queue: Net-Netmask >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=43348 > > > Ping? > >
Patch applied and released. I couldn't reproduce the problem so I don't know if the patch fixed it.