[php-src] Issue #20615: Assertion failure in check_node_running_in_fiber() when resuming a generator inside a Fiber destructor
| From: | vi3tL0u1s | Date: | Sat, 29 Nov 2025 08:01:27 +0000 |
| Subject: | [php-src] Issue #20615: Assertion failure in check_node_running_in_fiber() when resuming a generator inside a Fiber destructor | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251324@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20615
Author: vi3tL0u1s
### Description
The following code:
```php
<?php
class a {
static $b;
static $max = 5.;
function __destruct() {
$a = new a;
static $gen = (function() {
$from = (function () {
$a = new a;
yield;
})();
try {
yield from $from;
} finally {
}
})();
$fiber = new Fiber(function () use ($gen, &$fiber) {
$gen->next();
});
$fiber->start();
}
}
new a;
```
Resulted in this output:
```
php: /path/to/php-src/Zend/zend_generators.c:217: _Bool check_node_running_in_fiber(zend_generator
*): Assertion `generator->execute_data' failed.
Aborted
```
Commit:
```
56795d2810e
```
Build configuration:
```
CC="clang" CXX="clang++" CFLAGS="-fsanitize=address -g -O0"
CXXFLAGS="-fsanitize=address -g -O0" LDFLAGS="-fsanitize=address" ./buildconf
--force && ./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic
--enable-mbstring --with-zlib
```
### PHP Version
```plain
PHP 8.6.0-dev (cli) (built: Nov 29 2025 14:32:34) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies
```
### Operating System
Ubuntu 22.04