From 65eba5e36a31b71c15460b6824af606bfdf452ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20D=C3=A4hne?= Date: Sat, 21 Jun 2025 14:30:07 +0200 Subject: [PATCH 1/2] BUGFIX: out of memory error when using AbsorbingHandler for exceptions #5576 resolves https://github.com/neos/neos-development-collection/issues/5576 --- Neos.Flow/Classes/Error/Debugger.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Neos.Flow/Classes/Error/Debugger.php b/Neos.Flow/Classes/Error/Debugger.php index de53c73e42..b50aa42b26 100644 --- a/Neos.Flow/Classes/Error/Debugger.php +++ b/Neos.Flow/Classes/Error/Debugger.php @@ -399,6 +399,18 @@ protected static function renderCallArgumentsHtml(array $callArguments): string */ protected static function getBacktraceCodePlaintext(array $trace, bool $includeCode = true): string { + $exception = new \Exception(); + $callstack = $exception->getTraceAsString(); + if (substr_count($callstack, __METHOD__) > 3) { + + $explanation = <<<'EOT' + There seems to be an error while rendering the stack trace, see https://github.com/neos/neos-development-collection/issues/5576 . + This might happen due to broken __toString() methods: an error occurs -> we generate the log here -> call __toString() again -> error occurs again -> we generate the log here again -> call __toString() again -> ... + Inspect the other log file in Data/Logs/Exceptions with the same creation time to find the original error. + EOT; + return __METHOD__ . " already on the call stack 3 times, aborting now\n" . $explanation; + } + $backtraceCode = ''; foreach ($trace as $index => $step) { $class = isset($step['class']) ? $step['class'] . '::' : ''; From 16c05fc1603ff75bcc0d6ae159e7ba4153e71393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20D=C3=A4hne?= Date: Sat, 21 Jun 2025 14:51:04 +0200 Subject: [PATCH 2/2] fixup! BUGFIX: out of memory error when using AbsorbingHandler for exceptions #5576 --- Neos.Flow/Classes/Error/Debugger.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Neos.Flow/Classes/Error/Debugger.php b/Neos.Flow/Classes/Error/Debugger.php index b50aa42b26..24942c6485 100644 --- a/Neos.Flow/Classes/Error/Debugger.php +++ b/Neos.Flow/Classes/Error/Debugger.php @@ -402,7 +402,6 @@ protected static function getBacktraceCodePlaintext(array $trace, bool $includeC $exception = new \Exception(); $callstack = $exception->getTraceAsString(); if (substr_count($callstack, __METHOD__) > 3) { - $explanation = <<<'EOT' There seems to be an error while rendering the stack trace, see https://github.com/neos/neos-development-collection/issues/5576 . This might happen due to broken __toString() methods: an error occurs -> we generate the log here -> call __toString() again -> error occurs again -> we generate the log here again -> call __toString() again -> ...