Assertion in zend_std_read_property: unset() of a hooked property through ArrayObject

未關閉
#25,308 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
c, php

研究方向

Start with Zend/zend_object_handlers.c, where the reported assertion occurs, and trace how ArrayObject handles unset() on a hooked property. Reproduce with the supplied PHP snippet using ./sapi/cli/php test.php; the report does not name a test file. Done means the assertion no longer fires and the snippet completes as expected.

由索引模型根據 Issue 內容生成。

描述

Bug Status: Needs Triage
Description

The following code:

<?php
class C {
    public $prop = 'x' {
        set => $value;
    }
}
$c = new C;
$ao = new ArrayObject($c);
unset($ao['prop']);
var_dump($c->prop);

Resulted in this output:

php: Zend/zend_object_handlers.c:838: zval *zend_std_read_property(zend_object *, zend_string *, int, void **, zval *): Assertion `(*(retval)).u2.extra & (1<<0)' failed.
Aborted (core dumped)

To reproduce: ./sapi/cli/php test.php

Commit:

33a61f765a94e018a8d55d962a73e8c8331ee256

Configurations:

CC="clang-12" CXX="clang++-12" CFLAGS="-DZEND_VERIFY_TYPE_INFERENCE" CXXFLAGS="-DZEND_VERIFY_TYPE_INFERENCE" ./configure --enable-debug --enable-address-sanitizer --enable-undefined-sanitizer --enable-re2c-cgoto --enable-zts --enable-bcmath --enable-calendar --enable-dba --enable-dl-test --enable-exif --enable-ftp --enable-gd --enable-gd-jis-conv --enable-mbstring --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-zend-test --with-zlib --with-bz2 --with-curl --with-enchant --with-gettext --with-gmp --with-mhash --with-ldap --with-libedit --with-readline --with-snmp --with-sodium --with-xsl --with-zip --with-mysqli --with-pdo-mysql --with-pdo-pgsql --with-pgsql --with-sqlite3 --with-pdo-sqlite --with-webp --with-jpeg --with-freetype --enable-sigchild --with-pcre-jit --with-iconv

Operating System:

Ubuntu 20.04 Host, Docker 0599jiangyc/flowfusion:latest

This report is automatically generated by FlowFusion

PHP Version
nightly
Operating System

No response

主要語言
C
星號
41.8k
分支
8.5k
平均合併
2 天 12 小時
30 天內合併 PR
137

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

php/php-src 的其他 Issue

查看 php/php-src 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。