Edit report at https://bugs.php.net/bug.php?id=65035&edit=1

 ID:                 65035
 Updated by:         ahar...@php.net
 Reported by:        ryan dot brothers at gmail dot com
 Summary:            yield / exit segfault
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   Linux
 PHP Version:        5.5Git-2013-06-13 (snap)
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2013-06-13 22:50:11] 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
---------------------------------------



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65035&edit=1

Reply via email to