Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure in Zend/zend_gc.c #15943

Open
YuanchengJiang opened this issue Sep 18, 2024 · 2 comments
Open

Assertion failure in Zend/zend_gc.c #15943

YuanchengJiang opened this issue Sep 18, 2024 · 2 comments

Comments

@YuanchengJiang
Copy link

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

@cmb69
Copy link
Member

cmb69 commented Sep 18, 2024

For me, this script outputs:

Fatal error: Allowed memory size of 8388608 bytes exhausted at Zend\zend_gc.c:2141 (tried to allocate 1048608 bytes) in %s on line %d
Assertion failed: idx, file Zend\zend_gc.c, line 791

@cmb69
Copy link
Member

cmb69 commented Sep 21, 2024

PHP-8.3 (and maybe lower branches) exhibit the same behavior.

@arnaud-lb arnaud-lb self-assigned this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants