Edit report at https://bugs.php.net/bug.php?id=55425&edit=1
ID: 55425 Updated by: larue...@php.net Reported by: ajrattink at correct dot net Summary: closure with use of referenced array -> SEGV -Status: Feedback +Status: Closed Type: Bug Package: Reproducible crash Operating System: linux2.4.25 PHP Version: 5.3.6 -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: okey, well, I am going to close this report Previous Comments: ------------------------------------------------------------------------ [2011-08-16 12:43:30] ajrattink at correct dot net Tested with 5.3.7RC5, no more SEGV. ------------------------------------------------------------------------ [2011-08-16 04:54:28] larue...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Hi, I can reproduct this in php 5.3.6, and I have a quick look at php 5.3.7, seems there is no such issue in PHP 5.3.7, so plz try with php 5.3.7. ------------------------------------------------------------------------ [2011-08-15 16:00:53] ajrattink at correct dot net Description: ------------ If you reference an array (with instances) and 'use' that array in a closure (without referencing it again) you get a segmentation fault Using 'use (&$ar)' iso 'use ($ar)' fixes it. Test script: --------------- http://www.correct.nl/bug_closure_b338f79f99c96c55fc879211ca2fe370.php.txt Expected result: ---------------- exit 0, I guess Actual result: -------------- SEGV, gdb where -> #0 0x0827e6ff in zend_objects_store_del_ref_by_handle_ex () #1 0x0827e684 in zend_objects_store_del_ref () #2 0x082595a3 in _zval_dtor_func () #3 0x0824d238 in _zval_dtor () #4 0x0824d464 in _zval_ptr_dtor () #5 0x0826692a in _zend_hash_index_update_or_next_insert () #6 0x082677df in zend_hash_copy () #7 0x0825971f in _zval_copy_ctor_func () #8 0x0827f259 in _zval_copy_ctor () #9 0x08299456 in zend_send_by_var_helper_SPEC_VAR () #10 0x08299e34 in ZEND_SEND_VAR_SPEC_VAR_HANDLER () #11 0x08280901 in execute () #12 0x0825b513 in zend_execute_scripts () #13 0x0820088b in php_execute_script () #14 0x082ff885 in main () ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55425&edit=1