[php-src] Issue #20171: Assertion failure in Zend VM during LazyProxy initialization with inherited by-reference __get()
(ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER)
| From: | vi3tL0u1s | Date: | Wed, 15 Oct 2025 02:57:53 +0000 |
| Subject: | [php-src] Issue #20171: Assertion failure in Zend VM during LazyProxy initialization with inherited by-reference __get() (ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER) |
||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251063@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20171
Author: vi3tL0u1s
### Description
The following code:
```php
<?php
class RealInstance {
public $_;
public function __get($nale) {
global $obj;
$obj->x;
return $this->$name;
}
}
class Proxy extends RealInstance {
public function&__get($name) {
return $this->$name;
}
}
$rc = new ReflectionClass(Proxy::class);
$obj = $rc->newLazyProxy(function () {
return new RealInstance;
});
$real = $rc->initializeLazyObject($obj);
var_dump($real->prop);
?>
```
Resulted in this output:
```
php: /path/to/php-src/Zend/zend_vm_execute.h:23159: ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER: Assertion
`retval_ptr != &(executor_globals.uninitialized_zval)' failed.
Aborted
```
Commit:
```
e2da92b15c7
```
Configurations:
```bash
CC="gcc" CXX="g++" CFLAGS="-fsanitize=address -g -O0"
CXXFLAGS="-fsanitize=address -g -O0" ./configure --enable-debug --enable-address-sanitizer
--disable-shared --with-pic
```
### PHP Version
```plain
PHP 8.6.0-dev (cli) (built: Oct 15 2025 13:52:11) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies
```
### Operating System
Ubuntu 22.04