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

==18303== Invalid read of size 1
==18303==    at 0xC34F01: php_var_dump (var.c:99)
==18303==    by 0xC34E71: php_object_property_dump (var.c:82)
==18303==    by 0xE5DF82: zend_hash_apply_with_arguments (zend_hash.c:772)
==18303==    by 0xC357EE: php_var_dump (var.c:146)
==18303==    by 0xC35B00: zif_var_dump (var.c:183)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==  Address 0x153f4f14 is 20 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid read of size 1
==18303==    at 0xC34FF4: php_var_dump (zend.h:413)
==18303==    by 0xC34E71: php_object_property_dump (var.c:82)
==18303==    by 0xE5DF82: zend_hash_apply_with_arguments (zend_hash.c:772)
==18303==    by 0xC357EE: php_var_dump (var.c:146)
==18303==    by 0xC35B00: zif_var_dump (var.c:183)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==  Address 0x153f4f15 is 21 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid read of size 4
==18303==    at 0xE1FD96: _zval_ptr_dtor (zend.h:409)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f10 is 16 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid write of size 4
==18303==    at 0xE1FDA0: _zval_ptr_dtor (zend.h:409)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f10 is 16 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid read of size 4
==18303==    at 0xE1FDA7: _zval_ptr_dtor (zend.h:409)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f10 is 16 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid read of size 4
==18303==    at 0xE1FE8C: _zval_ptr_dtor (zend.h:397)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f10 is 16 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid write of size 1
==18303==    at 0xE1FEA0: _zval_ptr_dtor (zend.h:421)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f15 is 21 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid read of size 1
==18303==    at 0xE1FEC2: _zval_ptr_dtor (zend_gc.h:182)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f14 is 20 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 
==18303== Invalid read of size 1
==18303==    at 0xE1FEE0: _zval_ptr_dtor (zend_gc.h:182)
==18303==    by 0xE5D269: zend_hash_destroy (zend_hash.c:560)
==18303==    by 0xE8A7E8: zend_object_std_dtor (zend_objects.c:44)
==18303==    by 0xE8AF4C: zend_objects_free_object_storage (zend_objects.c:137)
==18303==    by 0xE9A596: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==18303==    by 0xE9A130: zend_objects_store_del_ref (zend_objects_API.c:178)
==18303==    by 0xE3DB1D: _zval_dtor_func (zend_variables.c:54)
==18303==    by 0xE1FE38: _zval_ptr_dtor (zend_variables.h:35)
==18303==    by 0xE5D7CA: zend_hash_apply_deleter (zend_hash.c:650)
==18303==    by 0xE5E1B8: zend_hash_reverse_apply (zend_hash.c:804)
==18303==    by 0xE1EF35: shutdown_destructors (zend_execute_API.c:217)
==18303==    by 0xE412D5: zend_call_destructors (zend.c:919)
==18303==  Address 0x153f4f14 is 20 bytes inside a block of size 32 free'd
==18303==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==18303==    by 0xDEEADC: _efree (zend_alloc.c:2437)
==18303==    by 0xE8485A: gc_collect_cycles (zend_gc.c:851)
==18303==    by 0xE63305: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==18303==    by 0xEA8251: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==18303==    by 0xEB22C2: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2329)
==18303==    by 0xEA5EA0: execute_ex (zend_vm_execute.h:363)
==18303==    by 0xEA6A32: zend_execute (zend_vm_execute.h:388)
==18303==    by 0xE43001: zend_execute_scripts (zend.c:1316)
==18303==    by 0xD6679C: php_execute_script (main.c:2506)
==18303==    by 0x10274E5: do_cli (php_cli.c:994)
==18303==    by 0x1028C92: main (php_cli.c:1378)
==18303== 

 

Generated at Tue, 22 Apr 2014 03:58:31 +0000 (43 hours ago)

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