File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 22|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33?? ??? ????, PHP 8.5.6
44
5+ - Core:
6+ . Fixed bug GH-19983 (GC assertion failure with fibers, generators and
7+ destructors). (iliaal)
58
6926 Mar 2026, PHP 8.5.5
710
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-19983 (GC Assertion Failure with fibers, generators and destructors)
3+ --SKIPIF--
4+ <?php if (PHP_INT_SIZE < 8 ) die ("skip 64-bit only - fiber stacks exhaust 32-bit address space " ); ?>
5+ --INI--
6+ memory_limit=128M
7+ --FILE--
8+ <?php
9+ class a
10+ {
11+ function __destruct ()
12+ {
13+ $ gen = (function () {
14+ $ from = (function () {
15+ $ cv = [new a ];
16+ Fiber::suspend ();
17+ })();
18+ yield from $ from ;
19+ })();
20+ $ fiber = new Fiber (function () use ($ gen , &$ fiber ) {
21+ $ gen ->current ();
22+ });
23+ $ fiber ->start ();
24+ }
25+ }
26+ new a ;
27+ ?>
28+ --EXPECTF--
29+ Fatal error: Allowed memory size of %d bytes exhausted%s
Original file line number Diff line number Diff line change @@ -1953,13 +1953,15 @@ static zend_never_inline void gc_call_destructors_in_fiber(uint32_t end)
19531953 GC_G (dtor_idx ) = GC_FIRST_ROOT ;
19541954 GC_G (dtor_end ) = GC_G (first_unused );
19551955
1956+ zend_object * exception = NULL ;
1957+ remember_prev_exception (& exception );
1958+
19561959 if (UNEXPECTED (!fiber )) {
19571960 fiber = gc_create_destructor_fiber ();
19581961 } else {
19591962 zend_fiber_resume (fiber , NULL , NULL );
19601963 }
19611964
1962- zend_object * exception = NULL ;
19631965 remember_prev_exception (& exception );
19641966
19651967 for (;;) {
You can’t perform that action at this time.
0 commit comments