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

==23453== Invalid read of size 1
==23453==    at 0xB93DFE: php_var_dump (var.c:99)
==23453==    by 0xB93D70: php_object_property_dump (var.c:82)
==23453==    by 0xDA0625: zend_hash_apply_with_arguments (zend_hash.c:772)
==23453==    by 0xB94689: php_var_dump (var.c:146)
==23453==    by 0xB94986: zif_var_dump (var.c:183)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453==  Address 0x14dc81d4 is 20 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid read of size 1
==23453==    at 0xB93ECF: zval_isref_p (zend.h:399)
==23453==    by 0xB93ECF: php_var_dump (var.c:104)
==23453==    by 0xB93D70: php_object_property_dump (var.c:82)
==23453==    by 0xDA0625: zend_hash_apply_with_arguments (zend_hash.c:772)
==23453==    by 0xB94689: php_var_dump (var.c:146)
==23453==    by 0xB94986: zif_var_dump (var.c:183)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453==  Address 0x14dc81d5 is 21 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid read of size 4
==23453==    at 0xD660FD: zval_delref_p (zend.h:395)
==23453==    by 0xD660FD: _zval_ptr_dtor (zend_execute_API.c:430)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid write of size 4
==23453==    at 0xD66107: zval_delref_p (zend.h:395)
==23453==    by 0xD66107: _zval_ptr_dtor (zend_execute_API.c:430)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid read of size 4
==23453==    at 0xD66119: zval_refcount_p (zend.h:383)
==23453==    by 0xD66119: _zval_ptr_dtor (zend_execute_API.c:431)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid read of size 4
==23453==    at 0xD66232: zval_refcount_p (zend.h:383)
==23453==    by 0xD66232: _zval_ptr_dtor (zend_execute_API.c:442)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid write of size 1
==23453==    at 0xD66249: zval_unset_isref_p (zend.h:407)
==23453==    by 0xD66249: _zval_ptr_dtor (zend_execute_API.c:443)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d5 is 21 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid read of size 1
==23453==    at 0xD6626E: gc_zval_check_possible_root (zend_gc.h:182)
==23453==    by 0xD6626E: _zval_ptr_dtor (zend_execute_API.c:446)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d4 is 20 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 
==23453== Invalid read of size 1
==23453==    at 0xD6628C: gc_zval_check_possible_root (zend_gc.h:182)
==23453==    by 0xD6628C: _zval_ptr_dtor (zend_execute_API.c:446)
==23453==    by 0xD9F920: zend_hash_destroy (zend_hash.c:560)
==23453==    by 0xDC9230: zend_object_std_dtor (zend_objects.c:44)
==23453==    by 0xDC98FC: zend_objects_free_object_storage (zend_objects.c:137)
==23453==    by 0xDD856A: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==23453==    by 0xDD8172: zend_objects_store_del_ref (zend_objects_API.c:178)
==23453==    by 0xD81720: _zval_dtor_func (zend_variables.c:54)
==23453==    by 0xD661D8: _zval_dtor (zend_variables.h:35)
==23453==    by 0xD661D8: _zval_ptr_dtor (zend_execute_API.c:436)
==23453==    by 0xD9FE75: zend_hash_apply_deleter (zend_hash.c:650)
==23453==    by 0xDA0859: zend_hash_reverse_apply (zend_hash.c:804)
==23453==    by 0xD6550D: shutdown_destructors (zend_execute_API.c:217)
==23453==    by 0xD84CBD: zend_call_destructors (zend.c:932)
==23453==  Address 0x14dc81d4 is 20 bytes inside a block of size 32 free'd
==23453==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==23453==    by 0xD390FD: _efree (zend_alloc.c:2433)
==23453==    by 0xDC5E68: gc_collect_cycles (zend_gc.c:851)
==23453==    by 0xDA571C: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==23453==    by 0xDE463F: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==23453==    by 0xDEE7DF: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==23453==    by 0xDE279B: execute (zend_vm_execute.h:410)
==23453==    by 0xD86700: zend_execute_scripts (zend.c:1329)
==23453==    by 0xCB88E1: php_execute_script (main.c:2502)
==23453==    by 0xF5488C: do_cli (php_cli.c:989)
==23453==    by 0xF55EC9: main (php_cli.c:1365)
==23453== 

 

Generated at Fri, 24 Apr 2015 17:26:59 +0000 (2 days ago)

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