mirror of
https://github.com/php/php-src.git
synced 2026-04-09 00:53:30 +02:00
Merge branch 'PHP-8.2'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug GH-10496 (Segfault when garbage collector is invoked inside of fiber)
|
||||
Bug GH-10496 001 (Segfault when garbage collector is invoked inside of fiber)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
26
Zend/tests/fibers/gh10496-002.phpt
Normal file
26
Zend/tests/fibers/gh10496-002.phpt
Normal file
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug GH-10496 002 (Segfault when garbage collector is invoked inside of fiber)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function pollute_stack_and_suspend($a = 1, $b = 2, $c = 3) {
|
||||
Fiber::suspend();
|
||||
}
|
||||
|
||||
$f = new Fiber(function() use (&$f) {
|
||||
pollute_stack_and_suspend();
|
||||
(function() {
|
||||
(function() {
|
||||
(new Fiber(function() {
|
||||
gc_collect_cycles();
|
||||
echo "Success\n";
|
||||
}))->start();
|
||||
})();
|
||||
})();
|
||||
});
|
||||
$f->start();
|
||||
$f->resume();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Success
|
||||
@@ -743,7 +743,7 @@ static HashTable *zend_fiber_object_gc(zend_object *object, zval **table, int *n
|
||||
zend_get_gc_buffer_add_zval(buf, &fiber->fci.function_name);
|
||||
zend_get_gc_buffer_add_zval(buf, &fiber->result);
|
||||
|
||||
if (fiber->context.status != ZEND_FIBER_STATUS_SUSPENDED) {
|
||||
if (fiber->context.status != ZEND_FIBER_STATUS_SUSPENDED || fiber->caller != NULL) {
|
||||
zend_get_gc_buffer_use(buf, table, num);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user