Public bug reported:
Starting with php 7.1 (or so I'm told), long2ip() requires an integer.
Turns out that on 32bit a number bigger than MAXINT is a "float" (?):
$ cat long2ip.php
<?php
echo "PHP_INT_MAX = " . PHP_INT_MAX . "\n";
echo "long2ip(PHP_INT_MAX) = " . long2ip(PHP_INT_MAX) . "\n";
echo "long2ip(PHP_INT_MAX + 1) = " . long2ip(PHP_INT_MAX + 1) . "\n";
echo "long2ip(-1) = " . long2ip(-1) . "\n";
?>
$ php ./long2ip.php
PHP_INT_MAX = 2147483647
long2ip(PHP_INT_MAX) = 127.255.255.255
PHP Warning: long2ip() expects parameter 1 to be int, float given in
/home/ubuntu/long2ip.php on line 4
long2ip(PHP_INT_MAX + 1) =
long2ip(-1) = 255.255.255.255
$ uname -a
Linux f1-armhf 5.4.0-14-generic #17-Ubuntu SMP Thu Feb 6 22:49:16 UTC 2020
armv8l armv8l armv8l GNU/Linux
This seems to be happening in the cacti dep8 tests:
02/27/2020 12:55:07 - ERROR PHP WARNING: long2ip() expects parameter 1 to be
int, float given in file: /usr/share/cacti/site/lib/api_automation.php on
line: 3006
02/27/2020 12:55:07 - CMDPHP PHP ERROR WARNING Backtrace:
(/poller_automation.php[272]:automation_primeIPAddressTable(),
/lib/api_automation.php[3179]:automation_calculate_total_ips(),
/lib/api_automation.php[3128]:automation_get_network_info(),
/lib/api_automation.php[3034]:automation_get_valid_mask(),
/lib/api_automation.php[3006]:long2ip(), CactiErrorHandler())
02/27/2020 12:55:07 - ERROR PHP WARNING: long2ip() expects parameter 1 to be
int, float given in file: /usr/share/cacti/site/lib/api_automation.php on
line: 3006
02/27/2020 12:55:07 - CMDPHP PHP ERROR WARNING Backtrace:
(/poller_automation.php[272]:automation_primeIPAddressTable(),
/lib/api_automation.php[3182]:automation_calculate_start(),
/lib/api_automation.php[3116]:automation_get_network_info(),
/lib/api_automation.php[3034]:automation_get_valid_mask(),
/lib/api_automation.php[3006]:long2ip(), CactiErrorHandler())
I'm not sure what value long2ip() is getting. I'm assuming it's a random
network, and sometimes (most of the time?) it's larger than MAXINT. Or
some other garbage, and long2ip() barfs.
This test hasn't always failed, hence my assumption above. I'll try to
add some debugging to see what is being passed to that function.
** Affects: cacti (Ubuntu)
Importance: Undecided
Status: New
** Tags: dep8 update-excuse update-excuses
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1865067
Title:
DEP8 error on armhf (32bits): long2ip() requires int
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cacti/+bug/1865067/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs