php / php/php-src

Assertion failure Zend/zend_hash.c (Numeric Array Operations)

オープン
#19,605 コメント 2 件 リアクション 1 件 担当者 1 名 GitHub で見る

@iluuu1994 がすでに取り組んでいます。

2025年8月28日 から。

Bug Category: Engine Status: Verified
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

The following fuzzer-generated input:

https://github.com/vi3tL0u1s/poc/blob/master/php-src-assertion-bug

Resulted in this output:

php: /path/to/php-src/Zend/zend_hash.c:1090: zval *_zend_hash_index_add_or_update_i(HashTable *, zend_ulong, zval *, uint32_t): Assertion `(zend_gc_refcount(&(ht)->gc) == 1) || ((ht)->u.flags & (1<<6))' failed.
Aborted (core dumped)

To reproduce:

curl -s https://raw.githubusercontent.com/vi3tL0u1s/poc/master/php-src-assertion-bug | ./php-src/sapi/cli/php

Commit:

e844e68af8d

Configurations:

CC="clang" CXX="clang++" CFLAGS="-DZEND_VERIFY_TYPE_INFERENCE" CXXFLAGS="-DZEND_VERIFY_TYPE_INFERENCE" ./configure --enable-debug --enable-address-sanitizer --disable-all --enable-cli

Additional Notes

This appears to be related to issue #17935 but triggers through a different code path:

  • This issue: _zend_hash_index_add_or_update_i (line 1090) - numeric array operations
  • Issue #17935: _zend_hash_add_or_update_i (line 825) - string array operations
PHP Version
PHP 8.5.0-dev (cli) (built: Aug 27 2025 15:01:35) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0-dev, Copyright (c), by Zend Technologies
Operating System

Ubuntu 20.04

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。