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

==13725== Invalid read of size 1
==13725==    at 0xC37941: php_var_dump (var.c:99)
==13725==    by 0xC378B1: php_object_property_dump (var.c:82)
==13725==    by 0xE6111E: zend_hash_apply_with_arguments (zend_hash.c:772)
==13725==    by 0xC3822E: php_var_dump (var.c:146)
==13725==    by 0xC38540: zif_var_dump (var.c:183)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==  Address 0x153fb394 is 20 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid read of size 1
==13725==    at 0xC37A34: php_var_dump (zend.h:413)
==13725==    by 0xC378B1: php_object_property_dump (var.c:82)
==13725==    by 0xE6111E: zend_hash_apply_with_arguments (zend_hash.c:772)
==13725==    by 0xC3822E: php_var_dump (var.c:146)
==13725==    by 0xC38540: zif_var_dump (var.c:183)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==  Address 0x153fb395 is 21 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid read of size 4
==13725==    at 0xE22ABA: _zval_ptr_dtor (zend.h:409)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb390 is 16 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid write of size 4
==13725==    at 0xE22AC4: _zval_ptr_dtor (zend.h:409)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb390 is 16 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid read of size 4
==13725==    at 0xE22ACB: _zval_ptr_dtor (zend.h:409)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb390 is 16 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid read of size 4
==13725==    at 0xE22BB0: _zval_ptr_dtor (zend.h:397)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb390 is 16 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid write of size 1
==13725==    at 0xE22BC4: _zval_ptr_dtor (zend.h:421)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb395 is 21 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid read of size 1
==13725==    at 0xE22BE6: _zval_ptr_dtor (zend_gc.h:182)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb394 is 20 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 
==13725== Invalid read of size 1
==13725==    at 0xE22C04: _zval_ptr_dtor (zend_gc.h:182)
==13725==    by 0xE60405: zend_hash_destroy (zend_hash.c:560)
==13725==    by 0xE8D980: zend_object_std_dtor (zend_objects.c:44)
==13725==    by 0xE8E0E4: zend_objects_free_object_storage (zend_objects.c:137)
==13725==    by 0xE9D72E: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13725==    by 0xE9D2C8: zend_objects_store_del_ref (zend_objects_API.c:178)
==13725==    by 0xE40CB9: _zval_dtor_func (zend_variables.c:54)
==13725==    by 0xE22B5C: _zval_ptr_dtor (zend_variables.h:35)
==13725==    by 0xE60966: zend_hash_apply_deleter (zend_hash.c:650)
==13725==    by 0xE61354: zend_hash_reverse_apply (zend_hash.c:804)
==13725==    by 0xE21C59: shutdown_destructors (zend_execute_API.c:217)
==13725==    by 0xE44471: zend_call_destructors (zend.c:919)
==13725==  Address 0x153fb394 is 20 bytes inside a block of size 32 free'd
==13725==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13725==    by 0xDF1724: _efree (zend_alloc.c:2437)
==13725==    by 0xE879F6: gc_collect_cycles (zend_gc.c:851)
==13725==    by 0xE664A1: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13725==    by 0xEAB3E9: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==13725==    by 0xEB54B8: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2332)
==13725==    by 0xEA9038: execute_ex (zend_vm_execute.h:363)
==13725==    by 0xEA9BCA: zend_execute (zend_vm_execute.h:388)
==13725==    by 0xE4619D: zend_execute_scripts (zend.c:1316)
==13725==    by 0xD693A4: php_execute_script (main.c:2506)
==13725==    by 0x102A7B5: do_cli (php_cli.c:994)
==13725==    by 0x102BF62: main (php_cli.c:1378)
==13725== 

 

Generated at Tue, 19 Aug 2014 16:41:26 +0000 (2 days ago)

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