[php-src] Issue #20893: Assertion failure in check_node_running_in_fiber with generator in destructor
[email protected] (vi3tL0u1s)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <5dyxs7QEZ2ohC8roGv9K6mHnyi71Xfs1gATlga260no@main.internal.php.net> |
Issue: https://github.com/php/php-src/issues/20893
Author: vi3tL0u1s
### Description
The following code:
```php
<?php
class a {
static $b;
static $max = 2.;
function __destruct() {
if (self::$max-- < 0) return;
self::$b = $this;
static $gen = (function() {
$from = (function () {
x:$n[] = new a;
yield;
})();
try { yield from $from; } finally {}
})();
$fiber = new Fiber(function () use ($gen) {
$gen->current();
$gen->next();
});
$fiber->start();
}
}
new a;
```
```
php: /path/to/php-src/Zend/zend_generators.c:217: check_node_running_in_fiber: Assertion `generator->execute_data' failed.
Aborted
```
## Commit
`c518a6ba8bf7a3eb6551424c7ca90dfa06b01b15`
## Configurations
```
./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic --enable-mbstring --with-zlib
```
### PHP Version
```plain
PHP 8.6.0-dev (cli) (built: Jan 9 2026 14:43:36) (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