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

==24911== Invalid read of size 1
==24911==    at 0xC4474D: php_var_dump (var.c:99)
==24911==    by 0xC446BD: php_object_property_dump (var.c:82)
==24911==    by 0xE7B8D9: zend_hash_apply_with_arguments (zend_hash.c:701)
==24911==    by 0xC4503A: php_var_dump (var.c:146)
==24911==    by 0xC4534C: zif_var_dump (var.c:183)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==  Address 0x15413da4 is 20 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid read of size 1
==24911==    at 0xC44840: php_var_dump (zend.h:415)
==24911==    by 0xC446BD: php_object_property_dump (var.c:82)
==24911==    by 0xE7B8D9: zend_hash_apply_with_arguments (zend_hash.c:701)
==24911==    by 0xC4503A: php_var_dump (var.c:146)
==24911==    by 0xC4534C: zif_var_dump (var.c:183)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==  Address 0x15413da5 is 21 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid read of size 4
==24911==    at 0xE3B5BF: _zval_ptr_dtor (zend.h:411)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da0 is 16 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid write of size 4
==24911==    at 0xE3B5C9: _zval_ptr_dtor (zend.h:411)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da0 is 16 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid read of size 4
==24911==    at 0xE3B5D0: _zval_ptr_dtor (zend.h:411)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da0 is 16 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid read of size 4
==24911==    at 0xE3B6B5: _zval_ptr_dtor (zend.h:399)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da0 is 16 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid write of size 1
==24911==    at 0xE3B6C9: _zval_ptr_dtor (zend.h:423)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da5 is 21 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid read of size 1
==24911==    at 0xE3B6EB: _zval_ptr_dtor (zend_gc.h:182)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da4 is 20 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 
==24911== Invalid read of size 1
==24911==    at 0xE3B709: _zval_ptr_dtor (zend_gc.h:182)
==24911==    by 0xE7AEED: zend_hash_destroy (zend_hash.c:548)
==24911==    by 0xEAF780: zend_object_std_dtor (zend_objects.c:44)
==24911==    by 0xEAFEE4: zend_objects_free_object_storage (zend_objects.c:137)
==24911==    by 0xEBF402: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==24911==    by 0xEBEF9C: zend_objects_store_del_ref (zend_objects_API.c:178)
==24911==    by 0xE5B16F: _zval_dtor_func (zend_variables.c:57)
==24911==    by 0xE3B661: _zval_ptr_dtor (zend_variables.h:35)
==24911==    by 0xE7874C: zend_hash_bucket_delete (zend_hash.c:182)
==24911==    by 0xE7BB0C: zend_hash_reverse_apply (zend_hash.c:733)
==24911==    by 0xE3A758: shutdown_destructors (zend_execute_API.c:217)
==24911==    by 0xE5EA32: zend_call_destructors (zend.c:947)
==24911==  Address 0x15413da4 is 20 bytes inside a block of size 32 free'd
==24911==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==24911==    by 0xE0A924: _efree (zend_alloc.c:2437)
==24911==    by 0xEA235E: gc_collect_cycles (zend_gc.c:851)
==24911==    by 0xE80CEA: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==24911==    by 0xECD06D: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==24911==    by 0xED8B4E: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==24911==    by 0xECAAF9: execute_ex (zend_vm_execute.h:363)
==24911==    by 0xECB69C: zend_execute (zend_vm_execute.h:388)
==24911==    by 0xE60703: zend_execute_scripts (zend.c:1344)
==24911==    by 0xD7F009: php_execute_script (main.c:2584)
==24911==    by 0x10130BE: do_cli (php_cli.c:994)
==24911==    by 0x101486B: main (php_cli.c:1378)
==24911== 

 

Generated at Mon, 20 Oct 2014 09:57:58 +0000 (2 days ago)

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