-
Notifications
You must be signed in to change notification settings - Fork 7.9k
stack-overflow at zend_hash_compare #18572
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
Comments
@nielsdos (or @arnaud-lb) is it again the infinite stack overflow issue ? |
Yes. There is a deep recursion in Updating php-src/ext/json/json_encoder.c Line 129 in 47354a7
|
I tried a bit locally with 8.3 and your suggestion, still occurs ; not sure what is the appropriate ini version would be but I may go back at it later today. |
Right. If the overhead of checking the stack limit in |
With nested objects and recursive comparisons, it is for now unavoidable to have a stack overflow we do some early damage control attempt early on with zend.max_allowed_stack_size check but ultimately more a band-aid than a definitive solution.
while looking for a simpler reproducer this case triggers another, possibly known, bug class Node {
public $next;
}
$n = new Node();
$n->next = $n;
$n->previous = $n;
for ($i = 0; $i < 200000; $i++) {
$new = new Node();
$new->next = $n;
$new->previous = $n;
$n = $new;
}
|
Variant of #15869 essentially, I thought there was another one that had closer resemblance but I can't find it now |
With nested objects and recursive comparisons, it is for now unavoidable to have a stack overflow we do some early damage control attempt early on with zend.max_allowed_stack_size check but ultimately more a band-aid than a definitive solution. close GH-18577
Very partially fixed with the above PR, I keep it opened but feel free to close it is there a same report for this particular case. |
I'll close it then, the recursive destruction stack overflow is well known. |
Uh oh!
There was an error while loading. Please reload this page.
Description
The following code:
Resulted in this output:
PHP Version
latest and php-src-php-8.4.7
Operating System
ubuntu 20.04
The text was updated successfully, but these errors were encountered: