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

==13517== Invalid read of size 1
==13517==    at 0xC408C1: php_var_dump (var.c:99)
==13517==    by 0xC40831: php_object_property_dump (var.c:82)
==13517==    by 0xE75239: zend_hash_apply_with_arguments (zend_hash.c:701)
==13517==    by 0xC411AE: php_var_dump (var.c:146)
==13517==    by 0xC414C0: zif_var_dump (var.c:183)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==  Address 0x1540dc64 is 20 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid read of size 1
==13517==    at 0xC409B4: php_var_dump (zend.h:415)
==13517==    by 0xC40831: php_object_property_dump (var.c:82)
==13517==    by 0xE75239: zend_hash_apply_with_arguments (zend_hash.c:701)
==13517==    by 0xC411AE: php_var_dump (var.c:146)
==13517==    by 0xC414C0: zif_var_dump (var.c:183)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==  Address 0x1540dc65 is 21 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid read of size 4
==13517==    at 0xE35041: _zval_ptr_dtor (zend.h:411)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc60 is 16 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid write of size 4
==13517==    at 0xE3504B: _zval_ptr_dtor (zend.h:411)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc60 is 16 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid read of size 4
==13517==    at 0xE35052: _zval_ptr_dtor (zend.h:411)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc60 is 16 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid read of size 4
==13517==    at 0xE35137: _zval_ptr_dtor (zend.h:399)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc60 is 16 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid write of size 1
==13517==    at 0xE3514B: _zval_ptr_dtor (zend.h:423)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc65 is 21 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid read of size 1
==13517==    at 0xE3516D: _zval_ptr_dtor (zend_gc.h:182)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc64 is 20 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 
==13517== Invalid read of size 1
==13517==    at 0xE3518B: _zval_ptr_dtor (zend_gc.h:182)
==13517==    by 0xE7484D: zend_hash_destroy (zend_hash.c:548)
==13517==    by 0xEA90E0: zend_object_std_dtor (zend_objects.c:44)
==13517==    by 0xEA9844: zend_objects_free_object_storage (zend_objects.c:137)
==13517==    by 0xEB8D62: zend_objects_store_del_ref_by_handle_ex (zend_objects_API.c:226)
==13517==    by 0xEB88FC: zend_objects_store_del_ref (zend_objects_API.c:178)
==13517==    by 0xE54BF3: _zval_dtor_func (zend_variables.c:57)
==13517==    by 0xE350E3: _zval_ptr_dtor (zend_variables.h:35)
==13517==    by 0xE720AC: zend_hash_bucket_delete (zend_hash.c:182)
==13517==    by 0xE7546C: zend_hash_reverse_apply (zend_hash.c:733)
==13517==    by 0xE341E0: shutdown_destructors (zend_execute_API.c:217)
==13517==    by 0xE58393: zend_call_destructors (zend.c:933)
==13517==  Address 0x1540dc64 is 20 bytes inside a block of size 32 free'd
==13517==    at 0x4C274D4: free (vg_replace_malloc.c:468)
==13517==    by 0xE044B0: _efree (zend_alloc.c:2437)
==13517==    by 0xE9BCBE: gc_collect_cycles (zend_gc.c:851)
==13517==    by 0xE7A64A: zif_gc_collect_cycles (zend_builtin_functions.c:361)
==13517==    by 0xEC69CD: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:558)
==13517==    by 0xED24AE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:2595)
==13517==    by 0xEC4459: execute_ex (zend_vm_execute.h:363)
==13517==    by 0xEC4FFC: zend_execute (zend_vm_execute.h:388)
==13517==    by 0xE5A064: zend_execute_scripts (zend.c:1330)
==13517==    by 0xD7ADAA: php_execute_script (main.c:2550)
==13517==    by 0x100CA1E: do_cli (php_cli.c:994)
==13517==    by 0x100E1CB: main (php_cli.c:1378)
==13517== 

 

Generated at Mon, 04 Aug 2014 15:49:20 +0000 (25 days ago)

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