php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48473 $errstr in stream_socket_client() periodically not set when error occurs
Submitted: 2009-06-04 16:46 UTC Modified: 2009-12-22 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: nick dot telford at gmail dot com Assigned:
Status: No Feedback Package: Streams related
PHP Version: 5.2.9 OS: CentOS 5.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nick dot telford at gmail dot com
New email:
PHP Version: OS:

 

 [2009-06-04 16:46 UTC] nick dot telford at gmail dot com
Description:
------------
I've noticed that some errors in stream_socket_client()s connection don't populate errstr with an error. As far as I can tell, errno is always populated.

The most consistent case I've found for this if when the error code is 16 - $errstr SHOULD be "Device or resource busy" (according to some googling), however, it is empty.

I've also come across many errono's that are > 127 and have no errstr. e.g. 5736689

Reproduce code:
---------------
Unless someone knows how to reproduce "Device or resource busy", then I can't create any code to reproduce errno 16 having no errstr.

I can reproduce the oddly high errno's (with no errstr) as the example above appears to be for invalid URLs:

<?php
$stream = stream_socket_client('tcp://tinyu:80', $errno, $errstr);
echo "$errno\n";
echo "'$errstr'\n";

Expected result:
----------------
Not sure what the error number *should* be, possibly 22 (EINVAL), Invalid argument. I'll go with that:

22
'Invalid argument'

Actual result:
--------------
5736689
''

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-18 19:01 UTC] jani@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-09-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-12-05 15:16 UTC] sfsys at mail dot ru
have the same bug in php 5.2.4
 [2009-12-15 00:40 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-12-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 13:01:23 2020 UTC