Assertion failure in Zend/zend_gc.c
Open
@arnaud-lb is already working on this.
Since Sep 21, 2024.
Bug
Category: GC
Status: Verified
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The following code:
<?php
$wm = new WeakMap();
for ($i = 0; $i < 30_000; $i++) {
$fusion[] = $obj = new stdClass;
$wm[$obj] = $obj;
}
$tmp = $wm;
$tmp = null;
gc_collect_cycles();
Resulted in this output:
/php-src/Zend/zend_gc.c:791: gc_remove_from_buffer: Assertion `idx' failed.
Aborted (core dumped)
To reproduce:
-d "memory_limit=8M"
PHP Version
PHP 8.4.0-dev
Operating System
ubuntu 22.04
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.