Assertion failure with ext/date DateInterval property hash construction
オープン
まだ誰も着手していません。
Bug
Extension: date
Status: Verified
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
The following code:
<?
for ($i = 0; $i <= 2; $j++) {
$a[] = $$x[ ! 0] = $obj = new DateInterval('P1W');
$a = false;
$aniay['abc'] = $obj->prop3 = $y = (array) $a[] =& $ $u;
$$x[$key]-= $aniay['abc'] = $a === $ao = new ArrayObject();
var_dump(json_decode(json_encode($a), '1000001'));
}
Resulted in this output:
php: /path/to/php-src/Zend/zend_hash.c:912: _zend_hash_str_add_or_update_i: Assertion `(zend_gc_refcount(&(ht)->gc) == 1) || ((ht)->u.flags & (1<<6))' failed.
Aborted
Commit:
035f95cf5e016236cca11bc293dc04d40b40e45c
Build configuration:
CC="clang" CXX="clang++" CFLAGS="-fsanitize=address -g -O0" CXXFLAGS="-fsanitize=address -g -O0" LDFLAGS="-fsanitize=address" ./buildconf --force && ./configure --enable-debug --enable-address-sanitizer --disable-shared --with-pic --enable-mbstring --with-zlib
PHP Version
PHP 8.6.0-dev (cli) (built: Nov 16 2025 19:51:33) (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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された debug および AddressSanitizer の設定で、コミット 035f95cf5e016236cca11bc293dc04d40b40e45c の PHP をビルドし、その後 reproducer を実行します。Zend/zend_hash.c:912 の assertion と ext/date の DateInterval の動作を調査します。完了の条件は、reproducer が abort せず、失敗に対する回帰テストのカバレッジがあることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100