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

==13134== Invalid read of size 1
==13134==    at 0xB92F6A: php_var_dump (var.c:99)
==13134==    by 0xB92EDC: php_object_property_dump (var.c:82)
==13134==    by 0xD9F639: zend_hash_apply_with_arguments (zend_hash.c:772)
==13134==    by 0xB937F5: php_var_dump (var.c:146)
==13134==    by 0xB93AF2: zif_var_dump (var.c:183)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134==  Address 0x14dc81d4 is 20 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid read of size 1
==13134==    at 0xB9303B: zval_isref_p (zend.h:399)
==13134==    by 0xB9303B: php_var_dump (var.c:104)
==13134==    by 0xB92EDC: php_object_property_dump (var.c:82)
==13134==    by 0xD9F639: zend_hash_apply_with_arguments (zend_hash.c:772)
==13134==    by 0xB937F5: php_var_dump (var.c:146)
==13134==    by 0xB93AF2: zif_var_dump (var.c:183)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134==  Address 0x14dc81d5 is 21 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid read of size 4
==13134==    at 0xD65111: zval_delref_p (zend.h:395)
==13134==    by 0xD65111: _zval_ptr_dtor (zend_execute_API.c:430)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid write of size 4
==13134==    at 0xD6511B: zval_delref_p (zend.h:395)
==13134==    by 0xD6511B: _zval_ptr_dtor (zend_execute_API.c:430)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid read of size 4
==13134==    at 0xD6512D: zval_refcount_p (zend.h:383)
==13134==    by 0xD6512D: _zval_ptr_dtor (zend_execute_API.c:431)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid read of size 4
==13134==    at 0xD65246: zval_refcount_p (zend.h:383)
==13134==    by 0xD65246: _zval_ptr_dtor (zend_execute_API.c:442)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d0 is 16 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid write of size 1
==13134==    at 0xD6525D: zval_unset_isref_p (zend.h:407)
==13134==    by 0xD6525D: _zval_ptr_dtor (zend_execute_API.c:443)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d5 is 21 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid read of size 1
==13134==    at 0xD65282: gc_zval_check_possible_root (zend_gc.h:182)
==13134==    by 0xD65282: _zval_ptr_dtor (zend_execute_API.c:446)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d4 is 20 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 
==13134== Invalid read of size 1
==13134==    at 0xD652A0: gc_zval_check_possible_root (zend_gc.h:182)
==13134==    by 0xD652A0: _zval_ptr_dtor (zend_execute_API.c:446)
==13134==    by 0xD9E934: zend_hash_destroy (zend_hash.c:560)
==13134==    by 0xDC81FC: zend_object_std_dtor (zend_objects.c:44)
==13134==    by 0xDC88C8: zend_objects_free_object_storage (zend_objects.c:137)
==13134==    by 0xDD7536: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13134==    by 0xDD713E: zend_objects_store_del_ref (zend_objects_API.c:178)
==13134==    by 0xD80734: _zval_dtor_func (zend_variables.c:54)
==13134==    by 0xD651EC: _zval_dtor (zend_variables.h:35)
==13134==    by 0xD651EC: _zval_ptr_dtor (zend_execute_API.c:436)
==13134==    by 0xD9EE89: zend_hash_apply_deleter (zend_hash.c:650)
==13134==    by 0xD9F86D: zend_hash_reverse_apply (zend_hash.c:804)
==13134==    by 0xD64521: shutdown_destructors (zend_execute_API.c:217)
==13134==    by 0xD83CD1: zend_call_destructors (zend.c:932)
==13134==  Address 0x14dc81d4 is 20 bytes inside a block of size 32 free'd
==13134==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==13134==    by 0xD38111: _efree (zend_alloc.c:2433)
==13134==    by 0xDC4E34: gc_collect_cycles (zend_gc.c:851)
==13134==    by 0xDA4730: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13134==    by 0xDE360B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==13134==    by 0xDED7AB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==13134==    by 0xDE1767: execute (zend_vm_execute.h:410)
==13134==    by 0xD85714: zend_execute_scripts (zend.c:1329)
==13134==    by 0xCB78F5: php_execute_script (main.c:2502)
==13134==    by 0xF53858: do_cli (php_cli.c:989)
==13134==    by 0xF54E95: main (php_cli.c:1365)
==13134== 

 

Generated at Mon, 23 Feb 2015 15:19:44 +0000 (3 days ago)

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