PHP  
 PHP_HEAD
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

==4514== Invalid read of size 1
==4514==    at 0xC3EDD1: php_var_dump (var.c:99)
==4514==    by 0xC3ED41: php_object_property_dump (var.c:82)
==4514==    by 0xE73655: zend_hash_apply_with_arguments (zend_hash.c:701)
==4514==    by 0xC3F6BE: php_var_dump (var.c:146)
==4514==    by 0xC3F9D0: zif_var_dump (var.c:183)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==  Address 0x15409944 is 20 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid read of size 1
==4514==    at 0xC3EEC4: php_var_dump (zend.h:415)
==4514==    by 0xC3ED41: php_object_property_dump (var.c:82)
==4514==    by 0xE73655: zend_hash_apply_with_arguments (zend_hash.c:701)
==4514==    by 0xC3F6BE: php_var_dump (var.c:146)
==4514==    by 0xC3F9D0: zif_var_dump (var.c:183)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==  Address 0x15409945 is 21 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid read of size 4
==4514==    at 0xE3345D: _zval_ptr_dtor (zend.h:411)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409940 is 16 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid write of size 4
==4514==    at 0xE33467: _zval_ptr_dtor (zend.h:411)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409940 is 16 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid read of size 4
==4514==    at 0xE3346E: _zval_ptr_dtor (zend.h:411)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409940 is 16 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid read of size 4
==4514==    at 0xE33553: _zval_ptr_dtor (zend.h:399)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409940 is 16 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid write of size 1
==4514==    at 0xE33567: _zval_ptr_dtor (zend.h:423)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409945 is 21 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid read of size 1
==4514==    at 0xE33589: _zval_ptr_dtor (zend_gc.h:182)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409944 is 20 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 
==4514== Invalid read of size 1
==4514==    at 0xE335A7: _zval_ptr_dtor (zend_gc.h:182)
==4514==    by 0xE72C69: zend_hash_destroy (zend_hash.c:548)
==4514==    by 0xEA73CC: zend_object_std_dtor (zend_objects.c:44)
==4514==    by 0xEA7B30: zend_objects_free_object_storage (zend_objects.c:137)
==4514==    by 0xEB704E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==4514==    by 0xEB6BE8: zend_objects_store_del_ref (zend_objects_API.c:178)
==4514==    by 0xE5300F: _zval_dtor_func (zend_variables.c:57)
==4514==    by 0xE334FF: _zval_ptr_dtor (zend_variables.h:35)
==4514==    by 0xE704C8: zend_hash_bucket_delete (zend_hash.c:182)
==4514==    by 0xE73888: zend_hash_reverse_apply (zend_hash.c:733)
==4514==    by 0xE325FC: shutdown_destructors (zend_execute_API.c:217)
==4514==    by 0xE567AF: zend_call_destructors (zend.c:933)
==4514==  Address 0x15409944 is 20 bytes inside a block of size 32 free'd
==4514==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==4514==    by 0xE028CC: _efree (zend_alloc.c:2437)
==4514==    by 0xE9A0DA: gc_collect_cycles (zend_gc.c:851)
==4514==    by 0xE78A66: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==4514==    by 0xEC4CB9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==4514==    by 0xED079A: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==4514==    by 0xEC2745: execute_ex (zend_vm_execute.h:363)
==4514==    by 0xEC32E8: zend_execute (zend_vm_execute.h:388)
==4514==    by 0xE58480: zend_execute_scripts (zend.c:1330)
==4514==    by 0xD79282: php_execute_script (main.c:2549)
==4514==    by 0x100ACEE: do_cli (php_cli.c:994)
==4514==    by 0x100C49B: main (php_cli.c:1378)
==4514== 

 

Generated at Tue, 22 Jul 2014 01:33:26 +0000 (7 days ago)

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