[php-src] Issue #24430: SEGV in zend_generator_dtor_storage when GC closes cyclic generators in a Fiber
| From: | alexandre-daubois | Date: | Mon, 19 Oct 2026 13:13:27 +0000 |
| Subject: | [php-src] Issue #24430: SEGV in zend_generator_dtor_storage when GC closes cyclic generators in a Fiber | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-253027@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/24430
Author: alexandre-daubois
### Description
The following code:
```php
<?php
function inner($id) {
try {
yield;
} finally {
if ($id === 3) {
throw new RuntimeException();
}
}
}
function wrapper($gen) {
try {
yield from $gen;
} catch (Exception $e) {
} finally {
}
}
(new Fiber(function () {
$holders = [];
for ($i = 0; $i < 6; $i++) {
$generator = wrapper(inner($i));
$generator->current();
$holder = new stdClass();
$holder->generator = $generator;
$holder->self = $holder;
$holders[] = $holder;
}
unset($holders);
gc_collect_cycles();
}))->start();
echo "Done\n";
```
Resulted in this output:
```
AddressSanitizer: SEGV in zend_generator_dtor_storage
```
But I expected this output instead:
```
Done
```
### PHP Version
```plain
-
```
### Operating System
_No response_