[PHP-BUG] Bug #80792 [NEW]: Test case bug73594.phpt fails even when dns_get_record() populates additional

"simrit dot kaur at ibm dot com"<[email protected]>
Newsgroups gmane.comp.php.quality-assurance
Message-ID <[email protected]>
From:             simrit dot kaur at ibm dot com
Operating system: SLES 12SP5
PHP version:      8.0.2
Package:          Testing related
Bug Type:         Bug
Bug description:Test case bug73594.phpt fails even when dns_get_record() populates additional

Description:
------------
For PHP v8.0.2, Test case "Bug #73594 (dns_get_record() does not
populate $additional out parameter)
[ext/standard/tests/network/bug73594.phpt]" failed on SLES 12SP5, s390x.


I noticed that this TC is getting skipped on most distros for x86 and
s390x due to one or the other SKIPIF reasons.
For my case, I took a tcpdump to confirm that DNS response had values in
$additional. This was also confirmed by dig command but the TC is still
failing..

"php > var_dump(!empty($res) && empty($additional));" is expected to
return "bool(true)" but is returning "bool(false)". 
Please refer below snapshot for result of dig command and the Test
case.. I can see that dns_get_record() is also returning value in
$additional.
fyre@rotators1:~/php-8.0.2> php -a
Interactive shell

php > $ret = 0;
php > exec("dig -tmx php.net +noall +additional 2>/dev/null", $out,
$ret);
php > var_dump($ret);
int(0)
php > $out = preg_grep("/^(?!($|;))/", $out);
php > var_dump($out);
array(26) {
  [0]=>
  string(44) "i.gtld-servers.net.       74061   IN      A      
192.43.172.30"
  [1]=>
  string(43) "g.gtld-servers.net.       18269   IN      A      
192.42.93.30"
  [2]=>
  string(43) "l.gtld-servers.net.       2876    IN      A      
192.41.162.30"
  [3]=>
  string(43) "k.gtld-servers.net.       4222    IN      A      
192.52.178.30"
.
.
.
  [25]=>
  string(52) "b.gtld-servers.net.       4042    IN      AAAA   
2001:503:231d::2:30"
}
php >
php > $auth = array();
php > $additional = array();
php > $res = dns_get_record('php.net', DNS_MX, $auth, $additional);
php > var_dump(!empty($res) && empty($additional));
bool(false)
php > var_dump($res);
array(1) {
  [0]=>
  array(6) {
    ["host"]=>
    string(7) "php.net"
    ["class"]=>
    string(2) "IN"
    ["ttl"]=>
    int(30)
    ["type"]=>
    string(2) "MX"
    ["pri"]=>
    int(0)
    ["target"]=>
    string(21) "php-smtp4-ip4.php.net"
  }
}
php > var_dump($additional);
array(28) {
  [0]=>
  array(5) {
    ["host"]=>
    string(18) "i.gtld-servers.net"
    ["class"]=>
    string(2) "IN"
    ["ttl"]=>
    int(74061)
    ["type"]=>
    string(1) "A"
    ["ip"]=>
    string(13) "192.43.172.30"
  }
  [1]=>
  array(5) {
    ["host"]=>
    string(18) "g.gtld-servers.net"
    ["class"]=>
    string(2) "IN"
    ["ttl"]=>
    int(18269)
    ["type"]=>
    string(1) "A"
    ["ip"]=>
    string(12) "192.42.93.30"
  }
.
.
  [27]=>
  array(5) {
    ["host"]=>
    string(18) "i.gtld-servers.net"
    ["class"]=>
    string(2) "IN"
    ["ttl"]=>
    int(15164)
    ["type"]=>
    string(4) "AAAA"
    ["ipv6"]=>
    string(17) "2001:503:39c1::30"
  }
}
php >

Can you please give me a pointer to why this TC might be failing? Could
this be a bug in the test case or in php code?

Test script:
---------------
To reproduce:
php -f php-8.0.2/ext/standard/tests/network/bug73594.phpt

OR

You can run this to check all values on php shell:

<?php
$ret = 0;
exec("dig -tmx php.net +noall +additional 2>/dev/null", $out, $ret);
var_dump($ret);
$out = preg_grep("/^(?!($|;))/", $out);
var_dump($out);

$auth = array();
$additional = array();
$res = dns_get_record('php.net', DNS_MX, $auth, $additional);
// only check $additional if dns_get_record is successful
var_dump(!empty($res) && empty($additional));
var_dump($res);
var_dump($additional);
?>


Expected result:
----------------
The Test case should pass.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=80792&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80792&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80792&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80792&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80792&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80792&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80792&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80792&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80792&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80792&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80792&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80792&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80792&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80792&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80792&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80792&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80792&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80792&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.