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

==15472== Invalid read of size 1
==15472==    at 0xC4EBED: php_var_dump (var.c:99)
==15472==    by 0xC4EB5D: php_object_property_dump (var.c:82)
==15472==    by 0xE86215: zend_hash_apply_with_arguments (zend_hash.c:701)
==15472==    by 0xC4F4DA: php_var_dump (var.c:146)
==15472==    by 0xC4F7EC: zif_var_dump (var.c:183)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==  Address 0x153c2ce4 is 20 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid read of size 1
==15472==    at 0xC4ECE0: zval_isref_p (zend.h:415)
==15472==    by 0xC4ECE0: php_var_dump (var.c:104)
==15472==    by 0xC4EB5D: php_object_property_dump (var.c:82)
==15472==    by 0xE86215: zend_hash_apply_with_arguments (zend_hash.c:701)
==15472==    by 0xC4F4DA: php_var_dump (var.c:146)
==15472==    by 0xC4F7EC: zif_var_dump (var.c:183)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==  Address 0x153c2ce5 is 21 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid read of size 4
==15472==    at 0xE46033: zval_delref_p (zend.h:411)
==15472==    by 0xE46033: i_zval_ptr_dtor (zend_execute.h:76)
==15472==    by 0xE46033: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce0 is 16 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid write of size 4
==15472==    at 0xE4603D: zval_delref_p (zend.h:411)
==15472==    by 0xE4603D: i_zval_ptr_dtor (zend_execute.h:76)
==15472==    by 0xE4603D: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce0 is 16 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid read of size 4
==15472==    at 0xE46044: zval_delref_p (zend.h:411)
==15472==    by 0xE46044: i_zval_ptr_dtor (zend_execute.h:76)
==15472==    by 0xE46044: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce0 is 16 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid read of size 4
==15472==    at 0xE46129: zval_refcount_p (zend.h:399)
==15472==    by 0xE46129: i_zval_ptr_dtor (zend_execute.h:82)
==15472==    by 0xE46129: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce0 is 16 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid write of size 1
==15472==    at 0xE4613D: zval_unset_isref_p (zend.h:423)
==15472==    by 0xE4613D: i_zval_ptr_dtor (zend_execute.h:83)
==15472==    by 0xE4613D: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce5 is 21 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid read of size 1
==15472==    at 0xE4615F: gc_zval_check_possible_root (zend_gc.h:182)
==15472==    by 0xE4615F: i_zval_ptr_dtor (zend_execute.h:86)
==15472==    by 0xE4615F: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce4 is 20 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 
==15472== Invalid read of size 1
==15472==    at 0xE4617D: gc_zval_check_possible_root (zend_gc.h:182)
==15472==    by 0xE4617D: i_zval_ptr_dtor (zend_execute.h:86)
==15472==    by 0xE4617D: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE85829: zend_hash_destroy (zend_hash.c:548)
==15472==    by 0xEBA138: zend_object_std_dtor (zend_objects.c:44)
==15472==    by 0xEBA89C: zend_objects_free_object_storage (zend_objects.c:137)
==15472==    by 0xEC9DBA: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==15472==    by 0xEC9954: zend_objects_store_del_ref (zend_objects_API.c:178)
==15472==    by 0xE65ACF: _zval_dtor_func (zend_variables.c:57)
==15472==    by 0xE460D5: _zval_dtor (zend_variables.h:35)
==15472==    by 0xE460D5: i_zval_ptr_dtor (zend_execute.h:79)
==15472==    by 0xE460D5: _zval_ptr_dtor (zend_execute_API.c:424)
==15472==    by 0xE83088: i_zend_hash_bucket_delete (zend_hash.c:182)
==15472==    by 0xE83088: zend_hash_bucket_delete (zend_hash.c:192)
==15472==    by 0xE86448: zend_hash_reverse_apply (zend_hash.c:733)
==15472==    by 0xE451CC: shutdown_destructors (zend_execute_API.c:214)
==15472==    by 0xE69392: zend_call_destructors (zend.c:944)
==15472==  Address 0x153c2ce4 is 20 bytes inside a block of size 32 free'd
==15472==    at 0x4C27C24: free (vg_replace_malloc.c:473)
==15472==    by 0xE15158: _efree (zend_alloc.c:2437)
==15472==    by 0xEACD02: gc_collect_cycles (zend_gc.c:851)
==15472==    by 0xE8B68E: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==15472==    by 0xED7C48: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==15472==    by 0xEE3749: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==15472==    by 0xED56CE: execute_ex (zend_vm_execute.h:363)
==15472==    by 0xED6271: zend_execute (zend_vm_execute.h:388)
==15472==    by 0xE6B063: zend_execute_scripts (zend.c:1341)
==15472==    by 0xD89725: php_execute_script (main.c:2578)
==15472==    by 0x101DCBA: do_cli (php_cli.c:994)
==15472==    by 0x101F467: main (php_cli.c:1378)
==15472== 

 

Generated at Thu, 19 Feb 2015 15:41:59 +0000 (7 days ago)

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