PHP  
 PHP_5_5
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for Zend/tests/bug64896.phpt ('Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)')

Script

1: <?php
2: $bar 
NULL;
3: class 
bad
4:
{
5:     private 
$_private = array();
6:
7:     public function 
__construct()
8:     {
9:         
$this->_private[] = 'php';
10:     }
11:
12:     public function 
__destruct()
13:     {
14:         global 
$bar;
15:         
$bar $this;
16:     }
17: }
18:
19:
$foo = new stdclass;
20:
$foo->foo $foo;
21:
$foo->bad = new bad;
22:
23:
gc_disable();
24:
25:
unserialize(serialize($foo));
26:
gc_collect_cycles();
27:
var_dump($bar); 
28:
/*  will output:
29: object(bad)#4 (1) {
30:   ["_private":"bad":private]=>
31:   &UNKNOWN:0
32: }
33: */
34:
?>
35:

Report

==2131== Invalid read of size 1
==2131==    at 0xC41D49: php_var_dump (var.c:99)
==2131==    by 0xC41CB9: php_object_property_dump (var.c:82)
==2131==    by 0xE6BA5E: zend_hash_apply_with_arguments (zend_hash.c:772)
==2131==    by 0xC42636: php_var_dump (var.c:146)
==2131==    by 0xC42948: zif_var_dump (var.c:183)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==  Address 0x153ace64 is 20 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid read of size 1
==2131==    at 0xC41E3C: zval_isref_p (zend.h:413)
==2131==    by 0xC41E3C: php_var_dump (var.c:104)
==2131==    by 0xC41CB9: php_object_property_dump (var.c:82)
==2131==    by 0xE6BA5E: zend_hash_apply_with_arguments (zend_hash.c:772)
==2131==    by 0xC42636: php_var_dump (var.c:146)
==2131==    by 0xC42948: zif_var_dump (var.c:183)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==  Address 0x153ace65 is 21 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid read of size 4
==2131==    at 0xE2D3EC: zval_delref_p (zend.h:409)
==2131==    by 0xE2D3EC: i_zval_ptr_dtor (zend_execute.h:76)
==2131==    by 0xE2D3EC: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace60 is 16 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid write of size 4
==2131==    at 0xE2D3F6: zval_delref_p (zend.h:409)
==2131==    by 0xE2D3F6: i_zval_ptr_dtor (zend_execute.h:76)
==2131==    by 0xE2D3F6: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace60 is 16 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid read of size 4
==2131==    at 0xE2D3FD: zval_delref_p (zend.h:409)
==2131==    by 0xE2D3FD: i_zval_ptr_dtor (zend_execute.h:76)
==2131==    by 0xE2D3FD: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace60 is 16 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid read of size 4
==2131==    at 0xE2D4E2: zval_refcount_p (zend.h:397)
==2131==    by 0xE2D4E2: i_zval_ptr_dtor (zend_execute.h:86)
==2131==    by 0xE2D4E2: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace60 is 16 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid write of size 1
==2131==    at 0xE2D4F6: zval_unset_isref_p (zend.h:421)
==2131==    by 0xE2D4F6: i_zval_ptr_dtor (zend_execute.h:87)
==2131==    by 0xE2D4F6: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace65 is 21 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid read of size 1
==2131==    at 0xE2D518: gc_zval_check_possible_root (zend_gc.h:182)
==2131==    by 0xE2D518: i_zval_ptr_dtor (zend_execute.h:90)
==2131==    by 0xE2D518: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace64 is 20 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 
==2131== Invalid read of size 1
==2131==    at 0xE2D536: gc_zval_check_possible_root (zend_gc.h:182)
==2131==    by 0xE2D536: i_zval_ptr_dtor (zend_execute.h:90)
==2131==    by 0xE2D536: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6AD45: zend_hash_destroy (zend_hash.c:560)
==2131==    by 0xE98340: zend_object_std_dtor (zend_objects.c:44)
==2131==    by 0xE98AA4: zend_objects_free_object_storage (zend_objects.c:137)
==2131==    by 0xEA80EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2131==    by 0xEA7C88: zend_objects_store_del_ref (zend_objects_API.c:178)
==2131==    by 0xE4B4D5: _zval_dtor_func (zend_variables.c:54)
==2131==    by 0xE2D48E: _zval_dtor (zend_variables.h:35)
==2131==    by 0xE2D48E: i_zval_ptr_dtor (zend_execute.h:81)
==2131==    by 0xE2D48E: _zval_ptr_dtor (zend_execute_API.c:423)
==2131==    by 0xE6B2A6: zend_hash_apply_deleter (zend_hash.c:650)
==2131==    by 0xE6BC94: zend_hash_reverse_apply (zend_hash.c:804)
==2131==    by 0xE2C585: shutdown_destructors (zend_execute_API.c:214)
==2131==    by 0xE4EDB0: zend_call_destructors (zend.c:930)
==2131==  Address 0x153ace64 is 20 bytes inside a block of size 32 free'd
==2131==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2131==    by 0xDFBDC4: _efree (zend_alloc.c:2437)
==2131==    by 0xE9239E: gc_collect_cycles (zend_gc.c:851)
==2131==    by 0xE70E49: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2131==    by 0xEB5DA9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==2131==    by 0xEBFE78: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==2131==    by 0xEB39F8: execute_ex (zend_vm_execute.h:363)
==2131==    by 0xEB458A: zend_execute (zend_vm_execute.h:388)
==2131==    by 0xE50ADC: zend_execute_scripts (zend.c:1327)
==2131==    by 0xD73A94: php_execute_script (main.c:2506)
==2131==    by 0x1035175: do_cli (php_cli.c:994)
==2131==    by 0x1036922: main (php_cli.c:1378)
==2131== 

 

Generated at Wed, 25 Feb 2015 17:32:32 +0000 (5 days ago)

Copyright © 2005-2015 The PHP Group
All rights reserved.