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

==4525== Invalid read of size 1
==4525==    at 0xC41899: php_var_dump (var.c:99)
==4525==    by 0xC41809: php_object_property_dump (var.c:82)
==4525==    by 0xE6B3AA: zend_hash_apply_with_arguments (zend_hash.c:772)
==4525==    by 0xC42186: php_var_dump (var.c:146)
==4525==    by 0xC42498: zif_var_dump (var.c:183)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==  Address 0x1586c864 is 20 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid read of size 1
==4525==    at 0xC4198C: php_var_dump (zend.h:413)
==4525==    by 0xC41809: php_object_property_dump (var.c:82)
==4525==    by 0xE6B3AA: zend_hash_apply_with_arguments (zend_hash.c:772)
==4525==    by 0xC42186: php_var_dump (var.c:146)
==4525==    by 0xC42498: zif_var_dump (var.c:183)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==  Address 0x1586c865 is 21 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid read of size 4
==4525==    at 0xE2CD38: _zval_ptr_dtor (zend.h:409)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c860 is 16 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid write of size 4
==4525==    at 0xE2CD42: _zval_ptr_dtor (zend.h:409)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c860 is 16 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid read of size 4
==4525==    at 0xE2CD49: _zval_ptr_dtor (zend.h:409)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c860 is 16 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid read of size 4
==4525==    at 0xE2CE2E: _zval_ptr_dtor (zend.h:397)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c860 is 16 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid write of size 1
==4525==    at 0xE2CE42: _zval_ptr_dtor (zend.h:421)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c865 is 21 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid read of size 1
==4525==    at 0xE2CE64: _zval_ptr_dtor (zend_gc.h:182)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c864 is 20 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 
==4525== Invalid read of size 1
==4525==    at 0xE2CE82: _zval_ptr_dtor (zend_gc.h:182)
==4525==    by 0xE6A691: zend_hash_destroy (zend_hash.c:560)
==4525==    by 0xE97C0C: zend_object_std_dtor (zend_objects.c:44)
==4525==    by 0xE98370: zend_objects_free_object_storage (zend_objects.c:137)
==4525==    by 0xEA79BA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4525==    by 0xEA7554: zend_objects_store_del_ref (zend_objects_API.c:178)
==4525==    by 0xE4AE21: _zval_dtor_func (zend_variables.c:54)
==4525==    by 0xE2CDDA: _zval_ptr_dtor (zend_variables.h:35)
==4525==    by 0xE6ABF2: zend_hash_apply_deleter (zend_hash.c:650)
==4525==    by 0xE6B5E0: zend_hash_reverse_apply (zend_hash.c:804)
==4525==    by 0xE2BED1: shutdown_destructors (zend_execute_API.c:214)
==4525==    by 0xE4E6FC: zend_call_destructors (zend.c:930)
==4525==  Address 0x1586c864 is 20 bytes inside a block of size 32 free'd
==4525==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4525==    by 0xDFB710: _efree (zend_alloc.c:2437)
==4525==    by 0xE91C82: gc_collect_cycles (zend_gc.c:851)
==4525==    by 0xE7072D: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4525==    by 0xEB5675: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==4525==    by 0xEBF744: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==4525==    by 0xEB32C4: execute_ex (zend_vm_execute.h:363)
==4525==    by 0xEB3E56: zend_execute (zend_vm_execute.h:388)
==4525==    by 0xE50428: zend_execute_scripts (zend.c:1327)
==4525==    by 0xD733D4: php_execute_script (main.c:2506)
==4525==    by 0x1034A41: do_cli (php_cli.c:994)
==4525==    by 0x10361EE: main (php_cli.c:1378)
==4525== 

 

Generated at Thu, 18 Dec 2014 07:17:56 +0000 (29 hours ago)

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