#38488 [NEW]: Access to "php://stdin" and faily crashes PHP on win32
| From: | dmitry@php.net | Date: | Fri, 18 Aug 2006 02:31:47 +0000 |
| Subject: | #38488 [NEW]: Access to "php://stdin" and faily crashes PHP on win32 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-100919@lists.php.net to get a copy of this message | ||
From: dmitry@php.net
Operating system: win32
PHP version: 5CVS-2006-08-18 (CVS)
PHP Bug Type: Streams related
Bug description: Access to "php://stdin" and faily crashes PHP on win32
Description:
------------
Access to standard streams using "php://stdin" and family names produces
crash. The reason probably is in a buggy _get_osfhandle() function that
doesn't return proper HANDLES for standard system streams. We need find
out a workaround for this problem.
the bug is probably related to bug #7960
Reproduce code:
---------------
<?php
$f = fopen("php://stdout", "w+");
fwrite($f, "Hello\n");
?>
Expected result:
----------------
Hello
Actual result:
--------------
Crash with the following stack trace
NTDLL! 7c90eb74()
NTDLL! 7c90eb94()
_php_stream_fopen_from_fd(int 0, const char * 0x00416fb0 `string', const
char * 0x00000000, int 0, char * 0x1070a25c `string', unsigned int 246,
char * 0x00000000, unsigned int 0, void * * * 0x02714fe0) line 200 + 24
bytes
php_stream_url_wrap_php(_php_stream_wrapper * 0x108a5d28
_php_stream_php_wrapper, char * 0x00416fa6, char * 0x00416fb0 `string',
int 8, char * * 0x00000000, _php_stream_context * 0x00000000, int 1, char
* 0x106dd51c
string', unsigned int 1774, char * 0x004165c8 string',
unsigned int 498, void * * * 0x02714fe0) line 246 + 41 bytes
_php_stream_open_wrapper_ex(char * 0x00416fa0 `string', char * 0x00416fb0
`string', int 0, char * * 0x00000000, _php_stream_context * 0x00000000,
int 0, char * 0x004165c8 `string', unsigned int 498, char * 0x00000000,
unsigned int 0, void * * * 0x02714fe0) line 1774 + 111 bytes
cli_register_file_handles(void * * * 0x02714fe0) line 498 + 52 bytes
main(int 2, char * * 0x026f8fc0) line 1030 + 12 bytes
--
Edit bug report at http://bugs.php.net/?id=38488&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38488&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38488&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38488&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38488&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38488&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38488&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38488&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38488&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38488&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38488&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38488&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38488&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38488&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38488&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38488&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38488&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38488&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38488&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38488&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38488&r=mysqlcfg