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

==4876== Invalid read of size 1
==4876==    at 0xB92E52: php_var_dump (var.c:99)
==4876==    by 0xB92DC4: php_object_property_dump (var.c:82)
==4876==    by 0xD9F5A1: zend_hash_apply_with_arguments (zend_hash.c:772)
==4876==    by 0xB936DD: php_var_dump (var.c:146)
==4876==    by 0xB939DA: zif_var_dump (var.c:183)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876==  Address 0x14dc8244 is 20 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid read of size 1
==4876==    at 0xB92F23: zval_isref_p (zend.h:399)
==4876==    by 0xB92F23: php_var_dump (var.c:104)
==4876==    by 0xB92DC4: php_object_property_dump (var.c:82)
==4876==    by 0xD9F5A1: zend_hash_apply_with_arguments (zend_hash.c:772)
==4876==    by 0xB936DD: php_var_dump (var.c:146)
==4876==    by 0xB939DA: zif_var_dump (var.c:183)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876==  Address 0x14dc8245 is 21 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid read of size 4
==4876==    at 0xD65079: zval_delref_p (zend.h:395)
==4876==    by 0xD65079: _zval_ptr_dtor (zend_execute_API.c:430)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8240 is 16 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid write of size 4
==4876==    at 0xD65083: zval_delref_p (zend.h:395)
==4876==    by 0xD65083: _zval_ptr_dtor (zend_execute_API.c:430)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8240 is 16 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid read of size 4
==4876==    at 0xD65095: zval_refcount_p (zend.h:383)
==4876==    by 0xD65095: _zval_ptr_dtor (zend_execute_API.c:431)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8240 is 16 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid read of size 4
==4876==    at 0xD651AE: zval_refcount_p (zend.h:383)
==4876==    by 0xD651AE: _zval_ptr_dtor (zend_execute_API.c:442)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8240 is 16 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid write of size 1
==4876==    at 0xD651C5: zval_unset_isref_p (zend.h:407)
==4876==    by 0xD651C5: _zval_ptr_dtor (zend_execute_API.c:443)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8245 is 21 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid read of size 1
==4876==    at 0xD651EA: gc_zval_check_possible_root (zend_gc.h:182)
==4876==    by 0xD651EA: _zval_ptr_dtor (zend_execute_API.c:446)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8244 is 20 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 
==4876== Invalid read of size 1
==4876==    at 0xD65208: gc_zval_check_possible_root (zend_gc.h:182)
==4876==    by 0xD65208: _zval_ptr_dtor (zend_execute_API.c:446)
==4876==    by 0xD9E89C: zend_hash_destroy (zend_hash.c:560)
==4876==    by 0xDC8164: zend_object_std_dtor (zend_objects.c:44)
==4876==    by 0xDC8830: zend_objects_free_object_storage (zend_objects.c:137)
==4876==    by 0xDD749E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4876==    by 0xDD70A6: zend_objects_store_del_ref (zend_objects_API.c:178)
==4876==    by 0xD8069C: _zval_dtor_func (zend_variables.c:54)
==4876==    by 0xD65154: _zval_dtor (zend_variables.h:35)
==4876==    by 0xD65154: _zval_ptr_dtor (zend_execute_API.c:436)
==4876==    by 0xD9EDF1: zend_hash_apply_deleter (zend_hash.c:650)
==4876==    by 0xD9F7D5: zend_hash_reverse_apply (zend_hash.c:804)
==4876==    by 0xD64489: shutdown_destructors (zend_execute_API.c:217)
==4876==    by 0xD83C39: zend_call_destructors (zend.c:932)
==4876==  Address 0x14dc8244 is 20 bytes inside a block of size 32 free'd
==4876==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==4876==    by 0xD38079: _efree (zend_alloc.c:2433)
==4876==    by 0xDC4D9C: gc_collect_cycles (zend_gc.c:851)
==4876==    by 0xDA4698: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4876==    by 0xDE3573: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==4876==    by 0xDED713: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==4876==    by 0xDE16CF: execute (zend_vm_execute.h:410)
==4876==    by 0xD8567C: zend_execute_scripts (zend.c:1329)
==4876==    by 0xCB77DD: php_execute_script (main.c:2502)
==4876==    by 0xF537C0: do_cli (php_cli.c:989)
==4876==    by 0xF54DFD: main (php_cli.c:1365)
==4876== 

 

Generated at Wed, 28 Jan 2015 13:21:41 +0000 (2 days ago)

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