php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78209 socket not connected
Submitted: 2019-06-25 17:53 UTC Modified: 2019-06-26 15:06 UTC
From: v-altruo at microsoft dot com Assigned: cmb (profile)
Status: Closed Package: Testing related
PHP Version: 7.3.7RC3 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: v-altruo at microsoft dot com
New email:
PHP Version: OS:

 

 [2019-06-25 17:53 UTC] v-altruo at microsoft dot com
Description:
------------
Test fails across all builds regardless of opcache on/off. This also fails for 7.2.20RC3. 

Failed Test File: ext\standard\tests\streams\stream_socket_sento.phpt

Test script:
---------------
$serverUri = "tcp://127.0.0.1:31854";
$serverUrl = "http://php.net";
$stringSocket = "out of band data.";
$stringFWrite = "normal data to transmit";
$sock = stream_socket_server($serverUri, $errno, $errstr);

if (is_resource($sock)) {
    fwrite($sock, $stringFWrite);
    var_dump(stream_socket_sendto());
    var_dump(stream_socket_sendto($sock));
    var_dump(stream_socket_sendto($sock, $stringSocket));
    var_dump(stream_socket_sendto($sock, $stringSocket, STREAM_OOB));
    var_dump(stream_socket_sendto($sock, $stringSocket, STREAM_OOB, $serverUri));
    var_dump(stream_socket_sendto($sock, $stringSocket, STREAM_OOB, $serverUrl));
} else {
    die("Test stream_socket_enable_crypto has failed; Unable to connect: {$errstr} ({$errno})");
}

Expected result:
----------------
Notice: fwrite(): send of %i bytes failed with errno=%i Broken pipe in %s on line %i

Warning: stream_socket_sendto() expects at least %i parameters, %i given in %s on line %i
bool(%s)

Warning: stream_socket_sendto() expects at least %i parameters, %i given in %s on line %i
bool(%s)

Warning: stream_socket_sendto(): Broken pipe
 in %s on line %i
int(%i)

Warning: stream_socket_sendto(): Broken pipe
 in %s on line %i
int(%i)

Warning: stream_socket_sendto(): php_network_getaddresses: getaddrinfo failed: Name or service not known in %s on line %i

Warning: stream_socket_sendto(): Failed to resolve %s: php_network_getaddresses: getaddrinfo failed: Name or service not known in %s on line %i

Warning: stream_socket_sendto(): Failed to parse %s into a valid network address in %s on line %i
bool(%s)

Warning: stream_socket_sendto(): php_network_getaddresses: getaddrinfo failed: Name or service not known in %s on line %i

Warning: stream_socket_sendto(): Failed to resolve %s: php_network_getaddresses: getaddrinfo failed: Name or service not known in %s on line %i

Warning: stream_socket_sendto(): Failed to parse %s into a valid network address in %s on line %i
bool(%s)

Actual result:
--------------
Notice: fwrite(): send of 23 bytes failed with errno=10057 A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
 in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 9

Warning: stream_socket_sendto() expects at least 2 parameters, 0 given in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 10
bool(false)

Warning: stream_socket_sendto() expects at least 2 parameters, 1 given in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 11
bool(false)

Warning: stream_socket_sendto(): A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.

 in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 12
int(-1)

Warning: stream_socket_sendto(): A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.

 in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 13
int(-1)

Warning: stream_socket_sendto(): php_network_getaddresses: getaddrinfo failed: No such host is known.  in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 14

Warning: stream_socket_sendto(): Failed to resolve `tcp': php_network_getaddresses: getaddrinfo failed: No such host is known.  in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 14

Warning: stream_socket_sendto(): Failed to parse `tcp://127.0.0.1:31854' into a valid network address in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 14
bool(false)

Warning: stream_socket_sendto(): php_network_getaddresses: getaddrinfo failed: No such host is known.  in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 15

Warning: stream_socket_sendto(): Failed to resolve `http': php_network_getaddresses: getaddrinfo failed: No such host is known.  in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 15

Warning: stream_socket_sendto(): Failed to parse `http://php.net' into a valid network address in C:\...\php-test-pack-7.2.20RC3\ext\standard\tests\streams\stream_socket_sendto.php on line 15
bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-26 15:00 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2019-06-26 15:00 UTC] cmb@php.net
Thanks for reporting!

The only sensible action with regard to this broken test, is to
remove it from PHP 7.2+ (it has already been removed from PHP
7.4+).
 [2019-06-26 15:06 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2019-06-26 15:06 UTC] cmb@php.net
Test removed with commit 7d28a24[1].

[1] <http://git.php.net/?p=php-src.git;a=commit;h=7d28a24c6602a0cf66def582c82712408254f81d>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 20:01:27 2024 UTC