Edit report at http://bugs.php.net/bug.php?id=49948&edit=1

 ID:               49948
 Comment by:       will at flourishlib dot com
 Reported by:      [email protected]
 Summary:          stream_select() / _get_osfhandle
 Status:           Assigned
 Type:             Bug
 Package:          Streams related
 Operating System: win32 only - Windows
 PHP Version:      5.3SVN-2009-10-21 (snap)
 Assigned To:      pajoye

 New Comment:

I am getting the same bug with the PHP 5.3.3RC1 VC9 x86 Thread Safe
build. The 

server is a Windows 2008 R2 x64 machine. The code that is producing the
error 

for me is:



<?php

error_reporting(E_ALL | E_STRICT);

ini_set('display_errors', 1);



date_default_timezone_set('America/New_York');

$con = fsockopen('www.google.com', 80);

$read = array($con);

$write = NULL;

$except = NULL;

stream_select($read, $write, $except, 1, 0);

?>



The error is:

Warning: Invalid CRT parameters detected in C:\tmp\stream_select.php on
line 10



I can probably provide access to the machine if need be.


Previous Comments:
------------------------------------------------------------------------
[2009-10-21 18:13:26] [email protected]

Description:
------------
Hi,



I am getting "Invalid parameter detected in CRT function
'_get_osfhandle'" when running the below code. 



I have compiled a source code snapshot version of PHP 5.3.2-dev on
Windows. I used VC9 Express and SDK 6.1 . OS is XP Prof. I've run PHP
from within the build tree in the hope it will pick the binaries (dlls,
resource files, whatever there is) I have compiled myself. 



However, I have also seen this warning with yesterdays VC9 non TS
binaries from the windows.php.net on another box. A couple of ext/mysqli
tests fail because of the warning. The affected mysqli API calls is
mysqli_poll(). It makes use of [php_]select() just like the below code.

Reproduce code:
---------------
$stream = stream_socket_client("tcp://193.99.144.80:80", $errno, $error,
$whatever, STREAM_CLIENT_ASYNC_CONNECT | STREAM_CLIENT_CONNECT);

var_dump($stream);

$read = $write = $except = array($stream);

var_dump(stream_select($read, $write, $except, 1));

Expected result:
----------------
No warning. 

Actual result:
--------------
resource(5) of type (stream)



Warning: Invalid parameter detected in CRT function '_get_osfhandle'
(f:\dd\vctools\crt_bld\self_x86\crt\src\osfinfo.c:314) in
E:\php-sdk\php53dev\vc9\x86\php5.

3-200910211230\Debug_TS\select.php on line 5

int(1)


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=49948&edit=1

Reply via email to