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

==31730== Invalid read of size 1
==31730==    at 0xC18EB6: php_var_dump (var.c:99)
==31730==    by 0xC18E28: php_object_property_dump (var.c:82)
==31730==    by 0xE25B91: zend_hash_apply_with_arguments (zend_hash.c:772)
==31730==    by 0xC19741: php_var_dump (var.c:146)
==31730==    by 0xC19A3E: zif_var_dump (var.c:183)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730==  Address 0x14dd3824 is 20 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid read of size 1
==31730==    at 0xC18F87: zval_isref_p (zend.h:399)
==31730==    by 0xC18F87: php_var_dump (var.c:104)
==31730==    by 0xC18E28: php_object_property_dump (var.c:82)
==31730==    by 0xE25B91: zend_hash_apply_with_arguments (zend_hash.c:772)
==31730==    by 0xC19741: php_var_dump (var.c:146)
==31730==    by 0xC19A3E: zif_var_dump (var.c:183)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730==  Address 0x14dd3825 is 21 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid read of size 4
==31730==    at 0xDEB5C9: zval_delref_p (zend.h:395)
==31730==    by 0xDEB5C9: _zval_ptr_dtor (zend_execute_API.c:430)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3820 is 16 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid write of size 4
==31730==    at 0xDEB5D3: zval_delref_p (zend.h:395)
==31730==    by 0xDEB5D3: _zval_ptr_dtor (zend_execute_API.c:430)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3820 is 16 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid read of size 4
==31730==    at 0xDEB5E5: zval_refcount_p (zend.h:383)
==31730==    by 0xDEB5E5: _zval_ptr_dtor (zend_execute_API.c:431)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3820 is 16 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid read of size 4
==31730==    at 0xDEB6FE: zval_refcount_p (zend.h:383)
==31730==    by 0xDEB6FE: _zval_ptr_dtor (zend_execute_API.c:442)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3820 is 16 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid write of size 1
==31730==    at 0xDEB715: zval_unset_isref_p (zend.h:407)
==31730==    by 0xDEB715: _zval_ptr_dtor (zend_execute_API.c:443)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3825 is 21 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid read of size 1
==31730==    at 0xDEB73A: gc_zval_check_possible_root (zend_gc.h:182)
==31730==    by 0xDEB73A: _zval_ptr_dtor (zend_execute_API.c:446)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3824 is 20 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 
==31730== Invalid read of size 1
==31730==    at 0xDEB758: gc_zval_check_possible_root (zend_gc.h:182)
==31730==    by 0xDEB758: _zval_ptr_dtor (zend_execute_API.c:446)
==31730==    by 0xE24E8C: zend_hash_destroy (zend_hash.c:560)
==31730==    by 0xE4F3B4: zend_object_std_dtor (zend_objects.c:44)
==31730==    by 0xE4FA80: zend_objects_free_object_storage (zend_objects.c:137)
==31730==    by 0xE5E6EE: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31730==    by 0xE5E2F6: zend_objects_store_del_ref (zend_objects_API.c:178)
==31730==    by 0xE06C8C: _zval_dtor_func (zend_variables.c:54)
==31730==    by 0xDEB6A4: _zval_dtor (zend_variables.h:35)
==31730==    by 0xDEB6A4: _zval_ptr_dtor (zend_execute_API.c:436)
==31730==    by 0xE253E1: zend_hash_apply_deleter (zend_hash.c:650)
==31730==    by 0xE25DC5: zend_hash_reverse_apply (zend_hash.c:804)
==31730==    by 0xDEA9D9: shutdown_destructors (zend_execute_API.c:217)
==31730==    by 0xE0A229: zend_call_destructors (zend.c:932)
==31730==  Address 0x14dd3824 is 20 bytes inside a block of size 32 free'd
==31730==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31730==    by 0xDBE569: _efree (zend_alloc.c:2433)
==31730==    by 0xE4BFEC: gc_collect_cycles (zend_gc.c:851)
==31730==    by 0xE2ACA8: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31730==    by 0xE6A7C3: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:643)
==31730==    by 0xE74963: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2233)
==31730==    by 0xE6891F: execute (zend_vm_execute.h:410)
==31730==    by 0xE0BC6C: zend_execute_scripts (zend.c:1329)
==31730==    by 0xD3DA41: php_execute_script (main.c:2502)
==31730==    by 0xFDAA10: do_cli (php_cli.c:989)
==31730==    by 0xFDC04D: main (php_cli.c:1365)
==31730== 

 

Generated at Thu, 27 Aug 2015 06:06:26 +0000 (5 days ago)

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