<p dir="auto">Hello,</p>
<p dir="auto">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:</p>
<p dir="auto">$builder-&gt;add('fromDate', 'date');</p>
<p dir="auto">The 'form_widget' call set in the template and outputting the following:</p>

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

<p dir="auto">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.</p>
<p dir="auto">Many Thanks,</p>
<p dir="auto">Duncan</p>
<p dir="auto">Many applications are generating memory size and function nesting errors after upgrading to Symfony 2.1.7</p>
<p dir="auto">For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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-&gt;hasReference() /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:962
...
99. Symfony\Component\DependencyInjection\Dumper\PhpDumper-&gt;hasReference() /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:971"><pre class="notranslate"><code class="notranslate">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-&gt;hasReference() /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:962
...
99. Symfony\Component\DependencyInjection\Dumper\PhpDumper-&gt;hasReference() /src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:971
</code></pre></div>
<p dir="auto">The above error is generated by xdebug. But even increasing <code class="notranslate">xdebug.max_nesting_level</code> to 10000 (!) doesn't work, it keeps on showing <code class="notranslate">PhpDumper-&gt;hasReference()</code> messages.</p>
<p dir="auto">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.</p>
<p dir="auto">For example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32 bytes)
in /src/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 680"><pre class="notranslate"><code class="notranslate">Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 32 bytes)
in /src/Symfony/Component/DependencyInjection/ContainerBuilder.php on line 680
</code></pre></div>
<p dir="auto">And after reloading the page:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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"><pre class="notranslate"><code class="notranslate">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
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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"><pre class="notranslate"><code class="notranslate">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
</code></pre></div>
<p dir="auto">Even after increasing the memory limit to 10 GB (!) those errors just keep on coming. Seems like an infinite loop.</p>
<p dir="auto">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?</p>
<p dir="auto">PHP 5.4.11 + XCache</p>