[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-internals
Subject:    [PHP-DEV] Bus error w/ __PHP_Incomplete_Class
From:       Timm Friebe <thekid () thekid ! de>
Date:       2004-03-28 15:14:57
Message-ID: 1080486897.4913.12.camel () localhost
[Download RAW message or body]

Hi,
accessing a non-existant member of (or calling a member function on) an
instance of __PHP_Incomplete_Class results in a bus error:

thekid@friebes:~/devel/php/php > cat incomplete_class.php
<?php
  $o= unserialize('O:1:"a":1:{s:5:"value";s:3:"100";}');
  var_dump($o);
  var_dump($o->member);
?>
thekid@friebes:~/devel/php/php > php-dev incomplete_class.php 
object(__PHP_Incomplete_Class)#1 (2) {
  ["__PHP_Incomplete_Class_Name"]=>
  string(1) "a"
  ["value"]=>
  string(3) "100"
}
Bus error (core dumped)

Expected output: a return value of NULL for access to a non-existant
member and E_ERROR for trying to invoke a member function.

-- gdb output --
Program received signal SIGBUS, Bus error.
0x828401b in zend_mm_create_new_free_block (heap=0x83b0cc8,
mm_block=0x8639004, 
    true_size=96) at /usr/home/thekid/devel/php/php/Zend/zend_mm.c:210
210             zend_mm_add_to_free_list(heap, new_free_block);

Backtrace ends in an endless loop of:

#0  0x828401b in zend_mm_create_new_free_block (heap=0x83b0cc8,
mm_block=0x8639004, 
    true_size=96) at /usr/home/thekid/devel/php/php/Zend/zend_mm.c:210
#1  0x82838b1 in zend_mm_alloc (heap=0x83b0cc8, size=84)
    at /usr/home/thekid/devel/php/php/Zend/zend_mm.c:341
#2  0x824bf4b in _emalloc (size=40, 
    __zend_filename=0x82f8640
"/usr/home/thekid/devel/php/php/Zend/zend_object_handlers.c",
__zend_lineno=675, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/home/thekid/devel/php/php/Zend/zend_alloc.c:168
#3  0x8281953 in zend_std_get_method (object=0x83c15d0, 
    method_name=0x82f87a0 "__call", method_len=6, tsrm_ls=0x8399050)
    at /usr/home/thekid/devel/php/php/Zend/zend_object_handlers.c:675
#4  0x825d71c in zend_call_function (fci=0xbfb001fc, fci_cache=0x0,
tsrm_ls=0x8399050)
    at /usr/home/thekid/devel/php/php/Zend/zend_execute_API.c:686
#5  0x825cf93 in call_user_function_ex (function_table=0x0,
object_pp=0xbfb002d0, 
    function_name=0xbfb00288, retval_ptr_ptr=0xbfb00274, param_count=2, 
    params=0xbfb00278, no_separation=0, symbol_table=0x0,
tsrm_ls=0x8399050)
    at /usr/home/thekid/devel/php/php/Zend/zend_execute_API.c:550
#6  0x828165a in zend_std_call_user_call (ht=2, return_value=0x8638e30, 
    this_ptr=0x83c15d0, return_value_used=1, tsrm_ls=0x8399050)
    at /usr/home/thekid/devel/php/php/Zend/zend_object_handlers.c:565
#7  0x825e4ac in zend_call_function (fci=0xbfb003bc, fci_cache=0x0,
tsrm_ls=0x8399050)
    at /usr/home/thekid/devel/php/php/Zend/zend_execute_API.c:853
#8  0x825cf93 in call_user_function_ex (function_table=0x0,
object_pp=0xbfb00490, 
    function_name=0xbfb00448, retval_ptr_ptr=0xbfb00434, param_count=2, 
    params=0xbfb00438, no_separation=0, symbol_table=0x0,
tsrm_ls=0x8399050)
    at /usr/home/thekid/devel/php/php/Zend/zend_execute_API.c:550


- Timm

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic