php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20320 _call() crashes with bus error in some circumstances
Submitted: 2002-11-08 16:52 UTC Modified: 2003-01-24 11:55 UTC
From: tater at potatoe dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4CVS-2002-11-08 OS: OS X 10.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tater at potatoe dot com
New email:
PHP Version: OS:

 

 [2002-11-08 16:52 UTC] tater at potatoe dot com
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) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-23 14:41 UTC] tater at potatoe dot com
All test cases work fine now.
 [2003-01-24 11:55 UTC] sniper@php.net
works -> closed.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC