|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-06-13 22:50 UTC] ryan dot brothers at gmail dot com
Description:
------------
The following script causes a segfault. It is occurring when exit is called in a function that is called from a generator function.
Test script:
---------------
<?php
function f1()
{
f2();
$i = 0;
yield $i;
}
function f2()
{
exit;
}
$rows = f1();
foreach ($rows as $row)
{
}
Expected result:
----------------
Script exits with no output.
Actual result:
--------------
[Thu Jun 13 18:44:50 2013] Script: '/tmp/test.php'
---------------------------------------
/usr/local/src/php5.5-201306132030/Zend/zend_execute.h(196) : Block 0x7f7b17658d28 status:
Beginning: Freed
Start: OK
End: Overflown (magic=0x0000005A instead of 0xEAF0B464)
At least 4 bytes overflown
---------------------------------------
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
Confirmed on a current 5.5 build. Backtrace: #0 0x0000000000a7d621 in zend_vm_stack_destroy () at /home/adamh/trees/php-src/5.5/Zend/zend_execute.h:195 #1 0x0000000000a7e092 in shutdown_executor () at /home/adamh/trees/php-src/5.5/Zend/zend_execute_API.c:295 #2 0x0000000000a92e4a in zend_deactivate () at /home/adamh/trees/php- src/5.5/Zend/zend.c:939 #3 0x00000000009fb079 in php_request_shutdown (dummy=0x0) at /home/adamh/trees/php-src/5.5/main/main.c:1800 #4 0x0000000000b431d0 in do_cli (argc=2, argv=0x13ae240) at /home/adamh/trees/php-src/5.5/sapi/cli/php_cli.c:1176 #5 0x0000000000b43a65 in main (argc=2, argv=0x13ae240) at /home/adamh/trees/php-src/5.5/sapi/cli/php_cli.c:1377