Closed janbarasek closed 3 years ago
Dump looks correct. Instance refers to itself and dump stopped due to recursion. It even shows the same object id #369
to inform you it's the same instance.
I can't reproduce infinite loop killing application with following script - with Tracy enabled. But the same code in Nette presenter without Tracy enabled creates infinite loop. Problem is somewhere else, probably better use xdebug step debugging to find where the issue actually is.
<?php declare(strict_types = 1);
require __DIR__ . '/../vendor/autoload.php';
\Tracy\Debugger::enable(true);
$a = new class extends \RuntimeException {
public function setPrevious(\Throwable $e): void
{
$ref = new \ReflectionClass($this);
$parent = $ref->getParentClass()->getParentClass();
$previous = $parent->getProperty('previous');
$previous->setAccessible(true);
$previous->setValue($this, $e);
}
};
$a->setPrevious($a);
throw $a;
Version: all
Bug Description
In Tracy, there is a way to use recursive exceptions to drop the entire capture process via repeatedly writing
previous
.Steps To Reproduce
How to kill your application.
Use this code:
Dumped value is:
Note the recursion on the
previous
property, where Tracy recognizes it correctly. This logic must also be in the callstack statement.Expected Behavior
Stop callstack dumping in case of recursion, or at least limit the depth.
Thanks.