Assertion failure Zend/zend_hash.c (Numeric Array Operations)
Offen
@iluuu1994 arbeitet bereits daran.
Seit 28.8.2025.
Bug
Category: Engine
Status: Verified
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.2k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.