From:             [EMAIL PROTECTED]
Operating system: OS X 10.1.5
PHP version:      4CVS-2002-11-08
PHP Bug Type:     Zend Engine 2 problem
Bug description:  _call() crashes with bus error in some circumstances

some kind of hashtable problem, looks like. variations on a simple
command-line class definition crash with a bus error, trying to catch
undefined method call with a __call() method.
here is backtrace showing some things that work and some that don't:

(gdb) r -r 'class foo { function __call($m,$a) { echo "abcdefg\n"; return;
} } $x = new foo; $x->nothere();'
Starting program: /usr/local/book/php4-ze2/sapi/cli/php -r 'class foo {
function __call($m,$a) { echo "abcdefg\n"; return; } } $x = new foo;
$x->nothere();'
[Switching to process 21057 thread 0x3413]
abcdefg

Program exited normally.
(gdb) r -r 'class foo { function __call($m,$a) { echo "abcdef\n"; return;
} } $x = new foo; $x->nothere();'
Starting program: /usr/local/book/php4-ze2/sapi/cli/php -r 'class foo {
function __call($m,$a) { echo "abcdef\n"; return; } } $x = new foo;
$x->nothere();'
[Switching to process 21062 thread 0x3713]

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x001c06e0 in _zend_is_inconsistent (ht=0x0, file=0x208d38
"/Users/tater/book/php4-ze2/Zend/zend_hash.c", line=871) at
/Users/tater/book/php4-ze2/Zend/zend_hash.c:78
78              if (ht->inconsistent==HT_OK) {
(gdb) bt
#0  0x001c06e0 in _zend_is_inconsistent (ht=0x0, file=0x208d38
"/Users/tater/book/php4-ze2/Zend/zend_hash.c", line=871) at
/Users/tater/book/php4-ze2/Zend/zend_hash.c:78
#1  0x001c3a9c in zend_hash_find (ht=0x0, arKey=0x6eda60 "__call",
nKeyLength=7, pData=0xbffff284) at
/Users/tater/book/php4-ze2/Zend/zend_hash.c:871
#2  0x001aab38 in call_user_function_ex (function_table=0x0,
object_pp=0x0, function_name=0xbffff340, retval_ptr_ptr=0xbffff360,
param_count=2, params=0xbffff358, no_separation=0, symbol_table=0x0) at
/Users/tater/book/php4-ze2/Zend/zend_execute_API.c:558
#3  0x001cfb54 in zend_std_call_user_call (ht=0, return_value=0x6ed958,
this_ptr=0x0, return_value_used=0) at
/Users/tater/book/php4-ze2/Zend/zend_object_handlers.c:353
#4  0x001da1f0 in zend_do_fcall_common_helper (execute_data=0xbffff5c8,
op_array=0x6ed1b8) at /Users/tater/book/php4-ze2/Zend/zend_execute.c:2422
#5  0x001da900 in zend_do_fcall_by_name_handler (execute_data=0xbffff5c8,
op_array=0x6ed1b8) at /Users/tater/book/php4-ze2/Zend/zend_execute.c:2514
#6  0x001d3adc in execute (op_array=0x6ed1b8) at
/Users/tater/book/php4-ze2/Zend/zend_execute.c:1194
#7  0x001ab8b0 in zend_eval_string (str=0xbffffbf1 "class foo { function
__call($m,$a) { echo \"abcdef\\n\"; return; } } $x = new foo;
$x->nothere();", retval_ptr=0x0, string_name=0x20a790 "Command line code")
at /Users/tater/book/php4-ze2/Zend/zend_execute_API.c:757
#8  0x001e47c0 in main (argc=3, argv=0xbffffb1c) at
/Users/tater/book/php4-ze2/sapi/cli/php_cli.c:743
#9  0x00001a44 in _start ()
#10 0x00001874 in start ()
(gdb) r -r 'class foo { function __call($m,$a) { echo "abcdefg\n";  } } $x
= new foo; $x->nothere();'
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/book/php4-ze2/sapi/cli/php -r 'class foo {
function __call($m,$a) { echo "abcdefg\n";  } } $x = new foo;
$x->nothere();'
[Switching to process 21067 thread 0x3d0f]

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x001c06e0 in _zend_is_inconsistent (ht=0x0, file=0x208d38
"/Users/tater/book/php4-ze2/Zend/zend_hash.c", line=871) at
/Users/tater/book/php4-ze2/Zend/zend_hash.c:78
78              if (ht->inconsistent==HT_OK) {
(gdb) r -r 'class foo { function __call($m,$a) { echo "abcdef\n";  } } $x
= new foo; $x->nothere();'
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/book/php4-ze2/sapi/cli/php -r 'class foo {
function __call($m,$a) { echo "abcdef\n";  } } $x = new foo;
$x->nothere();'
[Switching to process 21072 thread 0x400b]

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x001c06e0 in _zend_is_inconsistent (ht=0x0, file=0x208d38
"/Users/tater/book/php4-ze2/Zend/zend_hash.c", line=871) at
/Users/tater/book/php4-ze2/Zend/zend_hash.c:78
78              if (ht->inconsistent==HT_OK) {
(gdb) r -r 'class foo { function __call($m,$a) { echo "abcde\n";  } } $x =
new foo; $x->nothere();'
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/book/php4-ze2/sapi/cli/php -r 'class foo {
function __call($m,$a) { echo "abcde\n";  } } $x = new foo;
$x->nothere();'
[Switching to process 21077 thread 0x262f]
abcde

Program exited normally.
(gdb) 

-- 
Edit bug report at http://bugs.php.net/?id=20320&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20320&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20320&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20320&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20320&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20320&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20320&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20320&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20320&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20320&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20320&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20320&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20320&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20320&r=isapi

Reply via email to