Skip to content

BUG: out of memory error when using AbsorbingHandler for exceptions #3487

@christoph-daehne

Description

@christoph-daehne

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions