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

==31746== Invalid read of size 1
==31746==    at 0xC903F5: php_var_dump (var.c:99)
==31746==    by 0xC90365: php_object_property_dump (var.c:82)
==31746==    by 0xEBAA12: zend_hash_apply_with_arguments (zend_hash.c:772)
==31746==    by 0xC90CE2: php_var_dump (var.c:146)
==31746==    by 0xC90FF4: zif_var_dump (var.c:183)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==  Address 0x153accb4 is 20 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid read of size 1
==31746==    at 0xC904E8: zval_isref_p (zend.h:413)
==31746==    by 0xC904E8: php_var_dump (var.c:104)
==31746==    by 0xC90365: php_object_property_dump (var.c:82)
==31746==    by 0xEBAA12: zend_hash_apply_with_arguments (zend_hash.c:772)
==31746==    by 0xC90CE2: php_var_dump (var.c:146)
==31746==    by 0xC90FF4: zif_var_dump (var.c:183)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==  Address 0x153accb5 is 21 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid read of size 4
==31746==    at 0xE7C1A0: zval_delref_p (zend.h:409)
==31746==    by 0xE7C1A0: i_zval_ptr_dtor (zend_execute.h:76)
==31746==    by 0xE7C1A0: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb0 is 16 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid write of size 4
==31746==    at 0xE7C1AA: zval_delref_p (zend.h:409)
==31746==    by 0xE7C1AA: i_zval_ptr_dtor (zend_execute.h:76)
==31746==    by 0xE7C1AA: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb0 is 16 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid read of size 4
==31746==    at 0xE7C1B1: zval_delref_p (zend.h:409)
==31746==    by 0xE7C1B1: i_zval_ptr_dtor (zend_execute.h:76)
==31746==    by 0xE7C1B1: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb0 is 16 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid read of size 4
==31746==    at 0xE7C296: zval_refcount_p (zend.h:397)
==31746==    by 0xE7C296: i_zval_ptr_dtor (zend_execute.h:86)
==31746==    by 0xE7C296: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb0 is 16 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid write of size 1
==31746==    at 0xE7C2AA: zval_unset_isref_p (zend.h:421)
==31746==    by 0xE7C2AA: i_zval_ptr_dtor (zend_execute.h:87)
==31746==    by 0xE7C2AA: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb5 is 21 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid read of size 1
==31746==    at 0xE7C2CC: gc_zval_check_possible_root (zend_gc.h:182)
==31746==    by 0xE7C2CC: i_zval_ptr_dtor (zend_execute.h:90)
==31746==    by 0xE7C2CC: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb4 is 20 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 
==31746== Invalid read of size 1
==31746==    at 0xE7C2EA: gc_zval_check_possible_root (zend_gc.h:182)
==31746==    by 0xE7C2EA: i_zval_ptr_dtor (zend_execute.h:90)
==31746==    by 0xE7C2EA: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEB9CF9: zend_hash_destroy (zend_hash.c:560)
==31746==    by 0xEE72F8: zend_object_std_dtor (zend_objects.c:44)
==31746==    by 0xEE7A5C: zend_objects_free_object_storage (zend_objects.c:137)
==31746==    by 0xEF70A6: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==31746==    by 0xEF6C40: zend_objects_store_del_ref (zend_objects_API.c:178)
==31746==    by 0xE9A489: _zval_dtor_func (zend_variables.c:54)
==31746==    by 0xE7C242: _zval_dtor (zend_variables.h:35)
==31746==    by 0xE7C242: i_zval_ptr_dtor (zend_execute.h:81)
==31746==    by 0xE7C242: _zval_ptr_dtor (zend_execute_API.c:423)
==31746==    by 0xEBA25A: zend_hash_apply_deleter (zend_hash.c:650)
==31746==    by 0xEBAC48: zend_hash_reverse_apply (zend_hash.c:804)
==31746==    by 0xE7B339: shutdown_destructors (zend_execute_API.c:214)
==31746==    by 0xE9DD64: zend_call_destructors (zend.c:930)
==31746==  Address 0x153accb4 is 20 bytes inside a block of size 32 free'd
==31746==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==31746==    by 0xE4A9CC: _efree (zend_alloc.c:2437)
==31746==    by 0xEE1347: gc_collect_cycles (zend_gc.c:846)
==31746==    by 0xEBFDFD: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==31746==    by 0xF04D61: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:550)
==31746==    by 0xF0EE9B: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2336)
==31746==    by 0xF029B0: execute_ex (zend_vm_execute.h:363)
==31746==    by 0xF03542: zend_execute (zend_vm_execute.h:388)
==31746==    by 0xE9FA90: zend_execute_scripts (zend.c:1327)
==31746==    by 0xDC231E: php_execute_script (main.c:2525)
==31746==    by 0x1088D81: do_cli (php_cli.c:994)
==31746==    by 0x108A52E: main (php_cli.c:1378)
==31746== 

 

Generated at Mon, 25 May 2015 21:58:44 +0000 (5 days ago)

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