|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-06-23 09:25 UTC] steve dot hall+bugs dot php dot net at rg456 dot co dot uk
Description: ------------ I get a segmentation fault on this line: https://github.com/symfony/symfony/blob/v3.3.2/src/Symfony/Component/VarDumper/Cloner/VarCloner.php#L123 The line runs perfectly well a few thousand times, but then seg faults at a certain point. I have been unable to recreate the bug in anything less than the total application that I am working on, and at this time I'm unable to share the full source code. I have tried capturing the state of all the variables involved using xDebug and reproducing in a standalone script but that doesn't cause the seg fault. I've serialized the variables and then attempted to read them back in and run the code in question but that doesn't cause it either. I've tried on Windows 10 with PHP 7.1.6 and Alpine Linux 3.4 with PHP 7.1.6 (in a container) and get the same seg fault on both. Test script: --------------- Have been unable to demonstrate in anything less than the full application. Expected result: ---------------- No segmentation fault. Actual result: -------------- GDB output and valgrind are here: https://gist.github.com/sh41/c1b5b6d0f2539357303fa43961fe2c95 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 10:00:01 2025 UTC |
Hi again nikic, I have gone through the code base and made every destructor just return without doing anything if there is an environment variable set: public function __destruct() { if (null !== getenv('NODESTRUCT')) return; //etc... } I've then re-run valgrind and it still comes out with things like this: ==63== Invalid read of size 4 ==63== at 0x7901BF: zval_delref_p (zend_types.h:838) ==63== by 0x7904AC: i_zval_ptr_dtor (zend_variables.h:47) ==63== by 0x7906A3: zend_object_std_dtor (zend_objects.c:68) ==63== by 0x77CBB1: zend_gc_collect_cycles (zend_gc.c:1175) ==63== by 0x77AAF4: gc_possible_root (zend_gc.c:286) ==63== by 0x728087: gc_check_possible_root (zend_gc.h:149) ==63== by 0x728137: i_zval_ptr_dtor (zend_variables.h:50) ==63== by 0x729D4C: _zval_ptr_dtor (zend_execute_API.c:550) ==63== by 0x60CC03: var_destroy (var_unserializer.c:234) ==63== by 0x60C5B1: php_var_unserialize_destroy (var_unserializer.c:53) ==63== by 0x5FB926: zif_unserialize (var.c:1131) ==63== by 0x7A918A: ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:876) ==63== by 0x7A7F69: execute_ex (zend_vm_execute.h:429) ==63== by 0x72B19D: zend_call_function (zend_execute_API.c:855) ==63== by 0x59B30D: zif_call_user_func_array (basic_functions.c:4860) ==63== by 0x7A918A: ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:876) ==63== by 0x7A7F69: execute_ex (zend_vm_execute.h:429) ==63== by 0x72B19D: zend_call_function (zend_execute_API.c:855) ==63== by 0x51B617: reflection_method_invoke (php_reflection.c:3325) ==63== by 0x51B7E7: zim_reflection_method_invokeArgs (php_reflection.c:3361) ==63== by 0x7A961A: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:970) ==63== by 0x7A7F69: execute_ex (zend_vm_execute.h:429) ==63== by 0x7A807A: zend_execute (zend_vm_execute.h:474) ==63== by 0x744DCD: zend_execute_scripts (zend.c:1476) ==63== by 0x6A8673: php_execute_script (main.c:2537) ==63== by 0x82EF29: do_cli (php_cli.c:993) ==63== by 0x8300F0: main (php_cli.c:1381) Have I misunderstood the cause of https://bugs.php.net/bug.php?id=72530 or is it possible that this fault has a different cause? My logic being that #72530 is caused by behaviour in the destructor, and I'm reasonably sure there is nothing happening in any of my destructors. Thanks