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

==27573== Invalid read of size 1
==27573==    at 0xB9071A: php_var_dump (var.c:99)
==27573==    by 0xB9068C: php_object_property_dump (var.c:82)
==27573==    by 0xD9C979: zend_hash_apply_with_arguments (zend_hash.c:772)
==27573==    by 0xB90FA5: php_var_dump (var.c:146)
==27573==    by 0xB912A2: zif_var_dump (var.c:183)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573==  Address 0x14e10864 is 20 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid read of size 1
==27573==    at 0xB907EB: php_var_dump (zend.h:399)
==27573==    by 0xB9068C: php_object_property_dump (var.c:82)
==27573==    by 0xD9C979: zend_hash_apply_with_arguments (zend_hash.c:772)
==27573==    by 0xB90FA5: php_var_dump (var.c:146)
==27573==    by 0xB912A2: zif_var_dump (var.c:183)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573==  Address 0x14e10865 is 21 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid read of size 4
==27573==    at 0xD6253D: _zval_ptr_dtor (zend.h:395)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10860 is 16 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid write of size 4
==27573==    at 0xD62547: _zval_ptr_dtor (zend.h:395)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10860 is 16 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid read of size 4
==27573==    at 0xD62559: _zval_ptr_dtor (zend.h:383)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10860 is 16 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid read of size 4
==27573==    at 0xD62672: _zval_ptr_dtor (zend.h:383)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10860 is 16 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid write of size 1
==27573==    at 0xD62689: _zval_ptr_dtor (zend.h:407)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10865 is 21 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid read of size 1
==27573==    at 0xD626AE: _zval_ptr_dtor (zend_gc.h:182)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10864 is 20 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 
==27573== Invalid read of size 1
==27573==    at 0xD626CC: _zval_ptr_dtor (zend_gc.h:182)
==27573==    by 0xD9BC74: zend_hash_destroy (zend_hash.c:560)
==27573==    by 0xDC554C: zend_object_std_dtor (zend_objects.c:44)
==27573==    by 0xDC5C18: zend_objects_free_object_storage (zend_objects.c:137)
==27573==    by 0xDD4886: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==27573==    by 0xDD448E: zend_objects_store_del_ref (zend_objects_API.c:178)
==27573==    by 0xD7DB60: _zval_dtor_func (zend_variables.c:54)
==27573==    by 0xD62618: _zval_ptr_dtor (zend_variables.h:35)
==27573==    by 0xD9C1C9: zend_hash_apply_deleter (zend_hash.c:650)
==27573==    by 0xD9CBAD: zend_hash_reverse_apply (zend_hash.c:804)
==27573==    by 0xD6194D: shutdown_destructors (zend_execute_API.c:217)
==27573==    by 0xD81011: zend_call_destructors (zend.c:918)
==27573==  Address 0x14e10864 is 20 bytes inside a block of size 32 free'd
==27573==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==27573==    by 0xD35615: _efree (zend_alloc.c:2433)
==27573==    by 0xDC2174: gc_collect_cycles (zend_gc.c:851)
==27573==    by 0xDA1A70: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==27573==    by 0xDE095B: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==27573==    by 0xDEAAFB: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==27573==    by 0xDDEAB7: execute (zend_vm_execute.h:410)
==27573==    by 0xD82A54: zend_execute_scripts (zend.c:1315)
==27573==    by 0xCB4DE9: php_execute_script (main.c:2502)
==27573==    by 0xF50AD0: do_cli (php_cli.c:989)
==27573==    by 0xF5210D: main (php_cli.c:1365)
==27573== 

 

Generated at Sun, 20 Apr 2014 03:52:23 +0000 (5 days ago)

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