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

==3330== Invalid read of size 1
==3330==    at 0xC45165: php_var_dump (var.c:99)
==3330==    by 0xC450D5: php_object_property_dump (var.c:82)
==3330==    by 0xE6F30E: zend_hash_apply_with_arguments (zend_hash.c:772)
==3330==    by 0xC45A52: php_var_dump (var.c:146)
==3330==    by 0xC45D64: zif_var_dump (var.c:183)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==  Address 0x153acdf4 is 20 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid read of size 1
==3330==    at 0xC45258: zval_isref_p (zend.h:413)
==3330==    by 0xC45258: php_var_dump (var.c:104)
==3330==    by 0xC450D5: php_object_property_dump (var.c:82)
==3330==    by 0xE6F30E: zend_hash_apply_with_arguments (zend_hash.c:772)
==3330==    by 0xC45A52: php_var_dump (var.c:146)
==3330==    by 0xC45D64: zif_var_dump (var.c:183)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==  Address 0x153acdf5 is 21 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid read of size 4
==3330==    at 0xE30B3C: zval_delref_p (zend.h:409)
==3330==    by 0xE30B3C: i_zval_ptr_dtor (zend_execute.h:76)
==3330==    by 0xE30B3C: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf0 is 16 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid write of size 4
==3330==    at 0xE30B46: zval_delref_p (zend.h:409)
==3330==    by 0xE30B46: i_zval_ptr_dtor (zend_execute.h:76)
==3330==    by 0xE30B46: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf0 is 16 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid read of size 4
==3330==    at 0xE30B4D: zval_delref_p (zend.h:409)
==3330==    by 0xE30B4D: i_zval_ptr_dtor (zend_execute.h:76)
==3330==    by 0xE30B4D: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf0 is 16 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid read of size 4
==3330==    at 0xE30C32: zval_refcount_p (zend.h:397)
==3330==    by 0xE30C32: i_zval_ptr_dtor (zend_execute.h:86)
==3330==    by 0xE30C32: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf0 is 16 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid write of size 1
==3330==    at 0xE30C46: zval_unset_isref_p (zend.h:421)
==3330==    by 0xE30C46: i_zval_ptr_dtor (zend_execute.h:87)
==3330==    by 0xE30C46: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf5 is 21 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid read of size 1
==3330==    at 0xE30C68: gc_zval_check_possible_root (zend_gc.h:182)
==3330==    by 0xE30C68: i_zval_ptr_dtor (zend_execute.h:90)
==3330==    by 0xE30C68: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf4 is 20 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 
==3330== Invalid read of size 1
==3330==    at 0xE30C86: gc_zval_check_possible_root (zend_gc.h:182)
==3330==    by 0xE30C86: i_zval_ptr_dtor (zend_execute.h:90)
==3330==    by 0xE30C86: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6E5F5: zend_hash_destroy (zend_hash.c:560)
==3330==    by 0xE9BBF4: zend_object_std_dtor (zend_objects.c:44)
==3330==    by 0xE9C358: zend_objects_free_object_storage (zend_objects.c:137)
==3330==    by 0xEAB9A2: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==3330==    by 0xEAB53C: zend_objects_store_del_ref (zend_objects_API.c:178)
==3330==    by 0xE4ED85: _zval_dtor_func (zend_variables.c:54)
==3330==    by 0xE30BDE: _zval_dtor (zend_variables.h:35)
==3330==    by 0xE30BDE: i_zval_ptr_dtor (zend_execute.h:81)
==3330==    by 0xE30BDE: _zval_ptr_dtor (zend_execute_API.c:423)
==3330==    by 0xE6EB56: zend_hash_apply_deleter (zend_hash.c:650)
==3330==    by 0xE6F544: zend_hash_reverse_apply (zend_hash.c:804)
==3330==    by 0xE2FCD5: shutdown_destructors (zend_execute_API.c:214)
==3330==    by 0xE52660: zend_call_destructors (zend.c:930)
==3330==  Address 0x153acdf4 is 20 bytes inside a block of size 32 free'd
==3330==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==3330==    by 0xDFF40C: _efree (zend_alloc.c:2437)
==3330==    by 0xE95C43: gc_collect_cycles (zend_gc.c:846)
==3330==    by 0xE746F9: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==3330==    by 0xEB965D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==3330==    by 0xEC3797: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==3330==    by 0xEB72AC: execute_ex (zend_vm_execute.h:363)
==3330==    by 0xEB7E3E: zend_execute (zend_vm_execute.h:388)
==3330==    by 0xE5438C: zend_execute_scripts (zend.c:1327)
==3330==    by 0xD7708E: php_execute_script (main.c:2525)
==3330==    by 0x103D675: do_cli (php_cli.c:994)
==3330==    by 0x103EE22: main (php_cli.c:1378)
==3330== 

 

Generated at Sat, 18 Apr 2015 12:48:18 +0000 (6 hours ago)

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