|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-06-23 02:54 UTC] ryan dot brothers at gmail dot com
Description:
------------
In the below script, the eval line has a parse error. The script continues as expected, but exits with a segmentation fault in the generator.
Test script:
---------------
<?php
@eval('abc');
class t1
{
public function test()
{
$values = array(1, 2);
foreach ($values as $value)
{
yield $value;
}
}
}
$t1 = new t1;
$values = $t1->test();
foreach ($values as $value)
{
}
Expected result:
----------------
No output
Actual result:
--------------
Segmentation fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 13:00:01 2025 UTC |
Thanks, I am running CentOS 6.5 64-bit. I compiled PHP from source and I was able to reproduce the issue with an empty configure line of "./configure". It seems this issue is only present when PHP is not compiled with --enable-debug. When I compiled with --enable-debug, I cannot reproduce this issue. Can you please try against a non-debug version of PHP to see if you can reproduce it? Here is the backtrace when running against a non-debug version of PHP: (gdb) run test.php Starting program: /usr/local/src/php-5.5.13-nodebug/sapi/cli/php a.php [Thread debugging using libthread_db enabled] Program received signal SIGSEGV, Segmentation fault. 0x00000000006c8371 in gc_zval_possible_root (zv=0x7ffff7fe0ec8) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_gc.c:143 143 GC_ZOBJ_CHECK_POSSIBLE_ROOT(zv); (gdb) bt #0 0x00000000006c8371 in gc_zval_possible_root (zv=0x7ffff7fe0ec8) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_gc.c:143 #1 0x00000000006cac4c in zend_generator_close (generator=0x7ffff7fda5b0, finished_execution=0 '\000') at /usr/local/src/php-5.5.13-nodebug/Zend/zend_generators.c:122 #2 0x00000000006cae5b in zend_generator_free_storage (generator=0x7ffff7fda5b0) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_generators.c:208 #3 0x00000000006d1228 in zend_objects_store_del_ref_by_handle_ex (handle=2, handlers=<value optimized out>) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_objects_API.c:226 #4 0x00000000006d1243 in zend_objects_store_del_ref (zobject=0x7ffff7fe0b30) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_objects_API.c:178 #5 0x0000000000699570 in _zval_dtor (zval_ptr=<value optimized out>) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_variables.h:35 #6 i_zval_ptr_dtor (zval_ptr=<value optimized out>) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_execute.h:81 #7 _zval_ptr_dtor (zval_ptr=<value optimized out>) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_execute_API.c:426 #8 0x00000000006b50d5 in zend_hash_apply_deleter (ht=0xdb8188, p=0x7ffff7fda7e8) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_hash.c:650 #9 0x00000000006b51e9 in zend_hash_reverse_apply (ht=0xdb8188, apply_func=0x698810 <zval_call_destructor>) at /usr/local/src/php-5.5.13-nodebug/Zend/zend_hash.c:804 #10 0x000000000069c1f5 in shutdown_destructors () at /usr/local/src/php-5.5.13-nodebug/Zend/zend_execute_API.c:217 #11 0x00000000006a84f4 in zend_call_destructors () at /usr/local/src/php-5.5.13-nodebug/Zend/zend.c:919 #12 0x0000000000649cb5 in php_request_shutdown (dummy=<value optimized out>) at /usr/local/src/php-5.5.13-nodebug/main/main.c:1750 #13 0x000000000075724f in do_cli (argc=2, argv=0xdb9a80) at /usr/local/src/php-5.5.13-nodebug/sapi/cli/php_cli.c:1177 #14 0x00000000007586b8 in main (argc=2, argv=0xdb9a80) at /usr/local/src/php-5.5.13-nodebug/sapi/cli/php_cli.c:1378