Skip to content

Assertion `(zend_gc_refcount(&(ht)->gc) == 1) || ((ht)->u.flags & (1<<6))' failed. #10085

Open
@Changochen

Description

@Changochen

Description

The following code:

<?[$i]=$i[]=$i=&$Yhh;$i[$m==$i[]=$i];$h=$i[$m==$i[]=0]+=$Yhh;

Resulted in this output:

Zend/zend_hash.c:1007: 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.

Reproduce steps:

./configure --disable-all --enable-address-sanitizer --disable-phpdbg --disable-cgi --with-pic --enable-debug-assertions
make -j
./sapi/cli/php -f poc.php

Git commit: b96b88b

PS: Without the debug assertions, the poc doesn't trigger a crash or abort by sanitizer.

PHP Version

PHP 8.3.0-dev

Operating System

Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions