Skip to content

Segmentation fault in ext/zend_test/observer.c #16514

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
function it() {
yield from [1, 2, 3, 4, 5];
}
function bar($g) {
yield from $g;
}
$gen = it();
$gens[] = bar($gen);
do {
foreach($gens as $g) {
var_dump($g->current());
}
} while ($gen->valid());

Resulted in this output:

/php-src/ext/zend_test/observer.c:168:12: runtime error: member access within null pointer of type 'zend_function' (aka 'union _zend_function')

To reproduce:

-d "zend_test.observer.enabled=1" -d "zend_test.observer.show_init_backtrace=1"

PHP Version

nightly

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions