From: [EMAIL PROTECTED]
Operating system: Linux/Redhat
PHP version: 4CVS-2002-11-14
PHP Bug Type: Filesystem function related
Bug description: stream_get_meta_data craches on a normal file stream
this script:
<?php
$f = fopen("/etc/passwd", "r");
var_dump(stream_get_meta_data($f));
?>
produces the following backtrace:
0x4057a67b in strlen (str=0x0) at ../sysdeps/i386/strlen.c:28
28 ../sysdeps/i386/strlen.c: No such file or directory.
in ../sysdeps/i386/strlen.c
(gdb) bt
#0 0x4057a67b in strlen (str=0x0) at ../sysdeps/i386/strlen.c:28
#1 0x0821c8bd in add_assoc_string_ex (arg=0x8382654,
key=0x826c362 "wrapper_type", key_len=13, str=0x0, duplicate=1)
at /dat/dev/php/php-4.3.0pre2/Zend/zend_API.c:671
#2 0x0816ce25 in zif_stream_get_meta_data (ht=1, return_value=0x8382654,
this_ptr=0x0, return_value_used=1)
at /dat/dev/php/php-4.3.0pre2/ext/standard/file.c:603
#3 0x0822b393 in execute (op_array=0x837e234)
at /dat/dev/php/php-4.3.0pre2/Zend/zend_execute.c:1595
#4 0x0821b34a in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /dat/dev/php/php-4.3.0pre2/Zend/zend.c:839
#5 0x081eb3b8 in php_execute_script (primary_file=0xbffff970)
at /dat/dev/php/php-4.3.0pre2/main/main.c:1542
#6 0x08237240 in main (argc=1, argv=0xbffffa14)
at /dat/dev/php/php-4.3.0pre2/sapi/cli/php_cli.c:695
#7 0x40514306 in __libc_start_main (main=0x82369a4 <main>, argc=1,
ubp_av=0xbffffa14, init=0x807b468 <_init>, fini=0x8237920 <_fini>,
rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbffffa0c)
at ../sysdeps/generic/libc-start.c:129
--
Edit bug report at http://bugs.php.net/?id=20424&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20424&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20424&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20424&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20424&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20424&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20424&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20424&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20424&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20424&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20424&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20424&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20424&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20424&r=isapi