-
-
Notifications
You must be signed in to change notification settings - Fork 191
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 20480 bytes) in /app/Data/Temporary/Development/SubContextDocker/Cache/Code/Flow_Object_Classes/Neos_Neos_Fusion_NodeUriImplementation.php on line 162
Expected Behavior
An exception log file instead of the memory error.
Steps To Reproduce
There are different ways to trigger the error, I use the following example:
First you need a content element of type Neos.Neos:Plugin
which uses Neos.Neos:NodeUri
.
prototype(Flowpack.Neos.FrontendLogin:LoginForm) < prototype(Neos.Neos:Plugin) {
…
redirectAfterLoginUri = Neos.Neos:NodeUri {
node = ${q(node).property('redirectAfterLogin')}
}
…
}
Note that redirectAfterLogin
has no default value thus may be null
.
Environment
- Flow: 9.0 and 9.1
- Neos: 9.0 and 9.1
- PHP: 8.3
Anything else?
When redirectAfterLogin
is null
, NodeUriImplementation::evaluate()
called in PluginImplementation::evaluate()
throws.
Since the NodeUri
uses @exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\AbsorbingHandler'
the exception is ignored and a log is generated by calling Debugger::getObjectSnippetPlaintext(object)
.
At some point, object
is an instance of PluginImplementation
which implement __toString()
. Hence, __toString()
is used to create the log, but it looks as follows:
/**
* @return string
*/
public function __toString()
{
return $this->evaluate();
}
This causes an endless loop rendering the stack trace until the memory limit is reached.