From: mg at connection-net dot de
Operating system: Gentoo Linux
PHP version: 5.0.0RC2
PHP Bug Type: Filesystem function related
Bug description: php CLI crashes when using FAM
Description:
------------
php cli crashes when accessing the filenames of a FAM event.
Reproduce code:
---------------
while (fam_pending($this->fam)) {
$event = fam_next_event($this->fam);
$code = $event["code"];
$filename = $event["filename"];
if (($code == FAMCreated) || ($code == 8) || ($code == 1)) {
$tmp = "Test";
if ($filename == $tmp) echo "1";
}
}
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 28225)]
0x4061a37b in strlen () from /lib/libc.so.6
(gdb) bt
#0 0x4061a37b in strlen () from /lib/libc.so.6
#1 0x081e11f3 in add_assoc_string_ex (arg=0x40a8c863,
key=0x40a8c863 <Address 0x40a8c863 out of bounds>,
key_len=1084803171,
str=0x40a8c863 <Address 0x40a8c863 out of bounds>,
duplicate=1082028080)
at /usr/src/php-5.0.0RC2/Zend/zend_API.c:794
#2 0x080a2a04 in zif_fam_next_event (ht=1084803171,
return_value=0x40a8c863, this_ptr=0x0,
return_value_used=1) at /usr/src/php-5.0.0RC2/ext/fam/fam.c:428
#3 0x081fe81a in zend_do_fcall_common_helper (execute_data=0xbfffccb0,
opline=0x407e7014,
op_array=0x407e5114) at
/usr/src/php-5.0.0RC2/Zend/zend_execute.c:2699
#4 0x081fb599 in execute (op_array=0x407e5114)
at /usr/src/php-5.0.0RC2/Zend/zend_execute.c:1391
#5 0x081fe60c in zend_do_fcall_common_helper (execute_data=0xbfffd030,
opline=0x407df938,
op_array=0x407de9b4) at
/usr/src/php-5.0.0RC2/Zend/zend_execute.c:2728
#6 0x081fb599 in execute (op_array=0x407de9b4)
at /usr/src/php-5.0.0RC2/Zend/zend_execute.c:1391
#7 0x081dfbe4 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/src/php-5.0.0RC2/Zend/zend.c:1058
#8 0x081accad in php_execute_script (primary_file=0xbffff3e0)
at /usr/src/php-5.0.0RC2/main/main.c:1630
#9 0x08207106 in main (argc=2, argv=0xbffff464)
at /usr/src/php-5.0.0RC2/sapi/cli/php_cli.c:943
#10 0x405b8dcc in __libc_start_main () from /lib/libc.so.6
--
Edit bug report at http://bugs.php.net/?id=28429&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28429&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28429&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28429&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28429&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28429&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28429&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28429&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28429&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28429&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28429&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28429&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28429&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28429&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28429&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28429&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28429&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28429&r=float