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

==32709== Invalid read of size 1
==32709==    at 0xC447BD: php_var_dump (var.c:99)
==32709==    by 0xC4472D: php_object_property_dump (var.c:82)
==32709==    by 0xE7B949: zend_hash_apply_with_arguments (zend_hash.c:701)
==32709==    by 0xC450AA: php_var_dump (var.c:146)
==32709==    by 0xC453BC: zif_var_dump (var.c:183)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==  Address 0x15413e14 is 20 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid read of size 1
==32709==    at 0xC448B0: php_var_dump (zend.h:415)
==32709==    by 0xC4472D: php_object_property_dump (var.c:82)
==32709==    by 0xE7B949: zend_hash_apply_with_arguments (zend_hash.c:701)
==32709==    by 0xC450AA: php_var_dump (var.c:146)
==32709==    by 0xC453BC: zif_var_dump (var.c:183)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==  Address 0x15413e15 is 21 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid read of size 4
==32709==    at 0xE3B62F: _zval_ptr_dtor (zend.h:411)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e10 is 16 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid write of size 4
==32709==    at 0xE3B639: _zval_ptr_dtor (zend.h:411)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e10 is 16 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid read of size 4
==32709==    at 0xE3B640: _zval_ptr_dtor (zend.h:411)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e10 is 16 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid read of size 4
==32709==    at 0xE3B725: _zval_ptr_dtor (zend.h:399)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e10 is 16 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid write of size 1
==32709==    at 0xE3B739: _zval_ptr_dtor (zend.h:423)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e15 is 21 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid read of size 1
==32709==    at 0xE3B75B: _zval_ptr_dtor (zend_gc.h:182)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e14 is 20 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 
==32709== Invalid read of size 1
==32709==    at 0xE3B779: _zval_ptr_dtor (zend_gc.h:182)
==32709==    by 0xE7AF5D: zend_hash_destroy (zend_hash.c:548)
==32709==    by 0xEAF7F0: zend_object_std_dtor (zend_objects.c:44)
==32709==    by 0xEAFF54: zend_objects_free_object_storage (zend_objects.c:137)
==32709==    by 0xEBF472: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==32709==    by 0xEBF00C: zend_objects_store_del_ref (zend_objects_API.c:178)
==32709==    by 0xE5B1DF: _zval_dtor_func (zend_variables.c:57)
==32709==    by 0xE3B6D1: _zval_ptr_dtor (zend_variables.h:35)
==32709==    by 0xE787BC: zend_hash_bucket_delete (zend_hash.c:182)
==32709==    by 0xE7BB7C: zend_hash_reverse_apply (zend_hash.c:733)
==32709==    by 0xE3A7C8: shutdown_destructors (zend_execute_API.c:217)
==32709==    by 0xE5EAA2: zend_call_destructors (zend.c:947)
==32709==  Address 0x15413e14 is 20 bytes inside a block of size 32 free'd
==32709==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==32709==    by 0xE0A994: _efree (zend_alloc.c:2437)
==32709==    by 0xEA23CE: gc_collect_cycles (zend_gc.c:851)
==32709==    by 0xE80D5A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==32709==    by 0xECD0DD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==32709==    by 0xED8BBE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==32709==    by 0xECAB69: execute_ex (zend_vm_execute.h:363)
==32709==    by 0xECB70C: zend_execute (zend_vm_execute.h:388)
==32709==    by 0xE60773: zend_execute_scripts (zend.c:1344)
==32709==    by 0xD7F079: php_execute_script (main.c:2584)
==32709==    by 0x101312E: do_cli (php_cli.c:994)
==32709==    by 0x10148DB: main (php_cli.c:1378)
==32709== 

 

Generated at Tue, 28 Oct 2014 09:43:43 +0000 (3 days ago)

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