# Bus error w/ __PHP_Incomplete_Class

- Thread: https://externals.io/message/8806
- Original archive: https://news-web.php.net/php.internals/8806
- Started by Timm Friebe on 2004-03-28T15:14:57+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8806 — Timm Friebe — 2004-03-28T15:14:57+00:00

URL: https://externals.io/message/8806#8806

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

---

## #9019 — Andi Gutmans — 2004-04-09T07:33:14+00:00

URL: https://externals.io/message/8806#9019 · In reply to: #8806

Not sure if I replied to the list but this should be fixed now.

At 05:14 PM 3/28/2004 +0200, Timm Friebe wrote:
>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
