Destruction segmentation fault for deeply nested objects
Open
Nobody has claimed this yet.
Category: Engine
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
Description
The following code:
<?php
abstract class LinkedList { }
final class Cons extends LinkedList
{
public function __construct(
public mixed $head,
public LinkedList $tail
) { }
}
final class Nil extends LinkedList { }
$list = new Nil();
for ($i = 0; $i < 100000; $i++) {
$list = new Cons(random_int(0, PHP_INT_MAX), $list);
}
Resulted in this output:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
But I expected this output instead:
Process finished with exit code 0
PHP Version
PHP 8.0.13 (cli)
Operating System
Ubuntu 20.04
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by running the provided PHP script with PHP 8.0.13 on Ubuntu 20.04 and confirm the SIGSEGV after creating 100,000 nested objects. The issue does not name a documentation file, test, or proposed change; resolution would require identifying the relevant PHP runtime behavior rather than an obvious edit in this repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100