From: keith at aphore dot com
Operating system: Redhat Linux 2.4.21 - Gcc 2.3
PHP version: 5.0.0b4 (beta4)
PHP Bug Type: Reproducible crash
Bug description: When creating a new Object inside another class called by the first
, Segfault
Description:
------------
PHP Segfaults When running the Following Piece of Code .
Yes i know its Bad Code , and you should never do that , but it should at
best Error out , not Segfault .
Keith
Reproduce code:
---------------
class rah {
function __construct ()
{
$bleh = new bleh();
}
}
$rah = new rah;
class bleh {
function __construct()
{
$rah = new rah();
}
}
Expected result:
----------------
It Should at best Error out , not Segfault !
Actual result:
--------------
output obtained via
gdb ~/bin/php core.15982
#0 0x081d9788 in zend_lookup_class (name=0x42279fe4 "rah", name_length=3,
ce=0xb4bcd034)
at /home/archer/php-5.0.0b4/Zend/zend_execute_API.c:806
806 zval class_name, *class_name_ptr = &class_name;
(gdb) bt
#0 0x081d9788 in zend_lookup_class (name=0x42279fe4 "rah", name_length=3,
ce=0xb4bcd034)
at /home/archer/php-5.0.0b4/Zend/zend_execute_API.c:806
#1 0x081d9fce in zend_fetch_class (class_name=0x42279fe4 "rah",
class_name_len=3, fetch_type=0)
at /home/archer/php-5.0.0b4/Zend/zend_execute_API.c:1195
#2 0x08204723 in zend_fetch_class_handler (execute_data=0xb4bcd100,
opline=0x42285838, op_array=0x42279dc0)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2382
#3 0x08201ed6 in execute (op_array=0x42279dc0) at
/home/archer/php-5.0.0b4/Zend/zend_execute.c:1339
#4 0x0820521b in zend_do_fcall_common_helper (execute_data=0xb4bcd240,
opline=0x42285684, op_array=0x42279730)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2671
#5 0x08205625 in zend_do_fcall_by_name_handler (execute_data=0xb4bcd240,
opline=0x42285684, op_array=0x42279730)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2753
#6 0x08201ed6 in execute (op_array=0x42279730) at
/home/archer/php-5.0.0b4/Zend/zend_execute.c:1339
#7 0x0820521b in zend_do_fcall_common_helper (execute_data=0xb4bcd380,
opline=0x42285968, op_array=0x42279dc0)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2671
#8 0x08205625 in zend_do_fcall_by_name_handler (execute_data=0xb4bcd380,
opline=0x42285968, op_array=0x42279dc0)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2753
#9 0x08201ed6 in execute (op_array=0x42279dc0) at
/home/archer/php-5.0.0b4/Zend/zend_execute.c:1339
#10 0x0820521b in zend_do_fcall_common_helper (execute_data=0xb4bcd4c0,
opline=0x42285684, op_array=0x42279730)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2671
#11 0x08205625 in zend_do_fcall_by_name_handler (execute_data=0xb4bcd4c0,
opline=0x42285684, op_array=0x42279730)
at /home/archer/php-5.0.0b4/Zend/zend_execute.c:2753
--
Edit bug report at http://bugs.php.net/?id=27589&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27589&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27589&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27589&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27589&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27589&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27589&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27589&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27589&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27589&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27589&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27589&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27589&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27589&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27589&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27589&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27589&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27589&r=float