Skip to content

Memory size and function nesting errors with Symfony 2.1.7 #6864

@XWB

Description

@XWB

Many applications are generating memory size and function nesting errors after upgrading to Symfony 2.1.7

For example:

Fatal error: Maximum function nesting level of '100' reached, aborting!
in /src/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 696

Call Stack:

1. Symfony\Component\DependencyInjection\Dumper\PhpDumper->hasReference() /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:962
...
99. Symfony\Component\DependencyInjection\Dumper\PhpDumper->hasReference() /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:971

The above error is generated by xdebug. But even increasing xdebug.max_nesting_level to 10000 (!) doesn't work, it keeps on showing PhpDumper->hasReference() messages.

Ok, so let's remove xdebug (which would not a solution because phpunit has a dependency on xdebug) and see what happens next: the function nesting errors are gone but now we get memory size errors.

For example:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32 bytes)
in /src/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 680

And after reloading the page:

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes)
in /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php on line 972
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 130968 bytes)
in /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php on line 962

Even after increasing the memory limit to 10 GB (!) those errors just keep on coming. Seems like an infinite loop.

We never experienced those errors before and switching back to Symfony 2.1.6 makes everything working again. What has changed in 2.1.7 that causes this strange behavior?

PHP 5.4.11 + XCache

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions