PHP  
 PHP_5_4
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

==2478== Invalid read of size 1
==2478==    at 0xC18982: php_var_dump (var.c:99)
==2478==    by 0xC188F4: php_object_property_dump (var.c:82)
==2478==    by 0xE255B5: zend_hash_apply_with_arguments (zend_hash.c:772)
==2478==    by 0xC1920D: php_var_dump (var.c:146)
==2478==    by 0xC1950A: zif_var_dump (var.c:183)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478==  Address 0x14dc9164 is 20 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid read of size 1
==2478==    at 0xC18A53: zval_isref_p (zend.h:399)
==2478==    by 0xC18A53: php_var_dump (var.c:104)
==2478==    by 0xC188F4: php_object_property_dump (var.c:82)
==2478==    by 0xE255B5: zend_hash_apply_with_arguments (zend_hash.c:772)
==2478==    by 0xC1920D: php_var_dump (var.c:146)
==2478==    by 0xC1950A: zif_var_dump (var.c:183)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478==  Address 0x14dc9165 is 21 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid read of size 4
==2478==    at 0xDEAFED: zval_delref_p (zend.h:395)
==2478==    by 0xDEAFED: _zval_ptr_dtor (zend_execute_API.c:430)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9160 is 16 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid write of size 4
==2478==    at 0xDEAFF7: zval_delref_p (zend.h:395)
==2478==    by 0xDEAFF7: _zval_ptr_dtor (zend_execute_API.c:430)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9160 is 16 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid read of size 4
==2478==    at 0xDEB009: zval_refcount_p (zend.h:383)
==2478==    by 0xDEB009: _zval_ptr_dtor (zend_execute_API.c:431)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9160 is 16 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid read of size 4
==2478==    at 0xDEB122: zval_refcount_p (zend.h:383)
==2478==    by 0xDEB122: _zval_ptr_dtor (zend_execute_API.c:442)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9160 is 16 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid write of size 1
==2478==    at 0xDEB139: zval_unset_isref_p (zend.h:407)
==2478==    by 0xDEB139: _zval_ptr_dtor (zend_execute_API.c:443)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9165 is 21 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid read of size 1
==2478==    at 0xDEB15E: gc_zval_check_possible_root (zend_gc.h:182)
==2478==    by 0xDEB15E: _zval_ptr_dtor (zend_execute_API.c:446)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9164 is 20 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 
==2478== Invalid read of size 1
==2478==    at 0xDEB17C: gc_zval_check_possible_root (zend_gc.h:182)
==2478==    by 0xDEB17C: _zval_ptr_dtor (zend_execute_API.c:446)
==2478==    by 0xE248B0: zend_hash_destroy (zend_hash.c:560)
==2478==    by 0xE4E1C0: zend_object_std_dtor (zend_objects.c:44)
==2478==    by 0xE4E88C: zend_objects_free_object_storage (zend_objects.c:137)
==2478==    by 0xE5D4FA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==2478==    by 0xE5D102: zend_objects_store_del_ref (zend_objects_API.c:178)
==2478==    by 0xE066B0: _zval_dtor_func (zend_variables.c:54)
==2478==    by 0xDEB0C8: _zval_dtor (zend_variables.h:35)
==2478==    by 0xDEB0C8: _zval_ptr_dtor (zend_execute_API.c:436)
==2478==    by 0xE24E05: zend_hash_apply_deleter (zend_hash.c:650)
==2478==    by 0xE257E9: zend_hash_reverse_apply (zend_hash.c:804)
==2478==    by 0xDEA3FD: shutdown_destructors (zend_execute_API.c:217)
==2478==    by 0xE09C4D: zend_call_destructors (zend.c:932)
==2478==  Address 0x14dc9164 is 20 bytes inside a block of size 32 free'd
==2478==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==2478==    by 0xDBDF8D: _efree (zend_alloc.c:2433)
==2478==    by 0xE4ADF8: gc_collect_cycles (zend_gc.c:851)
==2478==    by 0xE2A6AC: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==2478==    by 0xE695CF: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==2478==    by 0xE7376F: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==2478==    by 0xE6772B: execute (zend_vm_execute.h:410)
==2478==    by 0xE0B690: zend_execute_scripts (zend.c:1329)
==2478==    by 0xD3D465: php_execute_script (main.c:2502)
==2478==    by 0xFD981C: do_cli (php_cli.c:989)
==2478==    by 0xFDAE59: main (php_cli.c:1365)
==2478== 

 

Generated at Mon, 29 Jun 2015 08:37:06 +0000 (7 days ago)

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