From: u...@php.net Operating system: Windows PHP version: 5.3SVN-2009-10-21 (snap) PHP Bug Type: Streams related Bug description: stream_select() / _get_osfhandle
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 bug report at http://bugs.php.net/?id=49948&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49948&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49948&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49948&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49948&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49948&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49948&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49948&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49948&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49948&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49948&r=support Expected behavior: http://bugs.php.net/fix.php?id=49948&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49948&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49948&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49948&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49948&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49948&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49948&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49948&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49948&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49948&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49948&r=mysqlcfg