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

Segmentation fault (stack overflow) in Zend/zend_alloc.c:1435 #15904

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

Segmentation fault (stack overflow) in Zend/zend_alloc.c:1435 #15904

YuanchengJiang opened this issue Sep 16, 2024 · 2 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
class MemoryLeak
{
public function __construct()
{
$this->things[] = $this;
}
public function __destruct()
{
$fusion->things[] = null;
}
}
for ($i = 0; $i < 100000; ++$i) {
$obj = new MemoryLeak();
}

Resulted in this output: https://3v4l.org/9eRM1/rfc#vgit.master

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

@cmb69
Copy link
Member

cmb69 commented Sep 16, 2024

With less than or exactly 10,000 iterations, there is a single error reported. With more than 10,000 iterations, the errors are chained. Might be related to the GC.

Note that the deprecation warning is unrelated; the same happens when MemoryLeak::$things is declared.

@nielsdos
Copy link
Member

Related to #15869

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