Issue 1:
Hello,

I have just upgraded from 2.0 to 2.1.7 and now I am getting an issue with the form builder. I have a FormType class and have stripped the buildForm function back to just trying to generate a date field:

$builder->add('fromDate', 'date');

The 'form_widget' call set in the template and outputting the following:

( ! ) Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/duncan/workspace/sap-ecom-mobile/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/StopwatchEvent.php on line 176
Call Stack
TimeMemoryFunctionLocation
10.0005242088{main}( )../app_dev.php:0
20.02563410224Symfony\Component\HttpKernel\Kernel->handle( )../app_dev.php:25
30.04645493232Symfony\Bundle\FrameworkBundle\HttpKernel->handle( )../bootstrap.php.cache:617
40.04645494984Symfony\Component\HttpKernel\HttpKernel->handle( )../bootstrap.php.cache:1566
50.04645495048Symfony\Component\HttpKernel\HttpKernel->handleRaw( )../bootstrap.php.cache:1390
60.06657453840call_user_func_array
( )../bootstrap.php.cache:1426
70.06657454360Sap\ProductBundle\Controller\ProductController->eventsAction( )../bootstrap.php.cache:1426
80.06657455064Symfony\Bundle\FrameworkBundle\Controller\Controller->forward( )../ProductController.php:30
90.06657455264Symfony\Bundle\FrameworkBundle\HttpKernel->forward( )../Controller.php:59
100.06657458248Symfony\Bundle\FrameworkBundle\HttpKernel->handle( )../bootstrap.php.cache:1584
110.06667461168Symfony\Component\HttpKernel\HttpKernel->handle( )../bootstrap.php.cache:1566
120.06667461168Symfony\Component\HttpKernel\HttpKernel->handleRaw( )../bootstrap.php.cache:1390
130.07097585920call_user_func_array
( )../bootstrap.php.cache:1426
140.07097586344Sap\ProductBundle\Controller\CourseController->eventsAction( )../bootstrap.php.cache:1426
150.522317254144Symfony\Bundle\FrameworkBundle\Controller\Controller->render( )../CourseController.php:51
160.531618356448Symfony\Bundle\TwigBundle\TwigEngine->renderResponse( )../Controller.php:99
170.531818359728Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine->render( )../TwigEngine.php:107
180.531818360696Symfony\Bundle\TwigBundle\TwigEngine->render( )../TimedTwigEngine.php:52
190.531818360856Symfony\Bridge\Twig\TwigEngine->render( )../TwigEngine.php:78
200.533318567144Twig_Template->render( )../TwigEngine.php:53
210.533318583848Twig_Template->display( )../classes.php:9296
220.533618603112Twig_Template->displayWithErrorHandling( )../classes.php:9286
230.533618603288__TwigTemplate_12c4067714418b81a6ddf3e2501af700->doDisplay( )../classes.php:9308
240.533618604064Twig_Template->display( )../067714418b81a6ddf3e2501af700.php:28
250.533618604128Twig_Template->displayWithErrorHandling( )../classes.php:9286
260.533618604304__TwigTemplate_1aec4047416fb8017e6f74876684a414->doDisplay( )../classes.php:9308
270.918422987184Twig_Template->displayBlock( )../4047416fb8017e6f74876684a414.php:113
280.918422987896call_user_func
( )../classes.php:9189
290.918422987928__TwigTemplate_12c4067714418b81a6ddf3e2501af700->block_content( )../classes.php:9189
300.933723133768Symfony\Bundle\TwigBundle\Extension\ActionsExtension->renderAction( )../067714418b81a6ddf3e2501af700.php:189
310.933723133768Symfony\Bundle\FrameworkBundle\Templating\Helper\ActionsHelper->render( )../ActionsExtension.php:47
320.933723134072Symfony\Bundle\FrameworkBundle\HttpKernel->render( )../ActionsHelper.php:49
330.933823141440Symfony\Bundle\FrameworkBundle\HttpKernel->handle( )../bootstrap.php.cache:1667
340.933823143672Symfony\Component\HttpKernel\HttpKernel->handle( )../bootstrap.php.cache:1566
350.933823143672Symfony\Component\HttpKernel\HttpKernel->handleRaw( )../bootstrap.php.cache:1390
360.939323259704call_user_func_array
( )../bootstrap.php.cache:1426
370.939323260040Sap\TrainingPlannerBundle\Controller\PrebookingController->indexAction( )../bootstrap.php.cache:1426
380.969126088368Symfony\Bundle\FrameworkBundle\Controller\Controller->render( )../PrebookingController.php:46
390.969126088480Symfony\Bundle\TwigBundle\TwigEngine->renderResponse( )../Controller.php:99
400.969226090600Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine->render( )../TwigEngine.php:107
410.969226091488Symfony\Bundle\TwigBundle\TwigEngine->render( )../TimedTwigEngine.php:52
420.969226091488Symfony\Bridge\Twig\TwigEngine->render( )../TwigEngine.php:78
430.969826160320Twig_Template->render( )../TwigEngine.php:53
440.969826177024Twig_Template->display( )../classes.php:9296
450.969826177720Twig_Template->displayWithErrorHandling( )../classes.php:9286
460.969826177896__TwigTemplate_97b50389d17f06978fb7d362c36a5baa->doDisplay( )../classes.php:9308
470.976826706456Symfony\Component\Form\FormRenderer->searchAndRenderBlock( )../0389d17f06978fb7d362c36a5baa.php:32
480.976826711480Symfony\Bridge\Twig\Form\TwigRendererEngine->renderBlock( )../FormRenderer.php:255
490.976826730920Twig_Template->displayBlock( )../TwigRendererEngine.php:58
500.976826736504call_user_func
( )../classes.php:9189
510.976826736536__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_form_widget( )../classes.php:9189
520.976826753296Twig_Template->displayBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:273
530.976926758792call_user_func
( )../classes.php:9189
540.976926758824__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_form_widget_compound( )../classes.php:9189
550.977126784128Twig_Template->displayBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:330
560.977126789496call_user_func
( )../classes.php:9189
570.977126789528__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_form_rows( )../classes.php:9189
580.977126813344Symfony\Component\Form\FormRenderer->searchAndRenderBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:1036
590.977226824856Symfony\Bridge\Twig\Form\TwigRendererEngine->renderBlock( )../FormRenderer.php:255
600.977226844496Twig_Template->displayBlock( )../TwigRendererEngine.php:58
610.977226850528call_user_func
( )../classes.php:9189
620.977226850560__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_field_row( )../classes.php:9189
630.977226850672Twig_Template->displayBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:1154
640.977226856600call_user_func
( )../classes.php:9189
650.977226856632__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_form_row( )../classes.php:9189
660.981326894288Symfony\Component\Form\FormRenderer->searchAndRenderBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:934
670.981326901896Symfony\Bridge\Twig\Form\TwigRendererEngine->renderBlock( )../FormRenderer.php:255
680.981326921536Twig_Template->displayBlock( )../TwigRendererEngine.php:58
690.981326928136call_user_func
( )../classes.php:9189
700.981326928168__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_date_widget( )../classes.php:9189
710.981426945264Symfony\Component\Form\FormRenderer->searchAndRenderBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:661
720.981526957960Symfony\Bridge\Twig\Form\TwigRendererEngine->renderBlock( )../FormRenderer.php:255
730.981526978128Twig_Template->displayBlock( )../TwigRendererEngine.php:58
740.981526984856call_user_func
( )../classes.php:9189
750.981526984888__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_choice_widget( )../classes.php:9189
760.981527001648Twig_Template->displayBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:394
770.981527008272call_user_func
( )../classes.php:9189
780.981527008304__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_choice_widget_collapsed( )../classes.php:9189
790.981627029920Twig_Template->displayBlock( )../79c6a3f6d43c85980cb7d0f5b526.php:482
800.981627036432call_user_func
( )../classes.php:9189
810.981627036464__TwigTemplate_566979c6a3f6d43c85980cb7d0f5b526->block_choice_widget_options( )../classes.php:9189
820.981727064672SapLibrary\Bundle\TranslationBundle\Twig\TranslationExtension->transFilterWithNoSpan( )../79c6a3f6d43c85980cb7d0f5b526.php:537
830.981727064720SapLibrary\Bundle\TranslationBundle\Twig\TranslationExtension->transFilter( )../TranslationExtension.php:60
840.981727064720SapLibrary\Bundle\TranslationBundle\Service\TranslationService->translate( )../TranslationExtension.php:55
850.981727064720SapLibrary\Bundle\TranslationBundle\Service\TranslationService->translateContent( )../TranslationService.php:128
860.981727065432SapLibrary\Bundle\TranslationBundle\Service\TranslationService->loadTranslationItem( )../TranslationService.php:172
870.982127065432SapLibrary\Bundle\TranslationBundle\Repository\ItemRepository->findItem( )../TranslationService.php:239
880.982227068160Doctrine\ORM\AbstractQuery->getResult( )../ItemRepository.php:27
890.982227068256Doctrine\ORM\AbstractQuery->execute( )../AbstractQuery.php:538
900.982227068608Doctrine\ORM\Query->_doExecute( )../AbstractQuery.php:737
910.982327069704Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute( )../Query.php:264
920.982327069704Doctrine\DBAL\Connection->executeQuery( )../SingleSelectExecutor.php:46
930.982327069704Doctrine\DBAL\Logging\LoggerChain->startQuery( )../Connection.php:631
940.982327069704Symfony\Bridge\Doctrine\Logger\DbalLogger->startQuery( )../LoggerChain.php:50
950.982327069800Symfony\Component\HttpKernel\Debug\Stopwatch->start( )../DbalLogger.php:46
960.982327069848Symfony\Component\HttpKernel\Debug\Section->startEvent( )../Stopwatch.php:80
970.982327069848Symfony\Component\HttpKernel\Debug\StopwatchEvent->start( )../Stopwatch.php:207
980.982327069848Symfony\Component\HttpKernel\Debug\StopwatchEvent->getNow( )../StopwatchEvent.php:69
990.982327069896Symfony\Component\HttpKernel\Debug\StopwatchEvent->formatTime( )../StopwatchEvent.php:162

Please let me know if I am doing anything wrong or if this is a bug in the 2.1 version, and if so when an update would be possible.

Many Thanks,

Duncan

Issue 2:
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