perl-math-bigint: busy loop with bignum bitwise operations
Description:
After upgrading from perl 5.36.1-1
(perl-math-bigint: 1.999830
) to 5.38.1-1
(perl-math-bigint: 1.999837
), when I run ipcalc 61.177.0.0 - 61.177.255.255
it runs forever.
I did a bit of digging and it sounds like this Debian bug, which was fixed by upgrading to Math::BigInt
1.999838.
Additional info:
- package version(s):
5.38.1-1
- link to upstream bug report, if any:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012704
- https://github.com/pjacklam/p5-Math-BigInt/issues/7
- https://rt.cpan.org/Public/Bug/Display.html?id=146411
-
https://github.com/pjacklam/p5-Math-BigInt/commit/5020d66cc0ece2a5fbf5cb182ab7ab62c8adade5
- I have not tested applying said patch, but I expect it would solve the issue.
Steps to reproduce:
$ ipcalc 61.177.0.0 - 61.177.255.255
deaggregate 61.177.0.0 - 61.177.255.255
Deep recursion on subroutine "Math::BigInt::bior" at /usr/share/perl5/core_perl/Math/BigFloat.pm line 3883.
Deep recursion on subroutine "Math::BigFloat::bior" at /usr/share/perl5/core_perl/Math/BigInt.pm line 3513.
^C
$ ipcalc 10.0.0.0/16 -s 256
Address: 10.0.0.0 00001010.00000000. 00000000.00000000
Netmask: 255.255.0.0 = 16 11111111.11111111. 00000000.00000000
Wildcard: 0.0.255.255 00000000.00000000. 11111111.11111111
=>
Network: 10.0.0.0/16 00001010.00000000. 00000000.00000000
HostMin: 10.0.0.1 00001010.00000000. 00000000.00000001
HostMax: 10.0.255.254 00001010.00000000. 11111111.11111110
Broadcast: 10.0.255.255 00001010.00000000. 11111111.11111111
Hosts/Net: 65534 Class A, Private Internet
1. Requested size: 256 hosts
Netmask: 255.255.254.0 = 23 11111111.11111111.1111111 0.00000000
Network: 10.0.0.0/23 00001010.00000000.0000000 0.00000000
HostMin: 10.0.0.1 00001010.00000000.0000000 0.00000001
HostMax: 10.0.1.254 00001010.00000000.0000000 1.11111110
Broadcast: 10.0.1.255 00001010.00000000.0000000 1.11111111
Hosts/Net: 510 Class A, Private Internet
Needed size: 512 addresses.
Used network: 10.0.0.0/23
Unused:
Deep recursion on subroutine "Math::BigInt::bior" at /usr/share/perl5/core_perl/Math/BigFloat.pm line 3883.
Deep recursion on subroutine "Math::BigFloat::bior" at /usr/share/perl5/core_perl/Math/BigInt.pm line 3513.
^C
Edited by Kristian Klausen