We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 306a72a + 5e1b966 commit ff84598Copy full SHA for ff84598
Zend/tests/fibers/gh10437.phpt
@@ -0,0 +1,18 @@
1
+--TEST--
2
+GH-10437 (Segfault/assertion when using fibers in shutdown function after bailout)
3
+--FILE--
4
+<?php
5
+
6
+register_shutdown_function(function (): void {
7
+ var_dump(Fiber::getCurrent());
8
+});
9
10
+$fiber = new Fiber(function (): never {
11
+ trigger_error('Bailout in fiber', E_USER_ERROR);
12
13
+$fiber->start();
14
15
+?>
16
+--EXPECTF--
17
+Fatal error: Bailout in fiber in %sgh10437.php on line %d
18
+NULL
Zend/zend_fibers.c
@@ -645,6 +645,7 @@ static zend_always_inline zend_fiber_transfer zend_fiber_switch_to(
645
646
/* Forward bailout into current fiber. */
647
if (UNEXPECTED(transfer.flags & ZEND_FIBER_TRANSFER_FLAG_BAILOUT)) {
648
+ EG(active_fiber) = NULL;
649
zend_bailout();
650
}
651
0 commit comments